Repository navigation
Conversation
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). |
NanaseInori
left a comment
There was a problem hiding this comment.
Reviewed all seven changed files and the surrounding async cancellation/application path against #1877. I found no blocking defect in the scoped duplicate-request fix.
The rejection key covers the rendered compressible prefix rather than the full conversation length, and both synchronous call sites reuse the same conversation-local state. The cancellation check and cache update execute under the same mutex as cancelPendingCompression, so a superseded background attempt cannot overwrite the newer cached rejection. The cached path preserves the original error/history and returns before creating a fictitious request record.
The tests exercise the actual main-loop threshold transition, changed inputs with the same message count, independent conversations, transient recovery, recovery headers, and an old cancelled request completing after a replacement. The typed-error classifier avoids treating plain error text as an HTTP input rejection.
Compared with #1170 and #1893, this fixes repeated submission of a rejected input; it does not claim to bound that input or make an oversized review complete. That distinction matches the linked issue and the PR's deliberately narrower scope.
This is a source-and-test review, not a local Go/race-suite execution. GitHub currently reports this branch as unmergeable; the integration conflict needs resolution and the resulting head should run the required checks, including working race validation. This approval does not certify the author's outstanding human-review attestations.
This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.
感谢详细审查,尤其是对异步取消、旧后台任务完成顺序,以及错误分类边界的核对。 我会保持当前改动范围:避免重复提交已被拒绝且内容未改变的压缩输入,不将其扩展为输入大小限制,也不把它描述为长评审完整性的解决方案。 接下来会先解决与目标分支的集成冲突,核对冲突处理没有改变原有行为,再针对最终提交重新执行项目要求的检查、完整测试和相关回归测试,包括在支持的环境中运行 race 检测。 完成后会补充最终提交 SHA、实际执行的命令及结果。如果有未完成或受环境限制的检查,也会明确说明,不将此次源码审查批准视为运行验证的替代。 感谢指出剩余的集成和验证事项! |
|
感谢详细审查。与目标分支的集成冲突已解决,更新已推送到同一个 PR,最终提交为: 此次集成适配了主干的 llmloop.Task / reviewtask 拆分:真实评审循环及 HTTP 边界回归测试迁入 reviewtask,缓存和异步取消相关测试保留在 llmloop。 已针对最终提交完成实际验证:
GitHub 目前确认已无合并冲突;远端 Linux CI、五项跨平台构建及 CLA 均通过。Windows 原生任务和三项 CodeQL 检查仍在排队,因此暂不声称全部远端检查通过。 实际命令、工具链版本、环境问题的处理及平台跳过项均已更新到 PR 正文。 |
Description
Avoid resending the last rejected compression input when the review loop moves from asynchronous compression to its synchronous fallback. Related to #1877.
This is a controlled reproduction through the actual
RunMainTaskloop, not a production incident or a timing benchmark. The improvement is one fewer redundant request in the reproduced workflow; it does not make an oversized review succeed.Reproduced execution path
On upstream
34517e3, withMaxTokens=1000:file_readresult takes the conversation above the 60% soft threshold. Background compression submits the old conversation prefix A and receives an HTTP 400 input rejection.StopCompressionoutcome. That stop was already correct; the second request was unnecessary.The regression uses a barrier to complete the background failure before the next tool round, rather than relying on goroutine timing. Before applying the production change, its assertion failed with two compression requests. After the change, it observes one:
Run the regression from this branch:
Relevant output:
Here,
input_bytesmeasures serialized shared message objects, not network bytes. A separateTestCompressionRetryHTTPBoundaryexercises the real OpenAI SDK against a local HTTP server: the permanent-rejection cases send one 3521-byte request, while 429 recovery, an explicit provider retry directive, and a temporary 413 still permit recovery. No human-time, billing, or review-success-rate improvement is claimed.Small, conversation-local change
compressionState. Hash the rendered compression zone, not the full history or message count. The template, model and completion limit are fixed within that conversation.x-should-retry: true,Retry-After, orretry-after-ms; leave other statuses, timeouts and unrecognized errors alone. No classification by error-message text.There is no new CLI surface, persisted event/schema, history truncation, or all-history failure cache. This is narrower than the whole of #1877. It also differs from #1170's input-size bound and #1583's truncated-summary handling.
Type of Change
How Has This Been Tested?
Integration commit:
ed43293a513246598fc919ec1057dc627452cec1, merging upstreame170728a2f05cada736aa481ce7ef26bbbadd3fbinto this PR branch without rewriting its history. The resolved tree is342c18bc33fea639cacee29ad39e92878b076e10.The merge preserves upstream's generic
llmloop.Task/reviewtasksplit. Full-loop and real-SDK HTTP-boundary regression tests now live ininternal/reviewtask; white-box cache and cancellation tests remain ininternal/llmloop. The contribution remains limited to the rejected-input retry fix.Validation on Windows amd64, GCC 16.2.0 UCRT, and Git Bash for Make recipes, using both CI-pinned Go 1.26.10 and Go 1.27.0:
make license-add: no missing headers.make check: passed on the final commit with Go 1.26.10 and on the identical pre-commit tree with Go 1.27.0.make build: passed on the final commit with both toolchains;--versionreportsed43293.make test 'PACKAGES=./... -p 2 -timeout 600s': 26 packages passed on the final commit with each toolchain, with the Makefile's-raceenabled.make coverage 'PACKAGES=./... -covermode=atomic -p 2 -timeout 600s': 91.0% with Go 1.26.10; 92.3% with Go 1.27.0. Both exceed the 90% gate.make test 'PACKAGES=./internal/llm ./internal/llmloop ./internal/reviewtask -p 2 -run CompressionRetry\|NonRetryableInput -count=30 -timeout 180s': passed with-raceon the final commit with Go 1.26.10 and on the identical pre-commit tree with Go 1.27.0. The actual-loop regression still reportsmain_requests=2 compression_requests=1 unique_compression_inputs=1 duplicate_inputs=0,completed=false stop=compression; the original failed request record is retained.npm run test:launcher, and CLI version/help smoke checks: passed.GOTOOLCHAIN=go1.26.10 go run golang.org/x/vuln/cmd/[email protected] ./...: passed, no vulnerabilities found. The same scan using this host's Go 1.27.0 reported standard-library vulnerabilities, so the project's pinned toolchain was used for this check; no dependency or toolchain policy changes are part of this PR.e58882fb-6dd9-480e-8cfd-30c8285fdeda); recovery-header refinement: complete, 1 file, 0 findings (d16c6f36-92e7-408d-8ba5-faa2d5397d71). Pre-commit integration review: complete, both selected integration-related production files (compression.go,loop.go), 0 findings (274bf138-d99d-4cad-9635-305e2e436bc9). That last run recorded one failed attempt to read a directory as a file; it is not a claim of a fresh eight-file review or a substitute for execution tests or personal review.0xc0000139, GCC 8.1.0) was resolved for this validation by selecting GCC 16.2.0 UCRT in the test process only. System-wide configuration was not changed.Platform limits: Windows-specific skips remain, including POSIX permissions/signals, PTY and symlink-dependent cases. Linux-only paths and the upstream cross-platform CI matrix are not claimed as locally executed. All Make commands above used an explicit Git Bash
SHELLon this host.Local Go 1.26.10 setup note: initial Makefile package discovery failed on automatic VCS stamping in this nested worktree. Its first
make checkdid not pass; rerunning with process-localGOFLAGS=-buildvcs=falsepassed. The same setting was used for the Go 1.26.10 coverage, repeated regression and build runs. It does not disable race detection; the final commit SHA is recorded separately in the logs and binary version.Checklist
AI assistance: OpenAI Codex / GPT-6 Astra assisted with investigation, implementation, tests and this PR description. OpenCodeReview / gpt-5.6-sol performed the automated source reviews. Those reviews do not certify the contributor's personal-review checklist items. No AI authorship trailers are included in the commit.
Related Issues
Related to #1877; not claiming to close all of its recovery-policy scenarios.