Repository navigation
fix(cron): keep skill review reconciliation responsive - #149600
Conversation
Project weekly review eligibility from the selected manifest policy instead of re-entering provider activation planning for every agent. Yield monitor specifications incrementally through the existing serialized reconciliation so preparation yields between agents throughout the update pass. Preserve stored execution preferences, weekly schedules, job identity, per-row failure handling, and reconciliation authority guards. Refs #149538 Refs #148529
|
🦞👀 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 15, 2026, 10:57 PM ET / September 16, 2026, 02:57 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR prepares weekly skill-review jobs incrementally using existing plugin metadata, allowing Gateway requests to progress between agent updates. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair that is absent from the inspected main revision. No actionable introduced defect was found, and the recorded fleet measurements support the scoped responsiveness claim. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway reconciles configured agents into system-owned weekly Skill Workshop review jobs. Eligibility projection determines which jobs remain enabled, while the existing cron service owns persistence, scheduling, and execution. flowchart TD
A[Agent configuration] --> C[Project one review job]
B[Prepared plugin metadata] --> C
C --> D[Check runtime eligibility]
D --> E[Yield and check current authority]
E --> F[Persist enabled or disabled job]
E --> G[Serve Gateway requests]
F --> H[Remove stale review jobs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +20, Tests +136, Docs +2. Total +158 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep incremental preparation within the existing reconciliation owner, preserving cron identity and admission while broader fleet-startup bottlenecks remain separately tracked. Do we have a high-confidence way to reproduce the issue? Yes: source exposes eager fleet projection and repeated provider planning, and the recorded before/after Gateway run demonstrates the scoped failure. This review did not execute a new reproduction. Is this the best way to solve the issue? Yes: the patch uses existing prepared-metadata and serialized reconciliation contracts without adding a competing cache, configuration option, or persistence format. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7b4fbc2f4b68. 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)
|
holny
left a comment
There was a problem hiding this comment.
Checked the iterable migration across the tree: both production callers are shape-safe now — claws-monitors.ts spreads the specs, server-cron-skill-review-jobs.ts iterates — and nothing else consumes the resolver's return as an array, so the lazy projection can't strand a .map/.length caller.
The retained.delete(spec.agentId) placement is load-bearing: deleting before cron.add means a failed add leaves the agent out of retained, so its existing job survives the removal pass instead of being torn down right after a failed add. That matches the previous desired behavior, but the ordering is now the contract — worth a one-line comment there so the next reader doesn't move it after the try block.
The spy on isPluginProvidersLoadInFlight in the new responsiveness test pins the expensive path well; it fails loudly if the projection ever reaches provider load planning again.
|
Merged via squash.
|
Project weekly review eligibility from the selected manifest policy instead of re-entering provider activation planning for every agent. Yield monitor specifications incrementally through the existing serialized reconciliation so preparation yields between agents throughout the update pass. Preserve stored execution preferences, weekly schedules, job identity, per-row failure handling, and reconciliation authority guards. Refs openclaw#149538 Refs openclaw#148529
Refs #149538
Refs #148529
What Problem This Solves
Large agent fleets can stop answering Gateway health requests after readiness while weekly skill-review jobs reconcile.
User Impact
Weekly review eligibility is projected from prepared policy, one agent at a time, while the Gateway can service requests between updates. Existing schedules, job identities, stored execution preferences, and runtime admission remain unchanged. Existing installations need no configuration or database migration.
This addresses review reconciliation; the separate plugin-registration, model-runtime, and chat-metadata startup blocks remain outside this change.
Why This Change Was Made
Static monitor eligibility called the general fallback resolver without a captured manifest view. Its cache preflight entered provider load planning and repeatedly scanned the fleet's configured runtimes. The monitor now carries the selected manifest policy through static model resolution, including aliases and fallback candidates, without runtime normalization.
The specification array is replaced with incremental iteration through the existing serialized reconciliation. Duplicate cleanup, per-row error handling, authority checks, and stale cleanup retain their order. The existing retained-job map identifies stale rows, replacing the separate desired-agent set.
The production delta is +20 lines: the added capability is incremental static projection with explicit prepared-policy inputs across the existing selectors. No parallel cache or compatibility wrapper is added. Test delta is +136 lines; docs +2.
Evidence
The two new boundary regressions fail on the original implementation and pass after the repair. They reject provider-load planning from monitor projection and verify that a real
/healthrequest succeeds while the first committed row is held, before the remaining fleet is projected. Final persisted rows retain an ineligible agent's disabled monitor and both eligible siblings.node scripts/check-changed.mjs: passed, including core/test typechecks, lint, database guards, and import-cycle checks.pnpm build: passed on the exact candidate commit.git diff --check: passed.origin/main, through P1: scoped-clean.200-agent measurement
Both arms use Node 24.21.0 on macOS, isolated retained state, separate workspaces and current-schema databases, 54 synthetic configured models per agent, twelve enabled bundled plugins (six activated), no channels, and a loopback listener. The Gateway runs built
dist/entry.jswith a 2560 MiB old-space cap. An external probe requests/healthevery second with a five-second deadline; an in-process timer samples event-loop delay. The post-ready window is 90 seconds.431f7748b548)cafcc973b684)/healthanswered/totalCPU figures come from V8 samples in
reconcileSkillCollectionReviewJobs; they exclude awaited I/O and are not wall-clock phase durations. These measurements establish this owner-level improvement, not a whole-startup latency or memory guarantee. Other startup bottlenecks remain visible in the rig.Exact rig commands from the checkout:
The synthetic generator uses the real shared-state and agent database bootstrap APIs. Generator, probe driver, raw traces, and profiles remain task-local under
.local/fleet-serve/; they are not committed as product code. The before and after commands run against their respective built revisions.600-agent progress
The progress arm, started after the PR was marked ready, used 600 agents on
cafcc973b684and stopped at its 30-minute observation limit before Gateway readiness. The listener bound at 855.244 s; 0/945 health probes answered before the cutoff. Failures were 127 five-second deadlines, 646 connection resets, and 172 broken pipes. Peak RSS was 3243.1 MiB.Model-runtime preparation remained unfinished for at least 789.576 s after its nested model-auth span. The independent timer was silent for at least 944.850 s. Chat metadata and this PR's post-ready reconciliation were not reached, so this arm does not establish 600-agent recovery.
The rig requested SIGTERM at the observation limit, then force-stopped only its isolated process after 30 seconds without settlement. This was a rig-initiated SIGKILL, not an observed OOM. Thirty additional failed probes during teardown are excluded from the 0/945 observation count.
Nested trace histograms can report zero before a blocked timer samples; the independent timer silence and external HTTP failures remain the starvation evidence. The unfinished model-runtime duration is a lower bound.
Related work: #149314 owns the activation/metadata fingerprint path and is left untouched. #141018 changes weekly review reasoning; this patch preserves the existing payload behavior.
Synthetic rig source (saved under .local/fleet-serve)
seed.mts
run.mjs
sampler.mjs
profile.mjs
summarize.mjs
profile-summary.mjs