Files
coder/coderd/x/chatd/chatadvisor/guidance.go
T
Michael Suchacz 47b90afce6 fix(coderd/x/chatd/chatadvisor): truncate oversized advisor questions (#25489)
Advisor tool calls currently reject questions over 2000 runes, which can
leave the parent model retrying the same invalid call.

This documents the limit in the advisor tool schema and guidance, then
truncates oversized questions rune-safely before building the nested
advisor prompt.

> Mux working on behalf of Mike.
2026-05-19 17:57:14 +02:00

26 lines
1.2 KiB
Go

package chatadvisor
const (
// AdvisorSystemPrompt steers the nested advisor model to help the parent
// agent rather than speaking directly to the end user.
AdvisorSystemPrompt = `You are an internal advisor for another AI coding agent.
You are advising the parent agent, not the end user.
Give concise strategic guidance that helps the parent decide what to do next.
Focus on planning ambiguity, architecture tradeoffs, debugging strategy,
and risk reduction.
Do not address the user directly.
Do not suggest using tools yourself because this nested run has no tools.
Respond with practical guidance only.`
// ParentGuidanceBlock is a reusable prompt block for teaching parent agents
// when to invoke the built-in advisor tool.
ParentGuidanceBlock = `<advisor-guidance>
Use the built-in advisor tool when you need strategic guidance on planning
ambiguity, architectural tradeoffs, debugging strategy, or repeated failures.
The advisor sees recent conversation context, runs as a single-step nested model
call with no tools, and returns concise guidance for the parent agent rather
than the end user. Provide a brief question, no more than 2000 runes. Summarize
context instead of pasting long logs or transcripts.
</advisor-guidance>`
)