Skip to content

Commit c0763a4

Browse files
committed
fix: update tool title handling in ACP agent to improve command display
1 parent 75166a1 commit c0763a4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/opencode/src/acp/agent.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ type ModelOption = { modelId: string; name: string }
4646

4747
const DEFAULT_VARIANT_VALUE = "default"
4848

49+
function toolTitle(part: MessageV2.ToolPart): string {
50+
const state = part.state as MessageV2.ToolStateCompleted
51+
if (part.tool !== "bash") return state.title
52+
const cmd = state.input["command"]
53+
return typeof cmd === "string" ? cmd : state.title
54+
}
55+
4956
export namespace ACP {
5057
const log = Log.create({ service: "acp-agent" })
5158

@@ -321,7 +328,7 @@ export namespace ACP {
321328
status: "completed",
322329
kind,
323330
content,
324-
title: part.state.title,
331+
title: toolTitle(part),
325332
rawInput: part.state.input,
326333
rawOutput: {
327334
output: part.state.output,
@@ -803,7 +810,7 @@ export namespace ACP {
803810
status: "completed",
804811
kind,
805812
content,
806-
title: part.state.title,
813+
title: toolTitle(part),
807814
rawInput: part.state.input,
808815
rawOutput: {
809816
output: part.state.output,

0 commit comments

Comments
 (0)