Repository navigation
fix(gateway): keep health responsive during context cache warmup - #119562
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 5:37 AM ET / 09:37 UTC. ClawSweeper reviewWhat this changesThe PR makes post-ready context-window cache warming reuse the Gateway’s published model-catalog owner instead of constructing a config-keyed fallback owner. Merge readinessKeep open. The patch addresses a reproduced P1 Gateway responsiveness defect with a lifecycle-owner reuse path; no actionable correctness or security finding was found. It is maintainer-authored and still awaiting completion of exact-head checks. Priority: P1 Review scores
Verification
How this fits togetherAfter Gateway readiness, an optional idle task warms model context-window metadata. It should consume the already-published catalog without delaying health, readiness, RPC, or channel traffic. flowchart LR
A[Gateway startup] --> B[Published model catalog]
A --> C[Gateway ready]
C --> D[Idle warmup scheduler]
D --> E[Reuse published catalog]
E --> F[Context-window cache]
C --> G[Health, RPC, and channels]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +67, Tests +66. Total +133 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep request-time catalog loading exact and use the already-published Gateway catalog only for optional post-ready warming, then validate the exact head before merge. Do we have a high-confidence way to reproduce the issue? Yes. The PR documents a current-main real Gateway reproduction with a large synthetic catalog and measured multi-second health, readiness, and RPC delays. Is this the best way to solve the issue? Yes. Reusing the lifecycle-published catalog is narrower than removing cache warming or redesigning the cache scheduler, while preserving exact request-time loading. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c02e39345bf6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Closes #119375
What Problem This Solves
Fixes an issue where a ready Gateway could delay health, readiness, RPC, and channel work while optional post-ready context-window cache warming processed a large model catalog.
Why This Change Was Made
The post-ready warmup now reuses the Gateway-published prepared catalog owner and its committed config generation. This avoids constructing a read-only fallback owner that hashes the full model configuration, while preserving exact request-time loading, cache generation checks, and shutdown cancellation.
This is intentionally separate from #119377, which removed the sibling provider session-catalog prewarm. Fresh canonical main remained red for the context-window cache path after that merge.
User Impact
Operators can expect health, readiness, and Gateway RPC activity to remain responsive during optional context cache warming, while model context-window metadata still converges to the configured values.
Evidence
28e788b71b551785c9eccb56b9232c40ce877bfc: Blacksmith Testbox leasetbx_01kz8ktc8gtxsh1s3smj8qbb40, run https://github.com/openclaw/openclaw/actions/runs/30993141380, same real Gateway fixture and observation point. Context warmup took 397.4 ms; health/readiness/RPC p99 were 59.04/58.90/53.84 ms with zero errors; metadata returned 128000/64000.git diff --check.No config, protocol, storage, or public API surface changes.
AI-assisted: yes. I understand the change and verified the lifecycle owner, request-time fallback, generation, cancellation, and sibling startup paths.