MCPcopy Create free account
hub / github.com/alibaba/open-code-review / classifyMainLoopStop

Function classifyMainLoopStop

internal/agent/agent.go:1240–1245  ·  view source on GitHub ↗

classifyMainLoopStop maps a non-error, non-completed main-loop stop to an item failure class and a safe reason. Only the configured limits — the max-tool-request rounds and the aggregate token budget — are declared budget stops, so only they may use the budget classification; every other stop keeps

(stop llmloop.MainLoopStop)

Source from the content-addressed store, hash-verified

1238// json runs the progress lines that would say why an item stopped are discarded,
1239// so that string is the only stop diagnostic that leaves a CI runner.
1240func classifyMainLoopStop(stop llmloop.MainLoopStop) (session.FailureClass, string) {
1241 if stop == llmloop.StopMaxRounds || stop == llmloop.StopTokenBudget {
1242 return session.FailureBudget, stop.Reason()
1243 }
1244 return session.FailureUnknown, stop.Reason()
1245}
1246
1247// subtaskStop is the structured, non-error reason a single-file review stopped
1248// short of task_done. It lets the dispatcher classify manifest coverage from an

Callers 2

TestClassifyMainLoopStopFunction · 0.85
executeGroupSubtaskMethod · 0.85

Calls 1

ReasonMethod · 0.80

Tested by 1

TestClassifyMainLoopStopFunction · 0.68