Skip to content

Commit cf37765

Browse files
committed
fix: runProgrammaticStep should emit tool call text via onReponseChunk
1 parent de3ea46 commit cf37765

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

backend/src/run-programmatic-step.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,18 @@ export async function runProgrammaticStep(
188188
`${toolCall.toolName} tool call from programmatic agent`,
189189
)
190190

191-
// Add user message with the tool call before executing it
191+
// Add assistant message with the tool call before executing it
192192
// Exception: don't add tool call message for add_message since it adds its own message
193193
if (toolCall.toolName !== 'add_message') {
194194
const toolCallString = getToolCallString(
195195
toolCall.toolName,
196196
toolCall.args,
197197
)
198198
state.messages.push({
199-
role: 'user' as const,
200-
content: asUserMessage(toolCallString),
199+
role: 'assistant' as const,
200+
content: toolCallString,
201201
})
202+
onResponseChunk(toolCallString)
202203
state.sendSubagentChunk({
203204
userInputId,
204205
agentId: agentState.agentId,

0 commit comments

Comments
 (0)