Skip to content

Commit fe8cd65

Browse files
authored
fix(core): keep inner tool progress from replacing execute's call rows (anomalyco#60480)
1 parent dbd7202 commit fe8cd65

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎packages/core/src/codemode/tool.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ export const create = (
123123
Effect.gen(function* () {
124124
const index = yield* Ref.getAndUpdate(callIndex, (index) => index + 1)
125125
// The program sees the same failure text the model gets for a direct call.
126-
const executed = yield* executeTool(name, tool, input, context).pipe(
126+
const executed = yield* executeTool(name, tool, input, {
127+
...context,
128+
// Progress replaces the execute call's own, so an inner tool's updates would hide the call rows.
129+
progress: () => Effect.void,
130+
}).pipe(
127131
Effect.mapError((error) => new ToolFailure({ message: toSessionError(error).message, error })),
128132
)
129133
const content = resultContent(executed)

‎packages/core/test/tool-registry.test.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,10 +1227,8 @@ describe("Tool", () => {
12271227
expect(execution).toMatchObject({ content: [{ type: "text" }] })
12281228
expect(execution.metadata?.toolCalls).toEqual([{ tool: "echo", status: "completed", input: { text: "request" } }])
12291229
expect(executed).toEqual(["old:request"])
1230-
expect(progress).toEqual([
1231-
{ toolCalls: [{ tool: "echo", status: "running", input: { text: "request" } }] },
1232-
{ stage: "old" },
1233-
])
1230+
// The inner tool's own progress would replace the call rows, so it is not published.
1231+
expect(progress).toEqual([{ toolCalls: [{ tool: "echo", status: "running", input: { text: "request" } }] }])
12341232
}),
12351233
)
12361234
})

0 commit comments

Comments
 (0)