Skip to content

feat(kap-server): add steer flag to submit a prompt directly into the running turn - #3705

Merged
sailist merged 1 commit into
MoonshotAI:devfrom
sailist:feat-prompt-submit-steer-flag
Sep 10, 2026
Merged

feat(kap-server): add steer flag to submit a prompt directly into the running turn#3705
sailist merged 1 commit into
MoonshotAI:devfrom
sailist:feat-prompt-submit-steer-flag

Conversation

@sailist

@sailist sailist commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Internal feature request (no linked issue).

Problem

API clients that want to steer a fresh message into the active turn must use a two-step flow: submit a prompt (which lands in the queue on a busy session), then call POST /api/v1/sessions/{session_id}/prompts:steer with the returned prompt id. The engine (IAgentPromptService.submitSteer) and the internal node-sdk RPC lane (session.steer) already support one-shot steering, but the public REST surface does not.

What changed

  • POST /api/v1/sessions/{session_id}/prompts accepts a new optional steer boolean. With steer: true, a prompt submitted while the session is busy is steered directly into the running turn — the one-call form of submitting and then steering; on an idle session the prompt starts a new turn as usual. The submit response keeps its shape and reports the prompt's real state (running / queued).
  • A race where the active turn ends between submission and steering is tolerated the same way the engine's submitSteer handles it: the prompt simply stays queued instead of failing the request.
  • steer combined with skills is rejected with 40001, matching the existing prompt_id + skills rule.
  • The parameter is documented in docs/en/reference/server-api.md and docs/zh/reference/server-api.md.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e71090d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@e71090d
npx https://pkg.pr.new/@moonshot-ai/kimi-code@e71090d

commit: e71090d

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e71090de79

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

goal_control: z.enum(['pause', 'resume', 'cancel']).optional(),
disabled_tools: z.array(z.string()).optional(),
prompt_id: z.string().min(1).optional(),
steer: z.boolean().optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add a changeset for the new REST capability

This introduces and documents a user-visible REST API capability, but the commit contains no .changeset/ entry. Without one, the release changelog will omit the new steer option; add a user-facing changeset for the shipped CLI package as required by the repository workflow.

AGENTS.md reference: AGENTS.md:L86-L88

Useful? React with 👍 / 👎.

@sailist
sailist merged commit 1506063 into MoonshotAI:dev Sep 10, 2026
14 checks passed
@sailist

sailist commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

No changeset for this one: the steer flag is an additive, opt-in parameter on the server-side protocol surface — it changes no existing behavior and is not perceivable by CLI end users, consistent with previous server-protocol additions in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant