You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal: no backend-neutral command-handoff signal; queued drains can consume feedback before an unsubmitted command reaches the shell #2278
The terminal backends have no backend-neutral "command handed to the shell" signal. ExecuteCommandTool's agent-timeout racer can return the still-running result ([false, "Command is still running...", true]) while Terminal.runCommand has only deferred the submission: Terminal.ts (L124-131) awaits shell integration and only then calls process.run(command). When the racer wins, the true flows into shouldDrainQueuedMessages, so queued user messages can be consumed toward the next model turn before the command text ever reached the shell.
Verified at 95a13d719 (PR #1711 head) during that PR's review (thread 4422477230; review reply 4422646288 promised this follow-up issue; CodeRabbit accepted the deferral in 4422650671).
Impact / non-impact
Exposure is submission latency and feedback ordering only: when agentTimeout < shell-integration activation time, a model turn can read queued feedback before seeing the command's output.
Not a loss or an approval bypass: the queued message is retained, the exclusion rules hold (a retained drain submission cannot approve a command ask), and the command still runs and reports in the following turn.
Why the existing signals can't be reused
commandSubmitted (ExecuteCommandTool.ts :684) is set by onShellExecutionStarted, which fires from BaseTerminal.setActiveStream (stream availability, not handoff). On the Execa backend the stream arrives only after first output, so using it would skip the drain for commands already handed off but not yet streaming.
process.ownExecution is VS Code-only (TerminalProcess.ts :177; absent from types.tsRooTerminalProcess); ExecaTerminalProcess never sets it.
A handoff-time emit does not exist in either backend's process class.
Activity