Repository navigation
fix(setup): prevent false failures after successful model probes - #155407
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 22, 2026, 4:17 AM ET / 08:17 UTC (Revision 5). ClawSweeper reviewWhat this changesModel setup now waits for tracked embedded-probe cleanup before activation and reports cleanup failures, with regression coverage for premature temporary-directory removal. Merge readiness✅ Ready for maintainer review Keep open: the cleanup race remains on the pinned main revision, and this focused fix has no identified blocking defect. The related merged model-support change does not supersede it. Priority: P2 Review scores
Verification
How this fits togetherModel setup tests a proposed provider connection through an isolated agent runtime before activating it. The probe must release its plugin runtime before activation reloads the Gateway configuration. flowchart TD
A[Proposed model connection] --> B[Isolated model probe]
B --> C[Model response]
C --> D[Wait for tracked cleanup]
D --> E{Cleanup succeeded}
E -->|Yes| F[Revalidate and activate connection]
E -->|No| G[Report setup failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +35, Tests +53. Total +88 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep probe completion tied to its tracked runtime cleanup, preserving existing activation revalidation and retry behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: the runner can return a successful response before tracked runtime disposal finishes, while main lets setup proceed immediately. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes: joining the existing async-work owner at the setup boundary addresses the lifecycle mismatch without changing the runner's general response semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 034349f34a42. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
60878ec to
1491bf5
Compare
1491bf5 to
bf119a4
Compare
* commit 'f3327bde3c6052a4ed6d487bb09fbe1e11c0cd35': (25 commits) fix(test): pass the fixture lifetime to launcher fixtures (#155825) fix(test): prepare history benchmark before child deadlines (#155780) refactor(config): derive tool contracts from schemas (#155484) chore(deps): update fs-safe to 0.18.1 (#155771) fix(doctor): allow repair with retained deleted-agent sessions (#155752) fix(setup): await inference probe cleanup (#155407) fix(mcp): recover expired SSE sessions and speed up parsing (#155497) fix(release): forward the stable soak waiver through the candidate helper (#155798) feat: calibrate Gateway plugin resources through retirement (#155792) fix: preserve the invoked launcher when restarting Node (#147621) fix(sessions): stop repeated failed worker exit cleanup (#154720) fix(ui): preserve active replies and tools after failed steering (#155746) fix(ci): retain missing-load-path baseline diagnostics (#154861) fix(gateway): keep session lists responsive during activity updates (#155767) fix: keep plugin queues bound to their selected session (#155714) chore(i18n): refresh native locales (#155571) fix(ci): wait for reset hook entry and join fixture cleanup (#155770) test: move subagent fixtures to module boundaries (#155727) fix(gateway): retain question requester authority through settlement (#155335) perf(gateway): move progress-card reads off the main thread (#153857) ...
Keeps setup-inference-turn.ts under its 700-line cap after merging main's async probe drain (openclaw#155407). The hidden-run registration moves into setup-inference-probe-work.ts, which already owns the probe's lifecycle; the clear still runs in the finally block after the drain, so late probe events stay out of Gateway projection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Fixes: inference setup can report activation failure after a successful model probe when the probe runtime still retains plugin work during the config reload.
User Impact
User impact: successful provider setup no longer rolls back or shows a false failure while the isolated probe runtime is finishing cleanup.
Why This Change Was Made
The setup probe now owns and drains its tracked asynchronous work before returning to activation. This releases the isolated plugin generation before the Gateway attempts to replace it, and propagates any late cleanup failure instead of treating the probe as ready.
This was discovered while live-testing #155379 but is intentionally split from the Grok 4.7 model-support change.
Evidence
mainbecause temporary probe cleanup began while tracked plugin work was still open; it passes after the fix.node scripts/run-vitest.mjs src/system-agent/setup-inference-turn.test.ts --maxWorkers=1— 5 passed; 18.74s measured wall time.node scripts/run-vitest.mjs src/system-agent/setup-inference-activate.test.ts src/gateway/config-reload.activation.integration.test.ts --maxWorkers=1— 51 passed; 87.25s measured wall time.pnpm check:changed— passed, including core and test typechecks, formatting, lint, dead-export, line-cap, and import-cycle guards.origin/main— P0/P1 scoped-clean.