Repository navigation
fix(cron): prevent cold turns from blocking the gateway - #123368
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 7:31 PM ET / 23:31 UTC. ClawSweeper reviewWhat this changesThis PR makes isolated scheduled-agent model selection read the published model catalog without triggering full provider discovery, with regressions covering that contract. Regression provenancePossible regression — probable (reviewed change; failure trace; known regression link). No predecessor PR is attributed. Merge readinessKeep open for maintainer landing: the focused repair restores the cron model-owner read-only boundary and the prior release-note finding was removed, but exact-head CI is still running. Priority: P1 Review scores
Verification
How this fits togetherA scheduled isolated agent resolves its model through the Gateway before its runner starts. This lookup must use the published catalog so a cold turn does not block Gateway responsiveness by loading the full provider catalog. flowchart LR
A[Scheduled agent turn] --> B[Model selection]
B --> C[Gateway model owner]
C --> D{Read-only lookup}
D -->|Yes| E[Published catalog]
D -->|No| F[Full provider discovery]
E --> G[Start runner]
F --> H[Gateway stall]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +25. Total +26 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land this narrow owner-boundary repair after exact-head CI confirms that cron uses the published catalog without affecting configured-model or Gateway-subagent selection. Do we have a high-confidence way to reproduce the issue? Source-reproducible: the supplied regression makes an omitted read-only request invoke a failing full-catalog loader, although local runtime execution was unavailable in this review environment. Is this the best way to solve the issue? Yes: restoring the read-only request at the shared cron owner-selection boundary is narrower and safer than adding downstream timing or discovery guards. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against d9d970240022. 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.
|
Related: #120834
What Problem This Solves
Fixes an issue where the first isolated scheduled agent turn after Gateway startup could materialize the full live model catalog during model selection. On a source checkout, that broad discovery path can transform thousands of plugin modules, block the event loop for tens of seconds, and add hundreds of megabytes of heap before the runner starts.
Observed evidence on an affected Gateway included consecutive 56.1s and 53.6s liveness delays, a 39.9s health RPC, and a scheduled turn timing out after 60s before runner start.
Why This Change Was Made
resolveCronModelSelectionOwnerlost its priorreadOnly: truecontract in #117587 when Gateway subagent binding was added. Without the flag,loadResolvedPublishedModelCatalogOwneris allowed to call the prepared snapshot'sloadFullModelCataloghook.This restores
readOnly: truewhile retainingallowGatewaySubagentBinding: true. Cron model selection now consumes the already-published configured catalog; the provider-scoped runtime-only thinking fallback added in #120834 remains unchanged.Production LOC: +1/-0 (net +1) | Tests: +33/-7
User Impact
Cold scheduled agent turns no longer trigger broad provider discovery during owner selection, so they cannot starve Gateway HTTP/RPC responsiveness or spike memory through that path.
Evidence
readOnly: true, and verifiesloadFullModelCatalogis never invoked.git diff --check, formatting, conflict-marker, dependency-pin, boundary, deprecated-API, wrapper-shadowing, dead-export, and related changed guards passed.main(@openclaw/session-url-contract/parsemissing, plus an unrelated terminal-core signature mismatch). Exact-head CI remains the typecheck authority.Provenance: clearly introduced by #117587 (code author/PR author/merger @steipete, 2026-08-01); #120834 repaired the sibling thinking-capability lookup but did not restore the owner lookup's read-only flag.