Repository navigation
refactor: separate steering delivery from policy preparation - #181994
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 maintainer review before merge. What this changesThis PR separates steering delivery eligibility from policy preparation while retaining observations on the exact selected policy binding. Example: Alice sends “change the current work” while her active execution retains an unchanged predecessor recovery claim.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a maintainer-authored architectural followup that preserves the steering contract, and no actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway and channel messages enter session-controller steering admission, which checks the captured execution and current caller policy before delivering input to the active backend or preserving followup custody. flowchart LR
A[Incoming correction] --> B[Message join coordinator]
C[Selected policy binding] --> B
D[Delivery eligibility] --> B
E[Execution settings] --> B
B --> F[Final admission]
F --> G[Active backend]
B --> H[Followup queue]
Technical reviewBest possible solution: Keep delivery and settings composition in the existing message-join coordinator while binding historical observations and live checks to the exact policy snapshot. Do we have a high-confidence way to reproduce the issue? This PR preserves behavior after the merged retained-claim repair and does not claim to reproduce or diagnose the historical production incident. Is this the best way to solve the issue? The separation is coherent: existing owners retain policy and delivery decisions, the coordinator composes them, and the small observation module preserves the original capture points without a parallel authority manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c9f3f823da31. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +76, Tests +146. Total +222 across 21 files. Added test files: 0. View PR surface stats
Review metrics
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 23, 2026, 7:16 PM ET / 23:16 UTC. |
Related: #181768
What Problem This Solves
The retained-recovery-claim repair leaves steering delivery checks hidden inside tool-policy preparation and mixes recovery observations with execution settings, making binding lifetime and final admission difficult to review.
User Impact
No intended user-visible behavior change. Same-requester steering, collaborative steering, refusal/followup behavior, queue ordering, and legacy plugin compatibility retain their existing contracts. No configuration, storage, or migration changes are required.
Why This Change Was Made
The message-join coordinator now explicitly composes delivery eligibility, execution settings, and caller policy. Settings and recovery observations remain attached to the exact selected policy binding, preserving the existing capture points and invalidation lifecycle across replies and native attempts. Generic policy preparation no longer prepares delivery as a side effect.
Final submission still checks cancellation, the captured owner/backend, policy, settings, and delivery eligibility. The retained-predecessor exception stays limited to same-requester human continuation. Existing fallback warnings retain the specific typed rejection message without changing public fallback reasons.
This is the separately requested architectural followup to the merged repair. It does not establish the cause of the historical production incident, whose admission/rejection observations were not retained.
Evidence
Validated head:
1fb7cfea1e6f4b0eac13e9203d9a2c80541982e7. Focused validation and both live-model native proof cases are complete.reply-owner-endedandfollowup-queued, left the original task without the correction/effect, and consumed the correction once in a separately correlated subsequent task. Both harmless file effects had successful native tool results. Gateway run IDs, native threads/calls, direct task start/end records, claim checkpoints and actual effects were reconciled; transcript persistence and model claims were not treated as consumption proof.queue.mode: steerwithallowCollaborativeSteering: false; all eight exported screenshots were inspected. The replacement followup repeated the fixture's old barrier command and got exit 1 before its successful effect; that separate fixture/model outcome is retained in the evidence, not described as a clean tool run. Replacement occurred before correction preparation; focused tests cover later invalidation. These constructed cases do not establish the historical incident's cause.Scope, test costs, and LoC churn
Candidate versus merged base
3de0f0007f6951bf283041c90ae415984f48d1d8:Each command used
pnpm test <file> --maxWorkers=1. Measured wall seconds for the five changed test files:session-controller.message-join.test.tssession-controller.message-join.handoff.test.tstool-authority.runtime.admission.test.tstool-authority.runtime.continuation.test.tsagent-runner-fallback-steering.test.tsThe eight matched commands totaled 393.024 seconds on baseline and 394.413 on the candidate. The four additional caller checks took 221.697 seconds; candidate total 616.110 seconds. The final receiver-fix replay took 39.734 seconds for message join and 37.583 for authority admission; lint, core types, formatting and whitespace also passed. These include wrapper/setup/compilation and are not a controlled runtime benchmark. CI timing is pending.
The runtime build took 123.382 seconds and browser preparation 18.194 seconds. Live case wall times were 56.269 seconds (unchanged claim) and 60.779 seconds (replacement). Summing each native thread's final cumulative usage gives 212,691 total tokens, including 157,626 cached input tokens; this is recorded usage, not a billing estimate. No new live suite is added to per-PR CI.
No new persistent state, public snapshot field, authority manager, or per-tool authority layer is added.