Skip to content

fix(cli): report typed JSON error codes for cloud service client binary errors (#1443) - #1447

Merged
sdairs merged 1 commit into
claude/no-stray-local-dir-oauth-timeoutfrom
claude/service-client-json-errors
Nov 16, 2026
Merged

sdairs merged 1 commit into
claude/no-stray-local-dir-oauth-timeoutfrom
claude/service-client-json-errors

Conversation

@sdairs

@sdairs sdairs commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Why: cloud service client (#1154) runs local binary resolution, --login version checks, and launchability pre-flight under Commands::Cloud, so in --json or agent mode its pre-flight failures went through CloudErrorDetail::from_error and collapsed to "code": "other" with no command.

What: Reuse local::output::installed_client_error in CloudErrorDetail::from_error so cloud service client emits invalid_version, version_not_installed, version_selection_required, binary_not_launchable, and unsupported_client_version with the same runnable repair command as local client. Document the codes in docs/reference/automation.md.

QA: Unit test in cloud::output verifying every mapped variant's JSON envelope and parsing each command step through clap, plus a subprocess test in tests/cloud/query.rs (service_client_too_old_build_reports_a_typed_json_error).

Risks: Low; additive CloudErrorCode variants replacing other for cloud service client local binary failures.

Closes #1443


Note

Low Risk
Additive JSON error codes and shared classification only; no API or auth changes—other is replaced for a specific set of local pre-flight failures on cloud service client.

Overview
cloud service client now surfaces the same local build pre-flight failure codes in --json as local client, instead of collapsing them to other with no recovery hint.

Five new CloudErrorCode values (invalid_version, version_not_installed, version_selection_required, binary_not_launchable, unsupported_client_version) are wired through a shared installed_client_error helper in local/output.rs and CloudErrorDetail::from_error, each with the same runnable command as local mode.

Documentation in automation.md lists these codes for automation. Coverage includes unit tests for every mapped variant (including clap-validated repair commands) and an integration test that an too-old build fails before any Cloud API call with unsupported_client_version.

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

…ry errors (#1443)

cloud service client runs the local client pre-flight (version resolution,
--login support, launchability) under Commands::Cloud, so its JSON errors
went through CloudErrorDetail::from_error and collapsed to `other` with no
command. Reuse the local classification for those variants so the Cloud
envelope reports invalid_version, version_not_installed,
version_selection_required, binary_not_launchable and
unsupported_client_version with the same repair command as local client.
@sdairs
sdairs requested a review from iskakaushik as a code owner November 13, 2026 12:49
@sdairs
sdairs added this pull request to stack #1285 November 13, 2026 22:43

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sdairs
sdairs merged commit 94d7870 into main Nov 16, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud service client: report typed JSON error codes and repair commands for local binary failures

2 participants