mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:20:44 +00:00
chore: update dependencies
This commit is contained in:
@@ -8,6 +8,7 @@ import type { MessagingToolSend } from "./pi-embedded-messaging.types.js";
|
||||
import {
|
||||
handleToolExecutionEnd,
|
||||
handleToolExecutionStart,
|
||||
handleToolExecutionUpdate,
|
||||
} from "./pi-embedded-subscribe.handlers.tools.js";
|
||||
import type {
|
||||
ToolCallSummary,
|
||||
@@ -713,6 +714,47 @@ describe("handleToolExecutionEnd exec approval prompts", () => {
|
||||
});
|
||||
|
||||
describe("handleToolExecutionEnd derived tool events", () => {
|
||||
it("emits command output deltas for exec update results", async () => {
|
||||
const { ctx, onAgentEvent } = createTestContext();
|
||||
|
||||
await handleToolExecutionStart(
|
||||
ctx as never,
|
||||
{
|
||||
type: "tool_execution_start",
|
||||
toolName: "exec",
|
||||
toolCallId: "tool-exec-update-output",
|
||||
args: { command: "npm test" },
|
||||
} as never,
|
||||
);
|
||||
|
||||
handleToolExecutionUpdate(
|
||||
ctx as never,
|
||||
{
|
||||
type: "tool_execution_update",
|
||||
toolName: "exec",
|
||||
toolCallId: "tool-exec-update-output",
|
||||
partialResult: {
|
||||
details: {
|
||||
status: "running",
|
||||
aggregated: "RUN src/example.test.ts",
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
);
|
||||
|
||||
expect(onAgentEvent).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
stream: "command_output",
|
||||
data: expect.objectContaining({
|
||||
itemId: "command:tool-exec-update-output",
|
||||
phase: "delta",
|
||||
output: "RUN src/example.test.ts",
|
||||
status: "running",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("emits command output events for exec results", async () => {
|
||||
const { ctx, onAgentEvent } = createTestContext();
|
||||
|
||||
|
||||
@@ -772,7 +772,11 @@ export function handleToolExecutionUpdate(
|
||||
},
|
||||
});
|
||||
if (isExecToolName(toolName)) {
|
||||
const output = extractToolResultText(sanitized);
|
||||
const execDetails = readExecToolDetails(sanitized);
|
||||
const output =
|
||||
execDetails && "aggregated" in execDetails
|
||||
? execDetails.aggregated
|
||||
: extractToolResultText(sanitized);
|
||||
const commandData: AgentItemEventData = {
|
||||
itemId: buildCommandItemId(toolCallId),
|
||||
phase: "update",
|
||||
|
||||
Reference in New Issue
Block a user