Support steering a running turn over ACP (_session/steering)
What would you like to be added?
Let ACP clients steer a running turn in gemini --acp: send a message the agent picks up at its next tool-call boundary, without cancelling the turn.
Today a second session/prompt aborts the pending one (Session.prompt() calls this.pendingPrompt?.abort()), so the only way for an ACP client to add guidance mid-turn is to cancel and start over. The interactive UI already supports this through model steering (buildUserSteeringHintPrompt in front of the next batch of tool responses); ACP clients have no equivalent.
Proposal: implement the ACP steering extension that other ACP agents already ship, proposed upstream in agentclientprotocol/agent-client-protocol#1261:
initializeresponse advertises it with a top-level_meta: { steering: { supported: true } }.- New extension request
_session/steeringwith{ sessionId, prompt: ContentBlock[], _meta?: { steering?: { idleBehavior?: "promptRequired" } } }, answering{ outcome: "injected" | "promptRequired" | "startedNewTurn" | "failed" }.- Turn running: queue the message, send it to the model with the next tool responses (or as a continuation if the model finishes without tool calls), answer
injected. The runningsession/promptkeeps going. - No turn running:
promptRequiredif the client opted in, otherwise start a turn with the message (startedNewTurn).
- Turn running: queue the message, send it to the model with the next tool responses (or as a continuation if the model finishes without tool calls), answer
The change would live entirely in packages/cli/src/acp/.
Why is this needed?
ACP clients (editors, agent hosts) want the same "nudge the agent while it works" behaviour the TUI has. Without it, clients either have to cancel the turn, losing in-flight work, or wait until it ends. Claude Code's ACP adapter (@agentclientprotocol/claude-agent-acp 0.84.0+), codex-acp (2.1.1+) and Oh My Pi already implement this same contract, so clients can use one code path for all of them.
Additional context
I have an implementation with unit tests and a stdio end-to-end check ready and will link the PR here.
Effort Analysis:
The feature requires implementing the _session/steering ACP extension. In packages/cli/src/acp/acpRpcDispatcher.ts, a new JSON-RPC dispatch method must be added for the steering request. In packages/cli/src/acp/acpSession.ts, the Session.prompt method currently aborts any pendingPrompt (an AbortController) upon receiving a new prompt. To support steering, the Session class must maintain an asynchronous queue of steering hints. The loop inside prompt, which relies on this.context.geminiClient.sendMessageStream, must be modified to check this queue at tool-call boundaries and inject the steering ContentBlock[] into currentParts alongside tool responses. This modification falls under the effort/medium category for 'Asynchronous Flow & Integration' because it involves complex asynchronous state management (message queuing and stream injection) and IPC integration between the CLI and external plugins over the ACP protocol, while remaining localized to the packages/cli/src/acp/ package without requiring cross-component refactoring.
Hi, can you please assign me this i want to fix this
Hi, I'd like to contribute to this issue. I noticed PR #29901 already implements a similar steering feature. Would you prefer aligning that implementation with the ACP standard, or is there another part that needs help? I'm happy to assist with testing or implementation.
Hi @hipstersmoothie @DavidAPierce, this overlaps with #29900, which already has an implementation in #29901. I've now updated #29901 to this exact contract: _session/steering, top-level _meta.steering.supported, and the injected / startedNewTurn / promptRequired outcomes, with the same delivery points as the TUI's model steering (next tool responses, or one more request if the model is finishing). Gemini-specific extras (per-message delivery confirmations and undelivered messages on cancel) live under _meta["geminicli.com"], so they don't affect the shared contract. It's validated end to end over stdio against a real model, and #29901 now closes both issues.
@DavidAPierce, could one of these issues get help wanted so the PR isn't auto-closed on Nov 7? I'm happy to close #29900 as a duplicate of this one if that's simpler.
Hi maintainers 👋 could someone triage this and, if you're open to it, add the help wanted label?
I had an implementation in #29901. The bot closed it after 14 days because this issue doesn't have the label; nobody reviewed it. I'd like to reopen it (or open a fresh PR) once it's eligible.
What it does
- Implements the
_session/steeringACP extension that claude-agent-acp, codex-acp and Oh My Pi already support, so ACP clients can steer Gemini CLI with the same code they use for those agents. initializeadvertises_meta.steering.supported. Clients that don't use steering need no changes, and users don't have to turn on any setting.- Messages are delivered through the same path as terminal model steering. Messages that never reach the model are sent back to the client as
undelivered, so they aren't lost.
Status
- Rebased on current
main(including the newsession/closesupport), as a single commit. - Unit tests cover the dispatcher and session changes (all ACP tests pass), and docs are updated (
acp-mode.md,model-steering.md). - An earlier build was tested end to end against a real model: all 15 scenarios passed.
This also covers #29900. Happy to change the design if you'd prefer a different approach.