Skip to content

[codex] Structure missing provider command failures#3384

Open
juliusmarminge wants to merge 1 commit into
mainfrom
codex/structure-provider-command-errors
Open

[codex] Structure missing provider command failures#3384
juliusmarminge wants to merge 1 commit into
mainfrom
codex/structure-provider-command-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the message-only provider command execution error with a schema-backed missing-command error
  • preserve the command path, exit code, stdout, and stderr as structured diagnostics
  • keep missing-command classification compatible with ordinary spawn errors

Tests

  • vp test apps/server/src/provider/providerSnapshot.test.ts
  • vp check
  • vp run typecheck

Note

Low Risk
Localized error-type change in provider spawn probing; behavior for callers using isCommandMissingCause stays compatible, with richer failure data available.

Overview
Replaces the generic ProviderCommandExecutionError (message-only) with ProviderCommandNotFoundError, a schema-backed tagged error that carries binaryPath, exitCode, stdout, and stderr when a provider CLI spawn fails with Windows “command not found” semantics.

spawnAndCollect now fails with that structured error instead of synthesizing an ENOENT-style message. isCommandMissingCause treats the new error type as a missing command while still matching legacy message patterns (enoent / notfound).

Adds a unit test asserting diagnostics and message formatting for a typical Windows 9009 failure.

Reviewed by Cursor Bugbot for commit 0b2b3d8. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Structure provider command-not-found failures with typed ProviderCommandNotFoundError

  • Replaces the generic ProviderCommandExecutionError (message-only) with a Schema.TaggedErrorClass called ProviderCommandNotFoundError that carries binaryPath, exitCode, stdout, and stderr fields.
  • Updates isCommandMissingCause to detect ProviderCommandNotFoundError via a type guard first, falling back to substring checks on the error message.
  • Updates spawnAndCollect to emit ProviderCommandNotFoundError (with structured diagnostics) on Windows command-not-found cases instead of the old generic error.
  • Risk: ProviderCommandExecutionError is removed; any callers that matched on that type will break.

Macroscope summarized 0b2b3d8.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

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

Run ID: 0c360d7e-226d-4e11-ba8d-332c29a1919e

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/structure-provider-command-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR refactors an error class to use structured fields (binaryPath, exitCode, stdout, stderr) instead of a plain message string, improving diagnostics for command-not-found failures. The change is self-contained with added unit tests and no behavioral impact beyond richer error information.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant