fix(builtin): split prompt into system/user messages #425
Reference in New Issue
Block a user
Delete Branch "fix/builtin-agent-system-user-split"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Split builtin agent prompt into proper system/user message separation.
Why
The builtin agent was putting everything into a single system message with no user message, causing Claude API 400 errors (Claude requires at least one user message).
More importantly, this aligns with the workflow's core model:
The moderator speaks to agents via graph edge prompts — these belong in user messages.
Changes
buildBuiltinPromptreturns{ system, user }instead of a single stringagent.tssends system + user as two separate messagesVerified
debateworkflow: 2 steps with builtin agent, correct frontmatter outputSystem message = agent identity (role prompt + output format instruction) User message = moderator speech (task + edge prompt + history) This reflects the workflow's core model: moderator speaks to agent via the graph's edge prompt. Previously all content was in a single system message with no user message, causing Claude API 400 errors. - buildBuiltinPrompt now returns { system, user } instead of string - agent.ts sends system + user as separate messages - Tests updated accordinglyLGTM ✅ 拆分清晰:system = role identity + output format,user = task + edge + history。测试也同步更新了。