style: use xml-like tags for step budget notices

Match the format used by user interruptions.
This commit is contained in:
Levi Neely 2026-08-07 17:15:57 +02:00
parent 6f55348d38
commit 799d569654
1 changed files with 2 additions and 2 deletions

View File

@ -675,13 +675,13 @@ func run(ctx context.Context, cfg agentConfig, state state) error {
if step == halfBudget {
state.update(backend.Message{
Role: "user",
Content: fmt.Sprintf("[system: you have used %d/%d research steps without taking action. Consider making progress — write code, edit files, or run commands. Action tools reset this counter.]", step, cfg.MaxSteps),
Content: fmt.Sprintf("<system-step-budget-warning>\nYou have used %d/%d research steps without taking action. Consider making progress — write code, edit files, or run commands. Action tools reset this counter.\n</system-step-budget-warning>", step, cfg.MaxSteps),
}, nil)
} else if step >= cfg.MaxSteps-1 {
emit(cfg, Event{Role: "maxsteps", Content: fmt.Sprintf("%d", step+1)})
state.update(backend.Message{
Role: "user",
Content: fmt.Sprintf("[system: step budget exhausted (%d/%d steps used). Stop calling tools. Summarize what you have done and what remains, then stop.]", step+1, cfg.MaxSteps),
Content: fmt.Sprintf("<system-step-budget-stop>\nStep budget exhausted (%d/%d steps used). Stop calling tools. Summarize what you have done and what remains, then stop.\n</system-step-budget-stop>", step+1, cfg.MaxSteps),
}, nil)
break
}