Skip to content

fix(#3129): handle trailing json format for diff errors - #3161

Merged
code-yeongyu merged 1 commit into
mainfrom
fix/issue-3129-diff-arg-json-hang
May 27, 2026
Merged

fix(#3129): handle trailing json format for diff errors#3161
code-yeongyu merged 1 commit into
mainfrom
fix/issue-3129-diff-arg-json-hang

Conversation

@Yeachan-Heo

Copy link
Copy Markdown
Contributor

Summary

  • keep malformed claw diff ... --output-format json invocations on the parser error path
  • add regression coverage for trailing JSON output-format after malformed diff args
  • preserve nonzero JSON error envelopes with error_kind, hint, and message

Fixes #3129.

Tests

  • git diff --check
  • cargo fmt --check
  • cargo test -p rusty-claude-cli diff_extra_args_have_typed_error_kind_and_hint_766 --test output_format_contract
  • cargo test -p rusty-claude-cli diff_trailing_json_after_malformed_args_is_bounded_json_3129 --test output_format_contract
  • cargo test -p rusty-claude-cli diff_non_git_dir_has_error_kind_and_hint_801 --test output_format_contract

Notes

  • Direct ./rust/target/debug/claw ... smoke was inconclusive in this environment because local auth/provider configuration intercepted the invocation with an Invalid bearer token response; focused Rust integration tests cover the parser/output contract.

Keep malformed diff invocations with trailing JSON format flags on the parser error path and lock the contract with focused output-format regressions.

Constraint: Do not touch tracked .omx state files.

Rejected: Repeating direct binary smoke loops | local auth/provider configuration intercepts those invocations and obscures parser behavior.

Confidence: high

Scope-risk: narrow

Tested: git diff --check; cargo fmt --check; cargo test -p rusty-claude-cli diff_extra_args_have_typed_error_kind_and_hint_766 --test output_format_contract; cargo test -p rusty-claude-cli diff_trailing_json_after_malformed_args_is_bounded_json_3129 --test output_format_contract; cargo test -p rusty-claude-cli diff_non_git_dir_has_error_kind_and_hint_801 --test output_format_contract
@code-yeongyu
code-yeongyu merged commit ae6a207 into main May 27, 2026
6 checks passed
@1716775457damn

Copy link
Copy Markdown

Thanks for this fix. Trailing JSON is a common edge case when CLI tools mix stdout and stderr or append diagnostic output after valid JSON. Good catch.

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.

diff extra args before --output-format json hang with zero stdout

3 participants