Repository navigation
fix: retain exec review resources after timeout - #143308
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 2:21 PM ET / 18:21 UTC (Revision 2). ClawSweeper reviewWhat this changesKeeps exec review’s prepared model resources alive through delayed preparation, inference, and transport cleanup while preserving prompt timeout fallback to human approval. Merge readiness✅ Ready for maintainer review This focused repair remains useful: current main still releases preparation resources before completion finishes. No introduced correctness or security defect was found, and the supplied runtime evidence covers the changed lifecycle. Priority: P2 Review scores
Verification
How this fits togetherExec auto-review evaluates proposed commands using a configured model and returns an approval decision. Its resource owner must outlive pending provider work even when the caller has already received a timeout. flowchart TD
A[Proposed command] --> B[Input and policy checks]
B --> C[Acquire model resources]
C --> D[Model review]
C --> E[Timeout or cancellation]
D --> F[Approval decision]
E --> F
C --> G[Drain pending work]
D --> G
G --> H[Release resources]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +31, Tests +305, Docs +2. Total +338 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep resource release tied to actual provider-work completion while preserving existing approval decisions, cancellation, and independent timeout budgets. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the lifetime mismatch: current main’s preparation wrapper releases before inference, while provider callbacks and cancellation can remain pending. The contributor reports failing-before/passing-after cases; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Reusing the acquired-model contract and existing asynchronous work tracking fixes the owning lifecycle without changing timeout budgets, approval policy, or public plugin APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7d31ecce8296. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix(agents): retain exec reviewer resources through timed-out work * test: migrate exec security floor to acquired completion
* fix(agents): retain exec reviewer resources through timed-out work * test: migrate exec security floor to acquired completion (cherry picked from commit cc81bfa)
배치 A 체리픽이 이 포크에 없는 중간 리팩터링에 걸린 지점을 포크 코드에 맞춰 정리했다. - 문자열 이스케이프 복구: attempt-prompt-build.ts, attempt-prompt-context.test.ts - openclaw#140859: session-accessor.entry-mutation.ts 의 transcript 헤더 import 복원 - openclaw#141247: runs.ts 에서 포크에 없는 projectSessionActive 조건 제거 - openclaw#141471: execute-plugin.test-support.js 가 없어 native-bash 테스트 파일 제거 - openclaw#141960: quickjs-wasi 3.6.0 의 MAX_STACK_SIZE 를 쓸 수 없어 되돌림(포크는 3.5.0 핀) - openclaw#142130: agents.ts 의 assertCurrent 호출 제거, cleanup-utils 는 선택 인자로 유지 - openclaw#142158: manifest-planner.ts 의 remoteModelIds·manifestModelsById 복원 - openclaw#143308: simple-completion-runtime.ts 에 acquireSimpleCompletionModelForAgent 래퍼 추가 - openclaw#143899: src/infra/file-descriptor.ts 의 fingerprint 비교 헬퍼 이식, backup-shared 의 configCapture 참조 제거 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Related: #140674
What Problem This Solves
Resolves a problem where exec auto review releases a prepared model before inference and transport cleanup finish. A preparation that completes after the timeout can also escape the caller's lifetime.
Why This Change Was Made
Retain the existing acquired model contract through actual preparation, completion, response callbacks, and cancellation work. Admit the cleanup owner before preparation; separate the caller's result from drainage so late preparation releases without starting inference and existing timeout results stay prompt. This is the exec-reviewer slice of #140674.
The separate preparation and completion budgets, policy checks, prompt construction, parser, and input limits are preserved. Internal test injection follows the acquired contract; no public adapter or compatibility shim is added.
User Impact
Exec review keeps its model and authentication runtime alive until cleanup completes, while preserving existing approval decisions and timeout fallback behavior.
Evidence
Four final native regression cases fail against the original code and pass with the repair: overlap, late preparation, held response callback, and response cancellation. All 293 focused tests passed, including 4,096 seeded malformed responses, concurrency controls, and the fresh completion budget. Changed-file gate coverage, isolated Codex review through P2, and the full build passed. The SDK-removal audit also found and reproduced a stale security-floor test mock. Its acquired-contract migration preserves every assertion; all 26 owning tests, targeted types/lint, and fresh independent review passed.
A plain Node run of the built public exec-review SDK used genuine async provider authentication, actual loopback HTTP, response callbacks, and the configured guarded response body's cancellation. The five-second fallback returned in 5,004 ms for late preparation and 5,008 ms for a held callback. Callback failure returned in 9 ms while cancellation still retained its owner. Strict process cleanup passed in 12.450 seconds; all 12,111 built artifacts remained unchanged. No reviewed command was executed.
These are illustrative local samples, not a speedup benchmark, paid-provider proof, or activation of general registration disposal. Earlier proof-only module-path and ineffective global-fetch instrumentation failures were corrected without weakening production guards; the successful proof delegates through the actual guarded transport.