fix(acp): skip resume transcript replay (#34070)
This commit is contained in:
@@ -314,7 +314,6 @@ export function make(input: {
|
|||||||
|
|
||||||
yield* registerMcpServers(input.sdk, registeredMcp, params.cwd, state.id, params.mcpServers ?? [])
|
yield* registerMcpServers(input.sdk, registeredMcp, params.cwd, state.id, params.mcpServers ?? [])
|
||||||
yield* sendAvailableCommands(input.connection, state.id, snapshot)
|
yield* sendAvailableCommands(input.connection, state.id, snapshot)
|
||||||
yield* replayMessages(events, messages)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
configOptions: configOptions(snapshot, {
|
configOptions: configOptions(snapshot, {
|
||||||
|
|||||||
@@ -394,15 +394,29 @@ describe("ACP service sessions", () => {
|
|||||||
expect(second.sessions.map((session) => session.sessionId)).toEqual(["ses_2", "ses_1"])
|
expect(second.sessions.map((session) => session.sessionId)).toEqual(["ses_2", "ses_1"])
|
||||||
})
|
})
|
||||||
|
|
||||||
it("resumes a session and stores restored state", async () => {
|
it("resumes a session and stores restored state without replaying transcript chunks", async () => {
|
||||||
const { service } = makeService([
|
const { service, updates } = makeService([
|
||||||
{
|
{
|
||||||
info: {
|
info: {
|
||||||
|
id: "msg_user",
|
||||||
|
sessionID: "ses_resume",
|
||||||
role: "user",
|
role: "user",
|
||||||
model: { providerID: "test", modelID: "test-model", variant: "high" },
|
model: { providerID: "test", modelID: "test-model", variant: "high" },
|
||||||
agent: "plan",
|
agent: "plan",
|
||||||
},
|
},
|
||||||
parts: [],
|
parts: [{ id: "part_user", sessionID: "ses_resume", messageID: "msg_user", type: "text", text: "hello" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
info: { id: "msg_assistant", sessionID: "ses_resume", role: "assistant" },
|
||||||
|
parts: [
|
||||||
|
{
|
||||||
|
id: "part_assistant",
|
||||||
|
sessionID: "ses_resume",
|
||||||
|
messageID: "msg_assistant",
|
||||||
|
type: "text",
|
||||||
|
text: "hi there",
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
const resumed = await Effect.runPromise(
|
const resumed = await Effect.runPromise(
|
||||||
@@ -414,6 +428,11 @@ describe("ACP service sessions", () => {
|
|||||||
|
|
||||||
expect(select(resumed, "effort")?.currentValue).toBe("high")
|
expect(select(resumed, "effort")?.currentValue).toBe("high")
|
||||||
expect(select(updated, "effort")?.currentValue).toBe("default")
|
expect(select(updated, "effort")?.currentValue).toBe("default")
|
||||||
|
expect(
|
||||||
|
updates
|
||||||
|
.map((item) => item.update)
|
||||||
|
.filter((item) => item.sessionUpdate === "user_message_chunk" || item.sessionUpdate === "agent_message_chunk"),
|
||||||
|
).toEqual([])
|
||||||
})
|
})
|
||||||
|
|
||||||
it("closes local ACP state and aborts the backing session best-effort", async () => {
|
it("closes local ACP state and aborts the backing session best-effort", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user