Skip to content

fix(agent): name the main-loop stop trigger in item failure reasons - #855

Open
Fanzzzd wants to merge 1 commit into
alibaba:mainfrom
Fanzzzd:fix/stop-reason-detail
Open

fix(agent): name the main-loop stop trigger in item failure reasons#855
Fanzzzd wants to merge 1 commit into
alibaba:mainfrom
Fanzzzd:fix/stop-reason-detail

Conversation

@Fanzzzd

@Fanzzzd Fanzzzd commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #842.

When a per-file review stops without completing, classifyMainLoopStop collapsed StopEmptyRounds, StopCompression and StopNone into one opaque reason, "main task stopped before completing". The two named stops call for opposite responses (model/tool-loop trouble vs. context budget), and in --format json runs the [ocr] progress lines that would say which one fired are discarded by stdout.Quiet() — so on an ephemeral CI runner the manifest reason is the only stop diagnostic that survives, and it said the same thing for every exit. In practice that meant a recurring per-file failure could not be triaged from uploaded artifacts at all (how #842 was found).

Change — exactly the two-line shape proposed in the issue, keeping the FailureUnknown class untouched:

  • StopEmptyRounds"stopped after repeated rounds without a usable tool result"
  • StopCompression"stopped because context compression exceeded its threshold"
  • StopNone (non-completed) keeps the existing catch-all string, and StopMaxRounds is unchanged.

TestTestClassifyMainLoopStop (beside the existing TestClassifyItemError it mirrors) pins the full stop→(class, reason) mapping and additionally asserts no two stops share a reason string, so a future regression back into a collapsed message fails the table even if the strings are edited.

No behavior change beyond the reason text: classes, exit codes and manifest shape are untouched. Verified with go vet and the full internal/agent test suite.

StopEmptyRounds and StopCompression previously collapsed into the same
"main task stopped before completing" string as StopNone, so a failed
item's manifest could not say whether the model spun without usable tool
results or the context outgrew its compression threshold. In --format
json runs the progress lines that name the trigger are discarded, which
made the manifest reason the only diagnostic that leaves a CI runner —
and it said the same thing for every stop.

Keep the unknown failure class (the taxonomy has no fitting category)
but give each stop its own reason, mirroring the StopMaxRounds
precedent.

Fixes alibaba#842
@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed review items cannot say why they stopped: StopEmptyRounds and StopCompression both surface as "main task stopped before completing"

1 participant