Repository navigation
fix(runtime): keep a restored permission wait blocking prompts while the reattached screen shows its dialog - #38761
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…the reattached screen shows its dialog After an orca serve restart, the hook row that recorded a Claude permission wait is hydrated as restoredUnconfirmed and the explicit-status selector skipped it, so the send guard saw no evidence and typed into the open menu. No input reaches a pane while its runtime is down, so a dialog open at shutdown is still open. A restored permission row (not provider-session-only, inside the 30-minute window) now stands until a current screen shows no dialog: - The current screen is the caught-up headless grid, or, while that grid may hold only the bytes since reattach, the provider's current frame. An unreadable, blank or outdated screen keeps the wait (fail closed). - Status reads, prompt writes and the onPermission wait hold read the screen first when a restored wait stands, so a dialog answered after the restart lifts it without waiting on a hook. - Once a screen rules the dialog out, the restored wait is spent for that PTY; later output, such as the prompt's own echo, cannot revive it. Restored working/idle rows stay unconfirmed. Host-only change. Fixes #35962
nwparker
force-pushed
the
fix/35962-send-guard-adopted
branch
from
November 6, 2026 06:12
8ed34dd to
767624b
Compare
brennanb2025
added a commit
that referenced
this pull request
Nov 7, 2026
Resolve the pinned main sync in place, on main's new module organization: - Keep the shared readiness predicates (agent-state-rules, terminal-wait detection and tail window, qoder readiness, screen-input veto) at their shared owner; redirect main's moved importers to it - Carry the generated-input write options into terminal/input/agent-prompt-write-options, register the generated-input RPC methods in the method registry under methods/terminal - #38761: the restored-wait override passes the prompt's turn checks and retarget through - #38401: the moved render gate takes options.promptForSchedule as its third argument - #38939: typed pre-ready text recovers through the canonical notice, which carries Copy - Add to chat notes go through the generated operation unsubmitted - Split files main's growth and these additions took past the line budget by owner Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
If Claude was asking "Do you want to proceed?" when
orca serverestarted, the question was still on screen afterwards, but Orca forgot it was waiting for an answer.orca terminal sendthen typed the next prompt straight into that menu. Now Orca keeps treating the pane as waiting for permission until the screen shows the question is gone.What Changed
Before: after a server restart, the saved "waiting for permission" status is restored as unconfirmed, and the send guard ignored unconfirmed rows, so prompts went into the open dialog. After: a restored permission wait still blocks prompts (and status reads report
permission) while the pane's current screen could show the dialog.How:
onPermission: waithold read the screen first while a restored wait stands, so a dialog answered after the restart (for example with Esc, which posts no hook) lifts the wait without waiting for a hook.The logic lives in a new
OrcaRuntimeWithRestoredAgentDialogScreenstep of the runtime class chain (restored-agent-dialog-screen.ts). Restored working/idle rows stay unconfirmed as before.Why
The restored row is the only evidence that a dialog is open, and trusting it blindly would block a pane whose dialog was answered while Orca was down. Checking it against the screen (and failing closed when the screen can't be read) keeps the guard safe without leaving panes stuck.
Thank you @Sangkwun for the report.
Linked Issue
Fixes #35962
Visual Proof
N/A: host-side guard behaviour, covered by runtime tests.
Testing
agent-prompt-restored-permission.test.ts: refuses while the reattached screen still shows the dialog; sends once the provider-owned screen shows it dismissed; releases a held prompt once the dialog is dismissed; keeps the wait while only the partial live grid (not the provider) shows the dialog gone; sends when the reattached screen shows the composer. The 22 test files that import the changed modules pass.pnpm tc,pnpm lintand the changed-code quality gate pass.Risk
Level: Medium
Host-only; no wire change. The riskiest part is a pane wrongly held as "waiting for permission" after a restart: that can only happen inside the 30-minute window, for a restored permission row, while no readable current screen shows the dialog gone; the next hook from the agent replaces the row. Extra cost is one hook-row scan per status read/prompt write, plus a bounded screen read only while a restored wait stands. Back out with a plain revert.
Review
Independent Opus reviews: no P0-P2. Codex review: no findings (an earlier Codex P2, trusting a partial post-reattach grid, is fixed here).
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)