Skip to content

fix(llmloop): finalize exhausted reviews - #765

Open
4-1-1 wants to merge 1 commit into
alibaba:mainfrom
4-1-1:codex/fix-review-convergence
Open

fix(llmloop): finalize exhausted reviews#765
4-1-1 wants to merge 1 commit into
alibaba:mainfrom
4-1-1:codex/fix-review-convergence

Conversation

@4-1-1

@4-1-1 4-1-1 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

When a per-file review reaches its context-tool round budget, the loop currently stops immediately unless the model already called task_done. A text-only response also retries with the full context tool set, which can reopen investigation instead of converging.

Add a two-round terminal-only finalization phase after either condition. The model can only submit code_comment findings and finish with task_done, so gathered evidence is preserved without allowing more context expansion. Explicit successful task_done remains the only completion signal.

Automated Review Reproduction

The PR's OpenCodeReview check reproduced the existing behavior with the published v1.8.10 binary: reviewing only internal/llmloop/loop.go made 19 context-expansion calls (8 code_search, 11 file_read), consumed 175,414 tokens, and timed out after 10 minutes without calling task_done.

This check intentionally runs the trusted base-branch action and installs the published latest package under pull_request_target; it does not execute the implementation from this fork. The regular CI, race tests, and cross-compilation checks pass on the PR code.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

Additional verification:

  • make check
  • make build
  • focused llmloop, agent, scan, and CLI tests

Checklist

  • My code follows the project coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • Documentation is unchanged because no user-facing option or output format changes
  • I have signed the CLA

Related Issues

No linked issue.

Give models terminal-only rounds after context exhaustion or a text-only response, while preserving explicit task_done completion.
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.

1 participant