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

Function classifyMainLoopStop

internal/agent/agent.go:1015–1022  ·  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 max-tool-request budget is a declared budget stop; the empty-round and compression exits are genuine but unclassifiable, so they map to the honest unknown catch-all. On

(stop llmloop.MainLoopStop)

Source from the content-addressed store, hash-verified

1013// unclassifiable, so they map to the honest unknown catch-all. Only an explicit
1014// budget trigger may use the budget classification.
1015func classifyMainLoopStop(stop llmloop.MainLoopStop) (session.FailureClass, string) {
1016 switch stop {
1017 case llmloop.StopMaxRounds:
1018 return session.FailureBudget, "reached the maximum tool-request rounds without finishing"
1019 default: // StopEmptyRounds, StopCompression, StopNone
1020 return session.FailureUnknown, "main task stopped before completing"
1021 }
1022}
1023
1024// subtaskStop is the structured, non-error reason a single-file review stopped
1025// short of task_done. It lets the dispatcher classify manifest coverage from an

Callers 1

executeSubtaskMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected