fix(agent): stringify input into user prompt for agent (#984)

This commit is contained in:
Waleed Latif
2025-08-15 19:36:49 -07:00
committed by GitHub
parent 5f6d219223
commit 42917ce641

View File

@@ -317,11 +317,13 @@ export class AgentBlockHandler implements BlockHandler {
}
private addUserPrompt(messages: Message[], userPrompt: any) {
let content = userPrompt
let content: string
if (typeof userPrompt === 'object' && userPrompt.input) {
content = userPrompt.input
content = String(userPrompt.input)
} else if (typeof userPrompt === 'object') {
content = JSON.stringify(userPrompt)
} else {
content = String(userPrompt)
}
messages.push({ role: 'user', content })