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

Function classifyMainLoopStop

internal/agent/agent.go:1242–1247  ·  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

1240// json runs the progress lines that would say why an item stopped are discarded,
1241// so that string is the only stop diagnostic that leaves a CI runner.
1242func classifyMainLoopStop(stop llmloop.MainLoopStop) (session.FailureClass, string) {
1243 if stop == llmloop.StopMaxRounds || stop == llmloop.StopTokenBudget {
1244 return session.FailureBudget, stop.Reason()
1245 }
1246 return session.FailureUnknown, stop.Reason()
1247}
1248
1249// subtaskStop is the structured, non-error reason a single-file review stopped
1250// 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