Skip to content

feat(kap-server): accept bundled skill activations on the prompt submission route - #2982

Merged
chengluyu merged 21 commits into
mainfrom
feat/kap-prompt-with-skills
Aug 18, 2026
Merged

feat(kap-server): accept bundled skill activations on the prompt submission route#2982
chengluyu merged 21 commits into
mainfrom
feat/kap-prompt-with-skills

Conversation

@chengluyu

Copy link
Copy Markdown
Collaborator

Related Issue

Follow-up to #1736 (multi-skill prompts, landed as #2934 + #2935). The bundled-submission engine capability was only reachable through the in-process klient transports (the TUI path); the Kimi Code App talks to kap-server over /api/v1, where no route exposed it.

Problem

IAgentSkillService.promptWithSkills (bundled multi-skill prompt submissions) is not exposed on kap-server's production surface: POST /api/v1/sessions/{id}/prompts accepts no skills field, and the skills route only activates one skill at a time. The App cannot submit a prompt with multiple skill activations.

What changed

kap-serverPOST /api/v1/sessions/{sid}/prompts now accepts an optional non-empty skills: [{ name, args? }] field:

  • When present, the route delegates to IAgentSkillService.promptWithSkills — the same engine path the TUI uses: every skill validated up front (unknown name rejects the whole submission with zero side effects), one skill.activated event per skill, and the prompt enqueues as a single bundled user message (rendered skill blocks first, then the caller's content; one turn, one undo unit).
  • The route skips its own prompt-metadata update for bundled submissions (the engine owns it there), and maps skill.not_found40415, skill.type_unsupported40912, request.invalid40001 alongside the existing codes.
  • The response keeps the PromptItem shape (prompt_id / user_message_id / status / content / created_at).

Contract chain — to return that queue identity, the engine's promptWithSkills now resolves with a PromptWithSkillsResult (prompt_id / user_message_id / created_at / state, plus turn_id once launched) instead of { turn_id } | undefined. klient mirrors it (promptWithSkillsResultSchema + facade type + parity assertion). The API is additive over the not-yet-published #2934 surface.

Verification

  • tsc --noEmit on agent-core-v2, klient, kap-server
  • kap-server route suite: 30 passed (2 new bundle cases, incl. zero-side-effect rejection)
  • agent-core-v2 / klient / node-sdk suites: all pass
  • pnpm run lint: 0 errors
  • No changeset (Core Rule 6: kap-server REST protocol change consumed by the bundled App surface)

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • 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.

…ission route

The bundled-submission capability was only reachable through the
in-process klient transports; the App talks to kap-server over /api/v1.
The submit-prompt route now accepts an optional non-empty skills field
and delegates to IAgentSkillService.promptWithSkills — same validation,
events, and single bundled user message as the TUI path — skipping its
own prompt-metadata update (the engine owns it there) and mapping
skill.not_found / skill.type_unsupported onto the skills route's codes.
To return the submission's queue identity, the engine's promptWithSkills
now resolves with prompt_id / user_message_id / created_at / state (plus
turn_id once launched), mirrored through the klient contract.
@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e4965f5

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

@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

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

commit: e4965f5

@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: f76fa4a25b

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
Comment thread packages/kap-server/src/routes/prompts.ts Outdated
Drop the user_message_id field (it is always the same identity as
prompt_id — the route duplicates it) and narrow state to the
running/queued/blocked vocabulary, mapped at the engine edge instead of
exposing the internal seven-state PromptState on the wire.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Follow-up slimming in 6bce8b3 (minimal-footprint pass): dropped the redundant user_message_id from the result contract (always the same identity as prompt_id; the route duplicates it) and narrowed state to running | queued | blocked, mapped at the engine edge instead of exposing the internal seven-state PromptState on the wire.

@codex review

@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: 6bce8b31f2

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/protocol/rest-prompt.ts
Comment thread packages/klient/src/contract/agent/services.ts Outdated
Comment thread packages/agent-core-v2/src/agent/skill/skillService.ts Outdated
…ings

- Validate bundled skill names and types before any media materialization
  or control override, so a rejected bundle leaves session state untouched
  (the engine still re-validates authoritatively).
- Declare the 40415/40912 outcomes on the submit route so the generated
  API documentation includes them.
- The klient output schema no longer tolerates a missing promptWithSkills
  result (a transport-level absence now raises instead of resolving
  undefined), and a failed launch surfaces as an error rather than a
  successful running result.
- Add the changeset for the new public API field.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

All five review threads addressed in 09deb90:

  • Validation ordering: bundled skill names/types are now pre-validated read-only before any media materialization or control override, so a 40415/40912 rejection leaves session state (including permission_mode) untouched — regression test asserts the mode stays manual after a rejected yolo bundle. The engine still re-validates authoritatively inside promptWithSkills.
  • Error declarations: SKILL_NOT_FOUND and SKILL_NOT_ACTIVATABLE are declared on the route, so the generated API docs include both outcomes.
  • Missing results: the klient output schema no longer wraps maybe() — a transport-level missing result now raises instead of resolving undefined against the non-optional facade type.
  • Failed launches: a launch failure now throws instead of returning a successful running result without a turn_id (blocked still reports truthfully).
  • Changeset: added (@moonshot-ai/kimi-code patch) — agreed the App is a shipped consumer of this surface, so the Core Rule 6 exemption for dev tooling was the wrong call here.

@codex review

@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: 09deb908b9

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
Comment thread packages/kap-server/src/routes/prompts.ts Outdated
…n and stabilize listed content

- Skill preflight now runs on the session's catalog before the main agent
  is resolved, so a rejected bundle cannot mutate session metadata by
  registering main (regression test on a cold session without an agent).
- The prompts list projection strips the stored skill blocks from a
  bundled prompt, so GET /prompts returns the same caller-only content as
  the submit response.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Both fixed in 90907f2:

  • Preflight before agent materialization: skill validation now runs on the session's catalog (a cold resume does not create the agent) before resolvePrompt, so a rejected bundle cannot mutate session metadata by registering main. New regression test covers a cold session with no pre-created agent and asserts main stays unmaterialized after the 40415.
  • Stable content across submit and list: GET /prompts now strips the stored skill blocks from a bundled prompt (same caller-parts rule as turn.started.prompt and the title source), so the listed content matches the submit response exactly. Covered by deterministic projection tests (the HTTP queue drains too fast with the stub provider to assert it end-to-end).

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 90907f277e

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Coexist with the client-chosen prompt_id reservation and the session-media
staging lifecycle: bundled submissions reject an explicit prompt_id (the
engine assigns it), release staging once intake is known-complete
(launched or blocked), and keep the shared session-media projection for
listed content. Queued bundles release staging when their turn pops,
which the result shape cannot observe — noted as a known limitation.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Merged current main (the merge commit documents the conflict decisions). Headline choices:

  • prompt_id (client-chosen id from main) and skills coexist on the submission schema; a bundled submission rejects an explicit prompt_id (40001) rather than silently ignoring it, since the engine's bundle path assigns ids.
  • The bundle branch joins main's session-media staging lifecycle: failed submissions roll back staging; launched/blocked bundles release it after known-complete intake. Known limitation: a queued bundle's staging releases only when its turn pops, which the promptWithSkills result shape can't observe — staging persists until then (same as pre-rework behavior for everything).
  • Listed content combines both projections: strip bundled skill blocks, then the shared projectPromptContentParts media mapping.

Verification: kap-server route suite 38 passed (both suites' tests kept), v2/klient/sdk suites pass, lint 0 errors.

@codex review

@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: f3ef045275

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
Comment thread packages/kap-server/src/routes/prompts.ts Outdated
…an queued staging

- The skills + prompt_id incompatibility rejection now runs at the initial
  bundled preflight, before the main agent is materialized or any
  override binds (previously a yolo override could bind before the 40001).
- Queued bundles no longer skip staging cleanup forever: the discard is
  deferred to the bundle's prompt.completed / prompt.aborted lifecycle
  event, mirroring the plain path's launch-raced cleanup.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Both fixed in 4825665:

  • prompt_id rejection moved to preflight: the skills + prompt_id incompatibility now rejects at the initial bundled preflight — before the main agent is materialized or any override binds (regression test: permission_mode: 'yolo' + prompt_id + skills on a cold session → 40001, main never materialized).
  • Queued bundle staging is now cleaned up: the discard is deferred to the bundle's own prompt.completed / prompt.aborted lifecycle event (matched by promptId), which is exactly when intake completes — same semantics as the plain path's launch-raced cleanup, expressed through events since the result shape carries no handle. Unit tests cover matching, non-matching, and aborted paths.

@codex review

@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: 482566517a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
A queued bundle steered into the active turn is consumed at steer time,
but the engine publishes prompt.completed/aborted only for the parent —
the deferred cleanup never fired and its subscription leaked. The
prompt.steered event (matching promptIds) now counts as the child's
intake-completion signal.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Fixed in eb4e6db: the steer path now counts as an intake-completion signal — a queued bundle steered into the active turn is consumed at steer time, and since settle() publishes prompt.completed/prompt.aborted only for the parent, the cleanup also listens for prompt.steered (matching promptIds). Subscription and staging are both released on all three settle paths now (completed / aborted / steered), with unit tests for the matching and non-matching steer cases.

@codex review

@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: eb4e6dbd14

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
…ect paths

startNext materializes daemon file references into the session media
store before a prompt's turn, but steer() and inject() enqueued the same
references without that intake, leaving the staging upload as the only
copy — any staging cleanup at steer time would delete the media the
turn is about to consume. Both paths now run the same intake before the
SteerStepRequest is created, so prompt.steered is a truthful
intake-complete signal.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Addressed the root cause in e03a946 rather than delaying the cleanup: steer() and inject() now run the same materializePromptDaemonRefs intake as startNext before the SteerStepRequest is created — exactly what promptMediaIntake.ts documents (whichever edge (REST prompt route, SDK prompt, steer, …)); the steer edge was the gap. With intake completing before prompt.steered is published, discarding staging on that event is now correct in all cases (launch, abort, steer), and the deferred-cleanup signal is truthful end to end. Engine test added: steer with a kimi-file:// image part asserts the intake copy is materialized; full v2 suite 5243 passed.

@codex review

@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

message: {
role: 'user',
content: [...prepared.map((activation) => activation.part), ...input.input],
toolCalls: [],
origin: {
kind: 'user',
skillActivations: prepared.map((activation) => activation.entry),

P2 Badge Strip rendered skill blocks from queued events

When a bundled request queues behind an active turn, this message content includes the rendered skill blocks, and AgentPromptService.publishQueued forwards that content unchanged; the kap-server broadcaster only applies media projection before sending prompt.queued. Consequently WebSocket clients still receive internal skill markdown while the submit response and GET /prompts expose only the caller's parts. Fresh evidence after the list-projection fix is this unchanged queued-event path; project the bundled prefix out of the event as well.


origin: {
kind: 'user',
skillActivations: prepared.map((activation) => activation.entry),

P2 Badge Preserve bundled skill metadata through steer

When a queued bundled prompt is steered, AgentPromptService.steer flattens its content into a new message with plain USER_PROMPT_ORIGIN, discarding the skillActivations metadata stored here. The durable turn.steer context therefore cannot be recognized by bundledSkillsFromOrigin or stripBundledSkillParts during replay, so the skill cards disappear and the rendered skill instructions are presented as user-authored text. Preserve or reconstruct the activation metadata when steering, including the multi-prompt case.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
…teer time

Prompt-intake materialization is best-effort: when it degrades, the
daemon upload is the request-time resolver's fallback source. Discarding
staging at prompt.steered could therefore delete the only readable copy
before the parent's request ran. Cleanup is now uniformly event-driven —
the bundle's own prompt.completed/aborted, or the steer parent's — so
the upload always outlives the request it feeds.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Fixed in 0124751 by making cleanup uniformly settlement-driven: prompt intake is best-effort, and when it degrades the daemon upload is the resolver's fallback — so staging is now discarded only when the bundle's turn settles (prompt.completed / prompt.aborted), and a steered bundle re-targets cleanup to its parent (activePromptId) rather than discarding at steer time. The upload now provably outlives the request it feeds on every path (launch, abort, steer, degraded intake). Tests cover own-settle, parent-settle after steer, and unrelated-steer cases.

@codex review

@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

content: [...prepared.map((activation) => activation.part), ...input.input],

P2 Badge Hide rendered skill blocks from prompt lifecycle events

When a bundled prompt queues behind an active turn, storing the rendered blocks in its public prompt content makes publishQueued emit those internal instructions verbatim, while sessionEventBroadcaster.ts only converts their wire shape. If the bundle is steered, PromptSteered similarly carries the full content and coreEventMap.ts replaces the active transcript prompt with it. Fresh evidence after the caller-only list projection fix is these queued/steered event paths, which still expose content that the REST submit and list responses intentionally hide; preserve the caller-only boundary in lifecycle events as well.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts Outdated
A hook-blocked bundle completes synchronously inside the submission
call, and an exceptionally fast launch can settle just as early — a
post-call subscription misses the only settlement event and leaks both
the staging blob and the listener. The tracker now subscribes before
enqueueing, buffers lifecycle events, and settles against the returned
prompt id (or its steer parent's).
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Fixed in bbbaa60: steer records are now spliced out of the queue only AFTER the daemon-ref media intake completes (the file copy is where the active turn can finish), and if the turn is gone by enqueue time the records are restored to pending so startNext launches them as fresh prompts — handles always launch or settle, and the bundled-media cleanup always sees a lifecycle event.

On the other thread (validation atomicity with overrides): the route's preflight and the engine's authoritative validation both read the live catalog, so a mid-request catalog refresh can in theory reopen the side-effect window. Rolling back is only partially possible at the edge (permissionMode.mode, profile.getModel/thinking are readable; the session tool denylist has no getter and the profile bind is irreversible by design). See follow-up comment for the options — input welcome before I pick one.

@codex review

@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: bbbaa60faf

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
…media intake

The daemon-ref copy yields, so settle/abort can consume selected records
and the active turn can rotate meanwhile. Only records still pending are
steered, and only into the turn that was active at entry; records that
vanish from the queue are left to their own launch path, and a missing
turn restores them to pending instead of splicing an unrelated tail
prompt. The intake/queue-preservation contract is documented in the
module header.
Re-applies the bundled-submission work onto the post-#3010 comment-free
convention (headers stripped): contract result type, route preflight,
settlement tracker, list projection, and the steer queue-revalidation,
all without doc comments.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

Threads addressed:

  • Steer queue revalidation (98309f4): after the daemon-ref copy yields, only records still pending are steered, and only into the turn that was active at entry — indexOf-of-missing-record can no longer splice an unrelated tail prompt, a consumed record is never both launched and steered, and a vanished turn restores the rest to pending.
  • Comment convention (246a6f2): merged current main including refactor(agent-core-v2): strip comments from agent-core-v2, kap-server, and transcript #3010 (comment strip) — all the new work is re-applied comment-free, and the steer intake/queue-preservation contract is expressed through the code itself.

The validation-atomicity thread stays open pending a design decision (partial rollback vs moving overrides into the engine's atomic zone vs documenting best-effort); input welcome.

@codex review

@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: 246a6f21eb

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
…edia truthful

- The steered content is rebuilt from the records that are still pending
  after the media intake, so an aborted or concurrently consumed record's
  text is never injected (or injected twice) alongside the surviving
  handles.
- The enqueue is wrapped so an activeTurnOnly rejection restores the
  records to pending (the loop throws instead of resolving a missing
  turn, which made the previous rollback unreachable).
- The merged origin now carries the union of every record's bundled
  skillActivations, and prompt.steered publishes the caller-only content,
  so the skill instructions reach the model with their metadata intact
  while the event projection stops leaking internal skill markdown.
@chengluyu

Copy link
Copy Markdown
Collaborator Author

All three addressed in c5164a6:

  • Surviving-record content: the steered content is rebuilt from the records still pending after the media intake — an aborted or concurrently consumed record's text is no longer injected (or double-injected) while only the surviving handles settle.
  • Unreachable rollback: the enqueue is now wrapped — the loop throws on activeTurnOnly with no active job instead of resolving a missing turn, so records are restored to pending on that path instead of leaking unsettled.
  • Event markdown leak: the merged origin carries the union of each record's bundled skillActivations (metadata preserved through steer), and prompt.steered publishes the caller-only content — skill instructions still reach the model, but the WS/transcript projections no longer expose internal skill markdown (consistent with submit/list/turn.started).

@codex review

@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: c5164a66c6

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
Comment thread packages/agent-core-v2/src/agent/skill/skillService.ts Outdated
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: a27a8575b7

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 95d3679997

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/kap-server/src/routes/prompts.ts
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: ece08d44e0

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts
Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts Outdated
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: a0e27922fd

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-core-v2/src/agent/prompt/promptService.ts
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 7d7c911067

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .changeset/kap-prompt-skills.md Outdated
@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: e4965f55e0

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chengluyu
chengluyu merged commit d6021fa into main Aug 18, 2026
15 checks passed
@chengluyu
chengluyu deleted the feat/kap-prompt-with-skills branch August 18, 2026 06:57
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