Skip to content

Commit 567d661

Browse files
committed
work around readonly messageHistory
1 parent 3d2a1db commit 567d661

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/agent-runtime/src/run-programmatic-step.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ export async function runProgrammaticStep(
300300
// agentId: agentState.agentId,
301301
// parentAgentId: agentState.parentId,
302302
// })
303+
// NOTE(James): agentState.messageHistory is readonly for some reason (?!). Recreating the array is a workaround. We should figure out why it's frozen.
304+
agentState.messageHistory = [...agentState.messageHistory]
303305
agentState.messageHistory.push(assistantMessage(toolCallPart))
304306
// Optional call handles both top-level and nested agents
305307
// sendSubagentChunk({

0 commit comments

Comments
 (0)