Repository navigation
SDK profile: first-class session/cancel and mid-turn steering #14336
QichangZheng
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Version:
@deepseek-ai/dsh@0.2.2-rc.5, Node 24.22.3, Linux x64.Use case. We drive DSH from a multi-agent orchestration platform through
dsh --profile sdk(stdio JSON-RPC, one long-lived process per agent). Operators need a "stop generating" button and the ability to inject a message into the running turn.What we found.
initialize,session/prompt,session/query,session/resume,session/wait,session/working-directory/get|set,shutdown(packages/sdk/server/src/server.ts). There is no cancel.session/promptduring a running turn callsagent.followup(), so the message is queued for the next turn rather than steering the current one.session/queryonly recognises the four built-in slash commands, so a plugin-registered command cannot be reached over the SDK channel.session/cancel, but it lacks other things we rely on in the SDK profile.Our workaround. A small Cordis plugin (loaded with
--patch) opens a unix socket next to the session and calls the agent service directly:This works well (the turn ends with
turn/end/aborted, queued input is kept), which suggests the capability is already there and only the protocol surface is missing.Request. Would you consider adding to the SDK protocol:
session/cancel— abort the current turn, with an option to keep the queued inbox;session/steer(or a flag onsession/prompt) — deliver a user message into the running turn instead of queueing it.Happy to share the plugin or test against a pre-release if that helps. Thanks for the project!
All reactions