Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shared): give CommandResolutionError a message #7502

Closedkrutftw(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7502/headopened View on GitHub

What Changed

CommandResolutionError in packages/shared/src/shell.ts now defines an override get message() that includes the command name and reason:

Command "cursor-agent" could not be resolved (not-found).

Four lines, one class, no behavioural change. Nothing reads .message today (the only other reference is Effect.catchTag("CommandResolutionError", ...) in apps/server/src/provider/providerMaintenance.ts), so this is purely a diagnostics fix. Follows the same override get message(): string pattern already used by the other error classes in packages/shared.

Why

The class is a Data.TaggedError with command/reason fields but no message, so every span that fails with it is written to server.trace.ndjson as a bare

"exit":{"_tag":"Failure","cause":"CommandResolutionError: \n    at file:///.../bin.mjs:45981:51\n    at shell.resolveCommandPathForPlatform (..."}

On a Windows 11 machine running 0.0.34-nightly.20260819.1132 I counted 114 such shell.resolveCommandPath/shell.resolveCommandPathForPlatform failure exits in one session (editor discovery + provider binary probes) and there is no way to tell from the trace which command was being looked up. With this change the cause line carries the command and reason, which is what you need when triaging "provider not found" / editor discovery reports.

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (n/a)
  • I included a video for animation/interaction changes (n/a)

Authorship disclosure: this change was investigated and prepared by Claude (Fable 5) running in Claude Code on the author's machine, at the author's request.


Note

Low Risk Single-class logging/diagnostics tweak with no change to resolution logic or error handling behavior.

Overview CommandResolutionError in shell.ts now implements override get message(), producing text like Command "cursor-agent" could not be resolved (not-found). instead of an empty tagged-error message.

This is diagnostics-only: failure paths and Effect.catchTag("CommandResolutionError", …) behavior are unchanged. The goal is readable server.trace.ndjson / span failure causes when shell.resolveCommandPath fails during editor discovery or provider binary probes (especially on Windows).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a3efe311e75b0f959f4c4b3267cfd8018fa1c2d9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fix CommandResolutionError to expose a formatted error message

Adds a message getter override to CommandResolutionError in shell.ts that returns Command "${this.command}" could not be resolved (${this.reason}). instead of the default inherited from TaggedError.

Macroscope summarized a3efe31.
    1. You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

    2. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 044d95ca-e103-4ecc-a087-9256f424eeea

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    4. One convention issue found in packages/shared/src/shell.ts.

      Posted via Macroscope — Effect Service Conventions
      @@ -47,4 +47,6 @@
      4747 export class CommandResolutionError extends Data.TaggedError("CommandResolutionError")<{
      4848 readonly command: string;
      4949 readonly reason: "not-found";
      50-}> {}
      50+}> {
      51+ override get message(): string {
      52+ return `Command "${this.command}" could not be resolved (${this.reason}).`;
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      The derived message re-states reason, which only ever has the single value "not-found" and is already encoded by the CommandResolutionError tag — that discriminates the same failure twice. Consider deriving the message from command alone, and dropping the singleton reason field (plus its four construction sites in this file) so there is one coherent model.

      Suggested change
      52- return `Command "${this.command}" could not be resolved (${this.reason}).`;
      52+ return `Command "${this.command}" could not be resolved.`;
      Posted via Macroscope — Effect Service Conventions
    5. Approvability

      Verdict: Approved at a3efe31

      Macroscope's review found this PR approvable — Simple addition of a message getter to an error class for better error readability. No behavior change beyond improved error messages. The open review comment is a style suggestion, not a blocking issue.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. Note

      This comment is posted by Julius' dot

      Closing under the verification requirement. The trace establishes the missing diagnostic, but the PR includes no focused test or manual result showing the new message in an error or trace. Add a regression assertion for the formatted message, report its result, and request reconsideration.

    7. juliusmarminge closed this

Sign in to join this conversation.