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
fix(cli): /recap and /resume typed during a running turn are steered into the model as prompt text #3308
In the TUI, typing /recap or /resume while a turn is running does not execute the command. The literal text is injected into the running turn as a steering message (the transcript shows Steering: /resume), so the model sees /recap / /resume as ordinary user text and may react to it — derailing the current task, polluting context, and burning tokens. The recap is never generated and the safe-boundary resume never runs.
Root cause: in packages/cli/src/pi-tui-runner.ts, editor.onSubmit special-cases only exit forms, /swarm, /graph, and /goal while turnRunning; every other input — including known slash commands — goes to steerRunningTurn().
The behavior is also timing-dependent: if the turn ends between submit and enqueue, the runtime returns fallback and the CLI re-routes through submitPrompt(), where the command does run. Same command, two outcomes, depending on whether the turn was still alive.
Expected:
/recap answers locally mid-turn — it uses the independent session.recap.generate call with its own in-flight lock and never touches the running turn.
/resume and other session-mutating commands (/compact, /rewind, /model, /session, /new, /rename, /thinking, /permissions, /move, /skill, /setup, /context, /help) refuse with a clear message instead of steering — today they would silently no-op via the runControl busy gate even if they did reach the handler.
Unknown slash-prefixed text keeps steering unchanged (it may be intended prompt text).
How to reproduce
Run the TUI from source (npm run cli:dev), start a session, submit a prompt that keeps the agent working.
While the turn is running, type /recap and press Enter.
Observe: transcript shows Steering: /recap; no recap notice appears; the model responds to the literal text.
Repeat with /resume: no safe-boundary resume; the text is injected instead.
Activity
me2seeks commentedon Aug 20, 2026
I'm working on this — fix in progress.
fix(cli): stop steering known slash commands into a running turn (#3310)