mirror of
https://github.com/coder/coder.git
synced 2026-06-06 22:48:19 +00:00
47b90afce6
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.
26 lines
1.2 KiB
Go
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>`
|
|
)
|