Skip to content

Keep a running user turn's approvals when a non-user message steers into it - #8096

Merged
ymichael merged 1 commit into
mainfrom
bb/7040-codex-accept-edits-non-user-steer-can-silen-thr_jnfqbhuram
Nov 26, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/7040-codex-accept-edits-non-user-steer-can-silen-thr_jnfqbhuram

Conversation

@ymichael

@ymichael ymichael commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A message that isn't from the user (another thread's bb thread tell, a child-outcome system notice) runs with permission escalation deny. When it arrived during a turn the user started, the dispatcher steered it into that turn, and runtime.steerTurn took the steer's options as the thread's new options. That revoked the running turn's approvals. Codex's bridge saw the changed permission settings and restarted the active turn with approvalPolicy: never, so the step that needed approval was aborted and no prompt appeared. Bridges where the runtime enforces approvals (Pi, ACP) kept running the user's work, but the runtime gate now read deny and declined its later approval requests before any interaction was persisted. I reproduced it on main with real Codex in Accept Edits, 2 of 2 times: a turn ran sleep 20 and then wrote outside the workspace, another thread sent "FYI, my build finished" during the sleep, and Codex replied "Step 1 was interrupted… Step 2 did not run, and no approval was requested". #7040 asks that informational input not change an active turn's authority.

What changed

  • Runtime (runtime.ts, execution-options.ts): steerTurn never lowers a running turn's escalation from ask to deny (keepRunningTurnApprovals). The provider isn't told to drop approvals, and the runtime gate keeps asking. Non-user messages still join a user-started turn as they do on main. Only the escalation is kept; everything else in the steer's options applies as before. A user steer can still raise a deny turn to ask. A strictly fixed per-turn copy would block that and cause the same silent decline in the other direction.
  • Logging (runtime-provider-requests.ts): every approval request the runtime declines without asking now logs the request id, turn, thread and reason (deny escalation or no handler). Command contents aren't logged. A kept escalation logs a line too.
  • Scripted echo test bridge: a new approve_after_steer:<kind> directive holds the turn until a steer joins it, then raises the approval from that same turn.
  • No server, dispatch or docs change. No server/daemon wire field or plugin SDK surface changed, so there is no HOST_DAEMON_PROTOCOL_VERSION or SDK bump.

How you verified

  • tests/integration/fake/smoke/non-user-steer-approvals.test.ts runs the Codex accept-edits: non-user steer can silently change the active turn approval gate #7040 path end to end on a real server, daemon and scripted echo bridge. A user starts an Accept Edits turn, and another thread's tell (senderThreadId, initiator agent) joins it. The turn's later approval reaches the user as a pending interaction. After it is allowed, the turn answers with its own response, and its only turn/completed has status completed. With runtime.ts reverted to main the test fails: no approval reaches the user.
  • runtime.interactive-requests.test.ts has a two-row table. An ask turn steered with deny still routes its next approval to the user, and a deny turn steered with ask starts asking. Each row fails when keepRunningTurnApprovals is mutated to always take the requested or always keep the running escalation. A declined approval logs its reason.
  • pnpm exec turbo run typecheck lint test for @bb/server (4583 passed), @bb/agent-runtime (319), @bb/host-daemon (930), @bb/templates (47) and bb-plugin-scripted-echo-provider. Typecheck and lint pass for @bb/integration-tests.
  • Live, with real Codex in Accept Edits on pnpm start:worktree: a user turn ran sleep 20 and then echo done > ~/bb-7040-live-outside/out.txt. Another thread's tell arrived during the sleep and was delivered as sent, joining the turn. The sleep kept running and the approval prompt for the write appeared while the thread was still active. After approval Codex reported "sleep 20 finished with exit code 0" and "After approval, the shell wrote done", and the file was written. The thread had one turn: the tell's input was accepted into it, and it ended completed.
  • Claude Code, ACP and Pi were checked by reading the code, not live. The fix sits in the shared runtime steer path every provider goes through.

Fixes #7040

🤖 Generated with Claude Code

AGENT GENERATED

…nto it

A non-user message (another thread's bb thread tell, a child-outcome system
notice) resolves to permission escalation "deny". When it steered into a turn
the user started, runtime.steerTurn recorded the steer's options as the
thread's options, so the provider was told to drop approvals (Codex restarted
the turn with approvalPolicy never) and runtime-enforced bridges declined the
turn's later approvals without asking.

steerTurn now never lowers a running turn's escalation from ask to deny
(keepRunningTurnApprovals); a user steer can still raise deny to ask. The
runtime also logs every approval it declines without asking.

Fixes #7040

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael force-pushed the bb/7040-codex-accept-edits-non-user-steer-can-silen-thr_jnfqbhuram branch from 32d274d to 5e587c8 Compare November 26, 2026 04:03
@ymichael ymichael changed the title Queue non-user messages behind a user's running turn so they can't revoke its approvals Keep a running user turn's approvals when a non-user message steers into it Nov 26, 2026
@ymichael
ymichael merged commit 775090b into main Nov 26, 2026
36 checks passed
@ymichael
ymichael deleted the bb/7040-codex-accept-edits-non-user-steer-can-silen-thr_jnfqbhuram branch November 26, 2026 04:19
alexburlis added a commit to alexburlis/omnyo that referenced this pull request Nov 26, 2026
Record the upstream PRs, revisions, contributors, and Omnyo integration
commits for merge d2a24ac in docs/upstream-credits.md.

Original-PR: get-bb/bb#7663
Original-Commit: get-bb/bb@1737a03
Original-Author: rufi
Original-PR: get-bb/bb#8055
Original-Commit: get-bb/bb@651ae20
Original-Author: Jake Lancaster
Original-PR: get-bb/bb#8075
Original-Commit: get-bb/bb@511e1ed
Original-Author: Jake Lancaster
Original-Co-Author: Michael Yong
Original-Co-Author: Claude Opus 5.5
Original-PR: get-bb/bb#8096
Original-Commit: get-bb/bb@775090b
Original-Author: Michael Yong
Original-Co-Author: Claude Opus 5.5
Original-PR: get-bb/bb#8145
Original-Commit: get-bb/bb@8de6711
Original-Commit: get-bb/bb@0d3db49
Original-Commit: get-bb/bb@92d3a76
Original-Commit: get-bb/bb@6705422
Original-Author: Michael Yong
Original-Co-Author: Claude Opus 5.5
Original-PR: get-bb/bb#8171
Original-Commit: get-bb/bb@b56ed04
Original-Author: Jake Lancaster
Original-PR: get-bb/bb#8238
Original-Commit: get-bb/bb@2a9a142
Original-Author: SawyerHood
Original-PR: get-bb/bb#8247
Original-Commit: get-bb/bb@ba4ae22
Original-Author: Salem
Original-Co-Author: Claude Opus 5.5
Original-PR: get-bb/bb#8259
Original-Commit: get-bb/bb@96f40a9
Original-Author: SawyerHood
Original-PR: get-bb/bb#8263
Original-Commit: get-bb/bb@141e40a
Original-Author: mk
Original-PR: get-bb/bb#8266
Original-Commit: get-bb/bb@84e20e9
Original-Author: ILIA GOLUBEV
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.

Codex accept-edits: non-user steer can silently change the active turn approval gate

1 participant