feat: redesign the advisor tool row (#28069)

This commit is contained in:
Danielle Maywood
2026-08-12 15:35:31 +01:00
committed by GitHub
parent e02d9adc11
commit 5a33b669b4
7 changed files with 170 additions and 213 deletions
+3
View File
@@ -22,4 +22,7 @@ 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>`
// LimitReachedAdvice is returned when the per-run advisor budget is
// exhausted, telling the parent agent to stop calling the advisor.
LimitReachedAdvice = "The advisor budget for this turn is exhausted. Do not call the advisor again this turn; proceed with your own judgment."
)
+1
View File
@@ -40,6 +40,7 @@ func (rt *Runtime) RunAdvisor(
if !rt.tryAcquire() {
return AdvisorResult{
Type: ResultTypeLimitReached,
Advice: LimitReachedAdvice,
RemainingUses: 0,
}, nil
}
+1 -1
View File
@@ -370,7 +370,7 @@ func TestAdvisorToolReportsLimitReached(t *testing.T) {
require.NoError(t, json.Unmarshal([]byte(second.Content), &result))
require.Equal(t, chatadvisor.ResultTypeLimitReached, result.Type)
require.Equal(t, 0, result.RemainingUses)
require.Empty(t, result.Advice)
require.Equal(t, chatadvisor.LimitReachedAdvice, result.Advice)
require.Empty(t, result.Error)
require.Empty(t, result.AdvisorModel)
}
+2 -2
View File
@@ -13,9 +13,9 @@ const (
ResultTypeError ResultType = "error"
)
// AdvisorArgs contains the tool-visible advisor question.
type AdvisorArgs struct {
Question string `json:"question" description:"A brief question for the advisor. Must be 2000 runes or fewer. Summarize context instead of pasting long logs or transcripts."`
Question string `json:"question" description:"A brief question for the advisor. Must be 2000 runes or fewer. Summarize context instead of pasting long logs or transcripts."`
ModelIntent *string `json:"model_intent,omitempty" description:"A short, natural-language, present-participle phrase describing why you are consulting the advisor. This is shown to the user as the tool row title, so write it as a standalone action. Use plain English with no underscores or technical jargon. Do not restate the question. Keep it under 100 characters. Good examples: \"Weighing a refactor tradeoff\", \"Checking a migration strategy\", \"Planning a safe rollout\"."`
}
// AdvisorResult is the structured result returned by the advisor runtime.