diff --git a/.changeset/transcript-activity-state.md b/.changeset/transcript-activity-state.md new file mode 100644 index 0000000000..3a7aa1d964 --- /dev/null +++ b/.changeset/transcript-activity-state.md @@ -0,0 +1,6 @@ +--- +"@moonshot-ai/kap-server": patch +"@moonshot-ai/transcript": patch +--- + +Publish per-agent transcript activity state (idle / turn) on transcript snapshots, derived from live loop status and preserved across cold rebuilds and live backfills. diff --git a/.changeset/transcript-notification-fold.md b/.changeset/transcript-notification-fold.md new file mode 100644 index 0000000000..22b28162c2 --- /dev/null +++ b/.changeset/transcript-notification-fold.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Fix the cold transcript rebuild splitting a turn at background-task completion notices; they now fold into the current turn like the live stream does. diff --git a/.changeset/transcript-prompt-entities.md b/.changeset/transcript-prompt-entities.md new file mode 100644 index 0000000000..8a09448e09 --- /dev/null +++ b/.changeset/transcript-prompt-entities.md @@ -0,0 +1,7 @@ +--- +"@moonshot-ai/agent-core-v2": patch +"@moonshot-ai/kap-server": patch +"@moonshot-ai/node-sdk": patch +--- + +Expose prompt queue entities through the transcript surface: accepted and queued prompts carry their content, queued prompts keep it after dequeueing, and the schema-less prompt.accepted event no longer leaks into the v1 event stream. diff --git a/.changeset/transcript-subagent-model-meta.md b/.changeset/transcript-subagent-model-meta.md new file mode 100644 index 0000000000..b57e4e91f6 --- /dev/null +++ b/.changeset/transcript-subagent-model-meta.md @@ -0,0 +1,6 @@ +--- +"@moonshot-ai/kap-server": patch +"@moonshot-ai/transcript": patch +--- + +Keep subagent task model and thinking-effort metadata on transcript tasks, including after the task terminates. diff --git a/packages/agent-core-v2/docs/wire-manifest.d.ts b/packages/agent-core-v2/docs/wire-manifest.d.ts index 690fcb13b7..0ef3e5124d 100644 --- a/packages/agent-core-v2/docs/wire-manifest.d.ts +++ b/packages/agent-core-v2/docs/wire-manifest.d.ts @@ -512,6 +512,7 @@ interface PromptAcceptedPayload { _name: 'prompt.accepted'; agentId: string; promptId: string; + content?: any; } /** diff --git a/packages/agent-core-v2/src/agent/prompt/promptOps.ts b/packages/agent-core-v2/src/agent/prompt/promptOps.ts index 60342fcecb..fcae4febff 100644 --- a/packages/agent-core-v2/src/agent/prompt/promptOps.ts +++ b/packages/agent-core-v2/src/agent/prompt/promptOps.ts @@ -7,16 +7,19 @@ import { defineState } from '#/state/state'; const promptAcceptedSchema = z.object({ agentId: z.string(), promptId: z.string().min(1), + content: z.unknown().optional(), }); export class PromptAccepted extends AgentEvent2> { static override readonly type = 'prompt.accepted'; static override readonly durable = true; + static override readonly observable = true; static override readonly schema = promptAcceptedSchema; } export interface PromptAccepted { readonly agentId: string; readonly promptId: string; + readonly content?: unknown; } export const promptAdmissionKey = defineState('promptAdmission', (): Map => new Map()) diff --git a/packages/agent-core-v2/src/agent/prompt/promptService.ts b/packages/agent-core-v2/src/agent/prompt/promptService.ts index e4c66d78da..b375a1b513 100644 --- a/packages/agent-core-v2/src/agent/prompt/promptService.ts +++ b/packages/agent-core-v2/src/agent/prompt/promptService.ts @@ -200,7 +200,11 @@ export class AgentPromptService implements IAgentPromptService { submitted = true; this.reservedPromptIds.delete(id); await this.dispatcher.dispatch( - new PromptAccepted({ agentId: this.scopeContext.agentId, promptId: id }), + new PromptAccepted({ + agentId: this.scopeContext.agentId, + promptId: id, + content: stripBundledSkillBlocks(message), + }), ); return this.enqueue({ id, message }); }, diff --git a/packages/agent-core-v2/test/agent/loop/loop.test.ts b/packages/agent-core-v2/test/agent/loop/loop.test.ts index d55b0b2800..5fd1356b53 100644 --- a/packages/agent-core-v2/test/agent/loop/loop.test.ts +++ b/packages/agent-core-v2/test/agent/loop/loop.test.ts @@ -67,7 +67,8 @@ describe('Agent loop', () => { expect(await ctx.untilTurnEnd()).toMatchInlineSnapshot(` [wire] tools.set_active_tools { "agentId": "main", "names": [], "time": "