Skip to content

Commit 46eba97

Browse files
committed
Feed error message into agent messages to help debugging
1 parent cd5a619 commit 46eba97

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/src/run-programmatic-step.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ export async function runProgrammaticStep(
276276
}`
277277
onResponseChunk(errorMessage)
278278

279+
state.agentState.messageHistory = [
280+
...state.messages,
281+
{
282+
role: 'user' as const,
283+
content: errorMessage,
284+
},
285+
]
279286
state.agentState.output = {
280287
...state.agentState.output,
281288
error: errorMessage,

0 commit comments

Comments
 (0)