fix(acp): show shell command in ACP tool calls (#32304)

Co-authored-by: Mert Can Demir <validatedev@gmail.com>
This commit is contained in:
Shoubhit Dash 2026-06-14 14:46:27 +02:00 committed by GitHub
commit 51461429f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 93 additions and 29 deletions

View file

@ -517,7 +517,7 @@ describe("acp event routing", () => {
expect(harness.updates).toHaveLength(0)
})
it("emits synthetic pending before the first running tool update", async () => {
it("exposes the shell command on the synthetic pending tool call", async () => {
const harness = createHarness()
await Effect.runPromise(harness.session.create({ id: "ses_tool", cwd: "/workspace" }))
@ -527,7 +527,14 @@ describe("acp event routing", () => {
"tool_call",
"tool_call_update",
])
expect(harness.updates[0]?.update).toMatchObject({ status: "pending", toolCallId: "call_1" })
expect(harness.updates[0]?.update).toMatchObject({
status: "pending",
toolCallId: "call_1",
title: "printf hello",
kind: "execute",
locations: [{ path: "/workspace" }],
rawInput: { cmd: "printf hello", cwd: "/workspace" },
})
expect(harness.updates[1]?.update).toMatchObject({ status: "in_progress", toolCallId: "call_1" })
})

View file

@ -37,7 +37,12 @@ describe("acp tool conversion", () => {
expect(toLocations("external_directory", { directories: ["/tmp/outside"], patterns: ["/tmp/outside/*"] })).toEqual([
{ path: "/tmp/outside" },
])
expect(toLocations("bash", { filePath: "/tmp/nope.ts", path: "/tmp" })).toEqual([])
expect(toLocations("bash", { cmd: "pwd" }, "/workspace")).toEqual([{ path: "/workspace" }])
expect(toLocations("bash", { command: "pwd", workdir: "subdir" }, "/workspace")).toEqual([
{ path: "/workspace/subdir" },
])
expect(toLocations("bash", { command: "pwd", workdir: "/abs/dir" }, "/workspace")).toEqual([{ path: "/abs/dir" }])
expect(toLocations("bash", { command: "printf hello" })).toEqual([])
expect(toLocations("read", { path: "/tmp/missing-file-path.ts" })).toEqual([])
})