Skip to content

fix(permission): key worker grants on the dispatched call - #1521

Merged
corbits-triage[bot] merged 2 commits into
cl-10854-stop-a-settled-approval-overlay-from-aborting-permissionfrom
cl-10855-key-a-workers-authorized-retry-on-the-dispatched-call-so-the
Oct 19, 2026
Merged

corbits-triage[bot] merged 2 commits into
cl-10854-stop-a-settled-approval-overlay-from-aborting-permissionfrom
cl-10855-key-a-workers-authorized-retry-on-the-dispatched-call-so-the

Conversation

@bwachman

@bwachman bwachman commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The worker grant identity (tool, arguments, cwd) is computed from the call as DynamicToolRunner dispatches it, through the same prepareDispatchedToolCall coercion, at both the reactor authorize stage and the permission middleware. An authorized retry of a gpt-family shell call now executes exactly once.
  • Before, authorize keyed the grant on the raw wire call (shell with {command, timeout, cwd, background, stop}), while the middleware saw the coerced run_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.
  • Envelopes now freeze the dispatched arguments, so the parent approves exactly what runs. A replay is still denied as consumed, and a changed command is still denied at both stages.

Stacked on #1520; review that first. The diff against its branch is this change only.

Verification

  • bun run check passes (9237 tests)
  • The new test runs the live gpt-family shell call 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.
  • Live, interactive TUI without yolo, gpt-family model, on a build of this branch (with fix(tui): deliver approvals for parked calls in queue-drained turns #1519 and fix(session): release a settled approval overlay before delivering #1520): worker shell call denied, ask_director, approve_worker_call approved, 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

@linear-code

linear-code Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

CL-10852

CL-10855

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — subject test(permission): cover an authorized retry of a dispatch-coerced worker call is 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.

@TheGreatAxios
TheGreatAxios force-pushed the cl-10854-stop-a-settled-approval-overlay-from-aborting-permission branch from a0735f0 to 162692d Compare October 18, 2026 22:36
@TheGreatAxios
TheGreatAxios force-pushed the cl-10855-key-a-workers-authorized-retry-on-the-dispatched-call-so-the branch from 4162327 to 9801313 Compare October 18, 2026 22:36
@bwachman
bwachman force-pushed the cl-10854-stop-a-settled-approval-overlay-from-aborting-permission branch from 162692d to c03784d Compare October 18, 2026 22:50
@bwachman
bwachman force-pushed the cl-10855-key-a-workers-authorized-retry-on-the-dispatched-call-so-the branch from 9801313 to 787b80c Compare October 18, 2026 22:50
@bwachman

Copy link
Copy Markdown
Contributor Author

Kept your reworded subjects through the rebase onto the updated #1520 (5390b8a, 787b80c). git range-diff shows both commits identical to your push apart from the base; no other changes.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@corbits-triage

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@corbits-triage
corbits-triage Bot merged commit d36740c into cl-10854-stop-a-settled-approval-overlay-from-aborting-permission Oct 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants