Skip to content

Commit a290020

Browse files
kulvirgitclaude
andcommitted
fix: add missing bashOutput method and bashSnapshots property to ACP Agent
Required by upstream v1.2.20 bash output streaming feature. Co-Authored-By: Kai (Claude Opus 4.6) <noreply@anthropic.com>
1 parent 3040417 commit a290020

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/opencode/src/acp/agent.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { Config } from "@/config/config"
4242
import { Todo } from "@/session/todo"
4343
import { z } from "zod"
4444
import { LoadAPIKeyError } from "ai"
45-
import type { AssistantMessage, Event, OpencodeClient, SessionMessageResponse } from "@opencode-ai/sdk/v2"
45+
import type { AssistantMessage, Event, OpencodeClient, SessionMessageResponse, ToolPart } from "@opencode-ai/sdk/v2"
4646
import { applyPatch } from "diff"
4747

4848
type ModeOption = { id: string; name: string; description?: string }
@@ -136,6 +136,7 @@ export namespace ACP {
136136
private sessionManager: ACPSessionManager
137137
private eventAbort = new AbortController()
138138
private eventStarted = false
139+
private bashSnapshots = new Map<string, string>()
139140
private permissionQueues = new Map<string, Promise<void>>()
140141
private permissionOptions: PermissionOption[] = [
141142
{ optionId: "once", kind: "allow_once", name: "Allow once" },
@@ -1467,6 +1468,14 @@ export namespace ACP {
14671468
{ throwOnError: true },
14681469
)
14691470
}
1471+
1472+
private bashOutput(part: ToolPart) {
1473+
if (part.tool !== "bash") return
1474+
if (!("metadata" in part.state) || !part.state.metadata || typeof part.state.metadata !== "object") return
1475+
const output = part.state.metadata["output"]
1476+
if (typeof output !== "string") return
1477+
return output
1478+
}
14701479
}
14711480

14721481
function toToolKind(toolName: string): ToolKind {

0 commit comments

Comments
 (0)