mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
fix(ui): prefer failed grouped tool status
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -162,18 +162,18 @@ function getToolGroupTitle(toolItems: ToolChainItem[]): string {
|
||||
}
|
||||
|
||||
function getToolGroupStatus(toolItems: ToolChainItem[]): ToolCallStatus {
|
||||
if (toolItems.some((item) => getToolItemStatus(item) === "executing")) {
|
||||
return "executing";
|
||||
}
|
||||
if (toolItems.some((item) => getToolItemStatus(item) === "pending")) {
|
||||
return "pending";
|
||||
}
|
||||
if (toolItems.some((item) => getToolItemStatus(item) === "error")) {
|
||||
return "error";
|
||||
}
|
||||
if (toolItems.some((item) => getToolItemStatus(item) === "stopped")) {
|
||||
return "stopped";
|
||||
}
|
||||
if (toolItems.some((item) => getToolItemStatus(item) === "executing")) {
|
||||
return "executing";
|
||||
}
|
||||
if (toolItems.some((item) => getToolItemStatus(item) === "pending")) {
|
||||
return "pending";
|
||||
}
|
||||
return "completed";
|
||||
}
|
||||
|
||||
|
||||
@@ -168,4 +168,41 @@ describe("MessageBubble tool chains", () => {
|
||||
|
||||
expect(screen.getByText("Read main.js")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows a failed grouped chain even when another step is still pending", () => {
|
||||
const msg = assistantMessage([
|
||||
{
|
||||
type: "toolRequest",
|
||||
id: "tool-1",
|
||||
chainId: "chain-1",
|
||||
chainSummary: "working",
|
||||
name: "Edit main.swift",
|
||||
arguments: {},
|
||||
status: "completed",
|
||||
},
|
||||
{
|
||||
type: "toolResponse",
|
||||
id: "tool-1",
|
||||
chainId: "chain-1",
|
||||
chainSummary: "working",
|
||||
name: "Edit main.swift",
|
||||
result: "permission denied",
|
||||
isError: true,
|
||||
},
|
||||
{
|
||||
type: "toolRequest",
|
||||
id: "tool-2",
|
||||
chainId: "chain-1",
|
||||
chainSummary: "working",
|
||||
name: "Edit README.md",
|
||||
arguments: {},
|
||||
status: "pending",
|
||||
},
|
||||
]);
|
||||
|
||||
render(<MessageBubble message={msg} />);
|
||||
|
||||
expect(screen.getByText("working through 2 steps")).toBeInTheDocument();
|
||||
expect(screen.getByText("Error")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user