open-code-review/internal
Fanzzzd 4b6874bd23
Some checks are pending
Deploy Pages / deploy (push) Blocked by required conditions
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
fix(agent): name the main-loop stop trigger in item failure reasons (#855)
* fix(agent): name the main-loop stop trigger in item failure reasons

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 #842

* fix(llmloop): share the main-loop stop reason with the scan path

PR #855 named the empty-round and compression stops in the diff-review
manifest reason, but two gaps remained.

A MainLoopStop constant added later would fall through
classifyMainLoopStop's default and inherit the collapsed "main task
stopped before completing" text without failing a test — the exact shape
of #842, reintroduced by the next enum addition. classifyMainLoopStop now
keys only on StopMaxRounds for the budget class and delegates every reason
to MainLoopStop.Reason(), whose own default names the unrecognized value.

internal/scan discarded the MainLoopStop entirely and hardcoded a second
opaque sentence. Scan sessions opt out of the run manifest, so that string
is their whole diagnostic: warningsForOutput only drops scan_subtask_error
warnings when a manifest exists, and under --format json the [ocr] progress
lines that would say which exit fired are discarded. It now appends the
shared Reason(), keeping the prefix that resume records and existing
warnings match on.

MainLoopStop also gains String(), so a stop no longer formats as a bare
integer in telemetry, logs and test failure messages.

Tests pin String() and Reason() for every stop, assert neither collides
across stops, and fail when a constant is added past StopCompression —
the prompt to give it its own case. The scan warning test now requires the
trigger to be named rather than only that the task did not complete.

---------

Co-authored-by: Fanzzzd <fanzzzd@users.noreply.github.com>
Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-08-20 18:46:56 +08:00
..
agent fix(agent): name the main-loop stop trigger in item failure reasons (#855) 2026-08-20 18:46:56 +08:00
config feat(language): add support for .ipynb files (#980) 2026-08-18 20:24:20 +08:00
delegate chore: add SPDX license headers and automated verification (#740) 2026-08-05 21:26:27 +08:00
diff fix(diff): re-file comments whose code lives in another file (#921) 2026-08-15 19:20:41 +08:00
gitcmd chore: add SPDX license headers and automated verification (#740) 2026-08-05 21:26:27 +08:00
llm test(llm): cover tool_choice mapping for all three provider protocols (#1011) 2026-08-20 11:04:22 +08:00
llmloop fix(agent): name the main-loop stop trigger in item failure reasons (#855) 2026-08-20 18:46:56 +08:00
mcp test: raise statement coverage to 90% and enforce it in CI (#747) 2026-08-06 12:55:44 +08:00
model chore: add SPDX license headers and automated verification (#740) 2026-08-05 21:26:27 +08:00
pathutil test: raise statement coverage to 90% and enforce it in CI (#747) 2026-08-06 12:55:44 +08:00
release chore: add SPDX license headers and automated verification (#740) 2026-08-05 21:26:27 +08:00
scan fix(agent): name the main-loop stop trigger in item failure reasons (#855) 2026-08-20 18:46:56 +08:00
session feat(config): resolve api_key/auth_token from a command (#236) (#605) 2026-08-17 14:40:37 +08:00
stdout fix(cmd): stream review progress to stderr for json and sarif (#929) 2026-08-19 19:05:53 +08:00
suggestdiff chore: add SPDX license headers and automated verification (#740) 2026-08-05 21:26:27 +08:00
telemetry refactor(telemetry): replace PrintTraceSummary positional params with TraceSummary struct (#909) 2026-08-15 12:19:28 +08:00
tool chore: add SPDX license headers and automated verification (#740) 2026-08-05 21:26:27 +08:00
viewer feat(config): resolve api_key/auth_token from a command (#236) (#605) 2026-08-17 14:40:37 +08:00