diff options
| author | opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> | 2026-02-24 11:15:39 +0000 |
|---|---|---|
| committer | opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> | 2026-02-24 11:15:39 +0000 |
| commit | ef7f222d80d1b5d2f3c18e86efba99a1f308c1f9 (patch) | |
| tree | edbc338ea7a1a5a04bdc8f5b6ec51fb2eb8f9fd1 | |
| parent | 888b123387718aa1fc802fbcae7341c7aeef6f73 (diff) | |
| download | opencode-ef7f222d80d1b5d2f3c18e86efba99a1f308c1f9.tar.gz opencode-ef7f222d80d1b5d2f3c18e86efba99a1f308c1f9.zip | |
chore: generate
| -rw-r--r-- | packages/opencode/test/acp/event-subscription.test.ts | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/packages/opencode/test/acp/event-subscription.test.ts b/packages/opencode/test/acp/event-subscription.test.ts index 7372c55ba..d61240d71 100644 --- a/packages/opencode/test/acp/event-subscription.test.ts +++ b/packages/opencode/test/acp/event-subscription.test.ts @@ -505,7 +505,13 @@ describe("acp.agent event subscription", () => { for (const output of ["a", "a", "ab"]) { controller.push( - toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output } }), + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output }, + }), ) } await new Promise((r) => setTimeout(r, 20)) @@ -558,7 +564,9 @@ describe("acp.agent event subscription", () => { const pendings = sessionUpdates.filter( (u) => u.sessionId === sessionId && u.update.sessionUpdate === "tool_call", ) - expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe(true) + expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe( + true, + ) stop() }, }) @@ -574,9 +582,33 @@ describe("acp.agent event subscription", () => { const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId) const input = { command: "echo hello", description: "run command" } - controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } })) - controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "pending", input, raw: '{"command":"echo hello"}' })) - controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } })) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output: "a" }, + }), + ) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "pending", + input, + raw: '{"command":"echo hello"}', + }), + ) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output: "a" }, + }), + ) await new Promise((r) => setTimeout(r, 20)) const snapshots = sessionUpdates |
