Repository navigation
fix(permission): key worker grants on the dispatched call - #1521
Conversation
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Request changes
Keys the worker-grant fingerprint on the dispatched call, so an authorized retry of a gpt-family shell call matches the coerced run_shell the middleware actually runs.
Findings
a25ce3c4— subjecttest(permission): cover an authorized retry of a dispatch-coerced worker callis 77 characters. The cap is 72. Shorten it. The fix subject is within the cap, and both bodies are empty, which is allowed.
Code check: no defect in the fingerprint. dispatchedCall at src/permission/reactor-authorize.ts:112 runs prepareDispatchedToolCall before workerCallIdentity, and a throw keeps the raw arguments while dispatch never reaches the middleware. bun test src/permission/worker-grant-dispatch-identity.test.ts — 2 pass, 0 fail, including one execution, a consumed replay, and a changed command denied.
a0735f0 to
162692d
Compare
4162327 to
9801313
Compare
162692d to
c03784d
Compare
9801313 to
787b80c
Compare
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Approve
Keys the worker-grant fingerprint on the dispatched call, so an authorized retry of a gpt-family shell call matches the coerced run_shell the middleware runs.
Findings
No findings.
The previous finding was the test subject length. It is now test(permission): cover an authorized coerced-shell retry (57 characters). The unique diff against the current #1520 tip is still only src/permission/reactor-authorize.ts and its test. workerCallIdentity at src/permission/reactor-authorize.ts:121 takes the tool and arguments from prepareDispatchedToolCall. The rebase did not widen the grant. bun test src/permission/worker-grant-dispatch-identity.test.ts — 2 pass, 0 fail.
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
d36740c
into
cl-10854-stop-a-settled-approval-overlay-from-aborting-permission
Summary
DynamicToolRunnerdispatches it, through the sameprepareDispatchedToolCallcoercion, at both the reactor authorize stage and the permission middleware. An authorized retry of a gpt-familyshellcall now executes exactly once.shellwith{command, timeout, cwd, background, stop}), while the middleware saw the coercedrun_shell {command}. The envelope was authorized under the first fingerprint, the middleware missed it, re-evaluated to ask, and blocked the approved retry under a new grant request.Stacked on #1520; review that first. The diff against its branch is this change only.
Verification
bun run checkpasses (9237 tests)shellcall through the real permission gate, worker gate, grant store, dispatch coercion and permission middleware. On the base branch the approved retry is blocked and a new grant request is minted; here it executes once, a replay is denied and an altered command is denied.shellcall denied,ask_director,approve_worker_callapproved, nested prompt for the frozen call approved, then the worker's retry executed exactly once and returned the command's real result. Before this change the approved retry was blocked under a new grant request.Fixes CL-10855
Part of CL-10852