Skip to content

fix(agent): unblock Claude tool approvals; add provider fixtures - #109

Merged
suprie merged 5 commits into
mainfrom
feat/provider-event-fixtures
Oct 28, 2026
Merged

suprie merged 5 commits into
mainfrom
feat/provider-event-fixtures

Conversation

@suprie

@suprie suprie commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR now covers two related pieces needed for prd-provider-contract:

  1. Sanitized provider fixtures for Claude and Codex, with manifest-backed integrity tests (Phase 1 capture-fixtures).
  2. A Claude control-response fix that unblocks unattended tool use.

The fix

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. An unattended provider-contract run 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.

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.

  • 7 scenarios per provider: text, tool-use, decisions, usage, error, interrupt, completed
  • manifest.json maps each scenario to both provider files, expected semantic payloads, and terminal outcome
  • provider_fixture_tests.rs checks JSON validity, Claude-parser compatibility, Codex envelope shape, payload coverage, one terminal event per terminating fragment, and secret/home-path cleanliness

Test plan

  • cd src-tauri && cargo test
  • cd src-tauri && cargo clippy -- -D warnings
  • cd src-tauri && cargo fmt --check
  • Inspect src-tauri/tests/fixtures/provider-events/manifest.json and confirm every scenario has paired Claude/Codex files and a declared terminal outcome

Local verification: cargo test 692 passed / 9 ignored, cargo clippy -- -D warnings clean, cargo fmt --check clean.

🤖 Generated with Claude Code

suprie and others added 5 commits October 13, 2026 06:08
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>
@suprie suprie changed the title test(provider): add sanitized Claude and Codex event fixtures fix(agent): unblock Claude tool approvals; add provider fixtures Oct 28, 2026
@suprie
suprie merged commit 9ca0699 into main Oct 28, 2026
2 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.

1 participant