Stop repetitive reasoning streams before provider timeout - #1
PierrunoYT wants to merge 1 commit into
Conversation
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Required CI passed. Waiting for automated review of the latest commit. If automated review does not start, a maintainer must restart it. Review-state labels are managed by this workflow; do not edit them manually. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Closing this fork-targeted PR; the change is now proposed upstream in Zoo-Code-Org#1904. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 280b240090
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (reasoningLoopDetector.add(chunk.text)) { | ||
| this.cancelCurrentRequest() | ||
| throw new RepetitiveReasoningError() |
There was a problem hiding this comment.
Process reasoning before awaiting the next chunk
When a provider emits a reasoning chunk that crosses the repetition threshold and then stalls, the loop awaits nextChunkWithAbort() at line 3308 before invoking this detector. Consequently, the threshold-crossing chunk is not examined and the request remains active until another chunk arrives or the provider times out, defeating the new safeguard in this scenario. Process the current chunk before requesting the next one.
Useful? React with 👍 / 👎.
Summary
Regression coverage
Verification
pnpm --dir src exec vitest run core/task/__tests__/ReasoningLoopDetector.spec.ts core/task/__tests__/Task.spec.ts api/providers/__tests__/openrouter.spec.ts— 185 tests passed.pnpm lint— 11 packages passed (pre-commit hook).pnpm check-types— 11 packages passed (pre-push hook).