Repository navigation
fix(agent): unblock Claude tool approvals; add provider fixtures - #109
Merged
Merged
Conversation
Add manifest-backed fixtures for text, tool use, decisions, usage, error, interrupt, and completion for both providers, plus integrity tests that validate wire shape, semantic payload coverage, and exactly one terminal event per terminating fragment. Also allow too_many_arguments on codex_session::turn_start_params so clippy -D warnings stays green on the current toolchain. Verified: cargo test (692 passed, 9 ignored); cargo clippy -- -D warnings; cargo fmt --check. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The Claude CLI now requires every control_response allow to carry a
record updatedInput (and every deny a string message). LoopDeck emitted a
bare {"behavior":"allow"} for policy auto-approvals and plan approvals,
so the CLI rejected every mutating tool call before execution with a
ZodError. Unattended runs could read but never write, forcing a BLOCK
verdict.
ControlResponsePayload::allow now takes the original tool input and
always serializes it as updatedInput. All permission, manual-approval,
plan-approval, and AskUserQuestion paths pass the request input through;
deny always serializes a message. Regression tests cover both allow
shapes.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR now covers two related pieces needed for
prd-provider-contract:capture-fixtures).The fix
The Claude CLI now requires every
control_responseallow to carry a recordupdatedInput(and every deny a stringmessage). LoopDeck emitted a bare{"behavior":"allow"}for policy auto-approvals and plan approvals, so the CLI rejected every mutating tool call before execution with aZodError. An unattended provider-contract run could read but never write, forcing aBLOCKverdict.ControlResponsePayload::allownow takes the original tool input and always serializes it asupdatedInput. All permission, manual-approval, plan-approval, andAskUserQuestionpaths pass the request input through; deny always serializes a message. Regression tests cover both allow shapes.Provider fixtures
Hand-authored from the adapters' documented wire shapes (
agents::parse_stream_line,codex_session); no live account capture was available. The fixtures README records that provenance and the path for replacing them with sanitized live captures.text,tool-use,decisions,usage,error,interrupt,completedmanifest.jsonmaps each scenario to both provider files, expected semantic payloads, and terminal outcomeprovider_fixture_tests.rschecks JSON validity, Claude-parser compatibility, Codex envelope shape, payload coverage, one terminal event per terminating fragment, and secret/home-path cleanlinessTest plan
cd src-tauri && cargo testcd src-tauri && cargo clippy -- -D warningscd src-tauri && cargo fmt --checksrc-tauri/tests/fixtures/provider-events/manifest.jsonand confirm every scenario has paired Claude/Codex files and a declared terminal outcomeLocal verification:
cargo test692 passed / 9 ignored,cargo clippy -- -D warningsclean,cargo fmt --checkclean.🤖 Generated with Claude Code