diff --git a/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts index 55b313a9d3adc..f9ed5999c7ec2 100644 --- a/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts @@ -452,11 +452,14 @@ const claudeUnrelatedChildren = [ ]; describe("AcpRegistryAdapterV2", () => { + // Kimi Code answers `session/prompt` while a detached shell task runs, then starts a turn of + // its own when that task ends. it.effect.each([ - { commandPath: "/root/.local/bin/agy", offers: 1 }, - { commandPath: "C:\\tools\\agy.exe", offers: 1 }, - { commandPath: "/opt/bin/other-agent", offers: 0 }, - ])("continues late output only for agy ($commandPath)", ({ commandPath, offers }) => + { name: "agy", agent: { source: "local", commandPath: "/root/.local/bin/agy" }, offers: 1 }, + { name: "agy.exe", agent: { source: "local", commandPath: "C:\\tools\\agy.exe" }, offers: 1 }, + { name: "kimi-code", agent: "kimi-code", offers: 1 }, + { name: "other", agent: { source: "local", commandPath: "/opt/bin/other-agent" }, offers: 0 }, + ])("continues late output only for self-resuming agents ($name)", ({ agent, offers }) => Effect.gen(function* () { const gate = makeProviderReplayGate(["wake"]); const update = (sessionUpdate: Record) => @@ -504,13 +507,13 @@ describe("AcpRegistryAdapterV2", () => { ], gate, true, - { source: "local", commandPath, commandArgs: ["acp"] }, + agent, ); yield* session.runtime.startTurn(session.turnInput(1)); assert.equal((yield* session.terminal).status, "completed"); gate.release("wake"); yield* session.throughMarker("late output received"); - assert.lengthOf(session.offers, offers, "late output must only wake agy"); + assert.lengthOf(session.offers, offers, "late output must only wake self-resuming agents"); if (offers === 0) return; yield* session.offers[0]!.dispatchIfCurrent!(Effect.void); yield* session.runtime.startTurn(session.turnInput(2, { continuation: true })); diff --git a/packages/provider-acp-registry/src/server/adapter.ts b/packages/provider-acp-registry/src/server/adapter.ts index 8eb5dbb30b8cc..54316a17e1d9a 100644 --- a/packages/provider-acp-registry/src/server/adapter.ts +++ b/packages/provider-acp-registry/src/server/adapter.ts @@ -308,14 +308,14 @@ export const makeAcpRegistryAdapterV2 = Effect.fn("makeAcpRegistryAdapterV2")(fu extractSubagentSessionEvent: extractClaudeSubagentSessionEvent, } : {}), - // Hermes replies on the root session when a background process it started exits; no - // prompt response follows, so the continuation ends on the deferred-finalize debounce. + // Hermes, agy and Kimi Code reply on the root session when work they left running ends; + // no prompt response follows, so the continuation ends on the deferred-finalize debounce. // Hermes is not in the public registry and may run through a wrapper, so only its - // initialize reply identifies it. agy does the same and is known by its command. + // initialize reply identifies it. enablePostSettleContinuation: (initializeResult) => - isAntigravityCli || isHermes(initializeResult), + isAntigravityCli || isKimi || isHermes(initializeResult), deferFinalizeForBackgroundWork: (initializeResult) => - isAntigravityCli || isHermes(initializeResult), + isAntigravityCli || isKimi || isHermes(initializeResult), ...(isDevin ? { clientCapabilitiesMeta: {