Repository navigation
fix(decisions): report applied tool restrictions - #174013
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR adds debug observations for proposed, applied, and restored Decision tool restrictions, including model-facing tool counts. Example: A structured tool surface contains read, write, and a host-required message tool.
Review scores
ProductKind: Maintenance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open: the diagnostic improvement is useful, but its new mock introduces a concrete CI ratchet failure. Priority: P3 Before merge
Findings
Agent review detailsHow this fits togetherThe embedded runner combines Decision results with host and hook tool policy before model submission; the existing decisions logger receives bounded status and count observations. flowchart TD
A[Prompt assembly] --> B[Decision evaluation]
B --> C[Existing tool policy owner]
D[Host and hook policy] --> C
C --> E[Model submission]
B --> F[Decision debug logger]
C --> F
Technical reviewBest possible solution: Keep observations at the existing policy owner and replace the closed test mock with a scoped spy while preserving the diagnostic contract. Do we have a high-confidence way to reproduce the issue? Current-main source explicitly leaves provider caller effects unobserved and has no matching consumer observations; no runtime reproduction was performed. Is this the best way to solve the issue? Recording bounded facts where restrictions are applied and withdrawn preserves ownership and avoids inferring policy effects from provider success. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 62240dbc4fa6. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +29, Tests +25. Total +54 across 6 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 4:38 AM ET / 08:38 UTC. |
|
Merged via squash.
|
* fix(decisions): report applied tool restrictions * test(decisions): document policy diagnostic isolation
What Problem This Solves
Operators cannot distinguish a successful Decision evaluation from whether its automatic tool restriction was proposed, applied, or restored before dispatch.
User Impact
Debug diagnostics now record bounded consumer status and model-facing tool counts at the policy owner. Model routing, restriction policy, and tool output are unchanged.
Why This Change Was Made
The existing consumer policy owner records actual application and withdrawal separately from the provider evaluation log. The provider's existing
not-observedresult remains unchanged; these observations do not claim tool dispatch or task success.The change adds no configuration, schema, storage, or caller-authored identifiers. Production code increases by 29 net lines to record facts at their owning boundary; tests increase by 25 net lines.
Evidence
git diff --checkpassed.src/decisions/diagnostics.test.ts,src/agents/embedded-agent-runner/run/attempt-prompt-tool-policy.test.ts, andsrc/agents/embedded-agent-runner/run/attempt-prompt-build.provenance.test.tsbefore landing.