mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: redesign the advisor tool row (#28069)
This commit is contained in:
@@ -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."
|
||||
)
|
||||
|
||||
@@ -40,6 +40,7 @@ func (rt *Runtime) RunAdvisor(
|
||||
if !rt.tryAcquire() {
|
||||
return AdvisorResult{
|
||||
Type: ResultTypeLimitReached,
|
||||
Advice: LimitReachedAdvice,
|
||||
RemainingUses: 0,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user