Skip to content

Commit ef7f222

Browse files
chore: generate
1 parent 888b123 commit ef7f222

1 file changed

Lines changed: 37 additions & 5 deletions

File tree

packages/opencode/test/acp/event-subscription.test.ts

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,13 @@ describe("acp.agent event subscription", () => {
505505

506506
for (const output of ["a", "a", "ab"]) {
507507
controller.push(
508-
toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output } }),
508+
toolEvent(sessionId, cwd, {
509+
callID: "call_1",
510+
tool: "bash",
511+
status: "running",
512+
input,
513+
metadata: { output },
514+
}),
509515
)
510516
}
511517
await new Promise((r) => setTimeout(r, 20))
@@ -558,7 +564,9 @@ describe("acp.agent event subscription", () => {
558564
const pendings = sessionUpdates.filter(
559565
(u) => u.sessionId === sessionId && u.update.sessionUpdate === "tool_call",
560566
)
561-
expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe(true)
567+
expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe(
568+
true,
569+
)
562570
stop()
563571
},
564572
})
@@ -574,9 +582,33 @@ describe("acp.agent event subscription", () => {
574582
const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId)
575583
const input = { command: "echo hello", description: "run command" }
576584

577-
controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } }))
578-
controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "pending", input, raw: '{"command":"echo hello"}' }))
579-
controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } }))
585+
controller.push(
586+
toolEvent(sessionId, cwd, {
587+
callID: "call_1",
588+
tool: "bash",
589+
status: "running",
590+
input,
591+
metadata: { output: "a" },
592+
}),
593+
)
594+
controller.push(
595+
toolEvent(sessionId, cwd, {
596+
callID: "call_1",
597+
tool: "bash",
598+
status: "pending",
599+
input,
600+
raw: '{"command":"echo hello"}',
601+
}),
602+
)
603+
controller.push(
604+
toolEvent(sessionId, cwd, {
605+
callID: "call_1",
606+
tool: "bash",
607+
status: "running",
608+
input,
609+
metadata: { output: "a" },
610+
}),
611+
)
580612
await new Promise((r) => setTimeout(r, 20))
581613

582614
const snapshots = sessionUpdates

0 commit comments

Comments
 (0)