feat(acp): support mid-turn steering / 支持 ACP 回合中引导 - #6715
Merged
Conversation
Expose the existing agent steer queue through a Reasonix ACP v1 session/steer extension. Accept guidance only while a prompt is active, preserve existing frontend fallback behavior, and replay delivered steers as the user's raw text. Refs esengine#3470
gcoder1991
marked this pull request as ready for review
July 20, 2026 06:02
Problem: The ACP v1 steer extension used the reserved core method name session/steer and was not discoverable through initialize capabilities. Root cause: The initial adapter registered the feature like a core ACP method instead of using ACP vendor extension naming and the capability _meta contract. Fix: Register _reasonix.io/session/steer, advertise it under agentCapabilities._meta["reasonix.io"], and lock the wire contract with tests. Verification: - go test ./internal/acp ./internal/control ./internal/agent - go test -race ./internal/acp ./internal/control ./internal/agent - go vet ./... - env -u DEEPSEEK_API_KEY go test ./... - git diff --check Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
Documentation: Consolidate ACP v1 startup, capabilities, session lifecycle, controls, MCP transport, permissions, and mid-turn steering into dedicated English and Chinese guides. Website: Surface ACP from both READMEs, the main guides, the bilingual docs page, and the homepage; keep deep links visible below the fixed header after language initialization. Verification: npm test; npm run build; go test ./internal/acp ./internal/cli ./internal/control ./internal/agent; env -u DEEPSEEK_API_KEY go test ./...; go vet ./...; git diff --check; desktop and 390px Chrome DevTools checks in English and Chinese.
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.
Summary
_reasonix.io/session/steer.agentCapabilities._meta["reasonix.io"].sessionSteer, so clients do not have to guess whether the method exists.{sessionId, prompt}content-block shape assession/prompt, but only while a prompt is active; idle sessions returnInvalidRequestinstead of silently starting a new turn.TrySteeracceptance from the existingSteerfallback.This is intentionally a Reasonix ACP v1 extension, not an implementation of the still-unreleased ACP v2
session/injectproposal.Refs #3470
ACP v2 context: agentclientprotocol/agent-client-protocol#1261
Documentation
docs/ACP.mdanddocs/ACP.zh-CN.mdconsolidate startup, capability negotiation, session lifecycle, independent controls, host-supplied MCP transports, permissions, steering errors, compatibility, cache behavior, and a client checklist./docs/#acp, links the complete source guides, and exposesreasonix acpfrom the homepage.Capability discovery
The initialize response includes:
{ "agentCapabilities": { "_meta": { "reasonix.io": { "sessionSteer": { "method": "_reasonix.io/session/steer" } } } } }Wire shape
{ "jsonrpc": "2.0", "id": 2, "method": "_reasonix.io/session/steer", "params": { "sessionId": "session-id", "prompt": [{"type": "text", "text": "use plan B"}] } }Successful acceptance returns
{}. Unknown sessions and empty prompts use the existing ACP validation errors; sessions without an active prompt return-32600 InvalidRequest. The unnamespacedsession/steermethod is intentionally not registered because ACP v1 reserves non-underscore method names for the core protocol.Backward compatibility
agentCapabilities._metaProvider-visible prompts, tool schemas, and cache-stable prefixes are unchanged apart from the user-requested steer message entering normal conversation history.
Verification
go test ./internal/acp -run 'TestServe(Lifecycle|SteerInjectsIntoActivePrompt)$' -count=20go test ./internal/acp ./internal/control ./internal/agentgo test -race ./internal/acp ./internal/control ./internal/agentgo test ./internal/acp ./internal/cli ./internal/control ./internal/agentgo vet ./...env -u DEEPSEEK_API_KEY go test ./...cd site && npm testcd site && npm run buildgit diff --checkorigin/main-v2, followed bygo test ./internal/acp ./internal/control ./internal/agentFocused coverage verifies capability discovery, rejection of the reserved unnamespaced route, active-turn injection, idle rejection, model visibility at the next safe loop boundary, and replay without the internal wrapper.
Cache impact
Cache-impact: none - ACP transport and documentation/site only; no provider-visible system prompt, tool schema, or cache-stable input changes.
Cache-guard:
go test ./...and focused ACP steer, capability, and replay regression tests cover the changed surface.System-prompt-review: N/A