File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments