Repository navigation
perf(cron): reuse the selected partition for prompt scratch - #180816
Conversation
Carry the Gateway-owned cron partition through scheduled run preparation, keeping the standalone configuration fallback. Avoid the runtime MAIN database lookup without confusing the session store with the cron store.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Keep the selected cron partition separate from the service parameter surface. Co-authored-by: Jason (Json) <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesThis PR carries the Gateway-selected cron partition into automation prompt preparation instead of selecting it again. Example: Job scratch-owner has scratch revision 2 containing updated scratch.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR removes a redundant main-thread partition lookup through the existing cron owner, with no actionable correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway cron service selects a job partition and dispatches scheduled runs; preparation reads that partition's current scratch through the existing worker and appends it to the agent prompt. flowchart TD
A[Gateway partition selection] --> B[Cron service]
B --> C[Scheduled job runner]
C --> D[Automation prompt preparation]
E[Standalone configuration selection] --> D
D --> F[Scratch read worker]
F --> G[Agent prompt]
Technical reviewBest possible solution: Reuse the cron service's selected partition while keeping scratch freshness and standalone selection with their existing owners. Do we have a high-confidence way to reproduce the issue? Current-main prompt preparation reaches the synchronous machine-state partition reader; the committed regression targets that path, and the PR reports its base failure without this review executing code. Is this the best way to solve the issue? This is the smallest complete fix: carry the already-selected partition through existing owners, keep the session store separate, and preserve the standalone fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 71bbd18bb2a9. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +38. Total +43 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 1:51 PM ET / 17:51 UTC. |
…#180816) Reuse the Gateway-selected cron partition during isolated automation prompt preparation, keeping session storage separate and preserving standalone config selection. Removes one runtime MAIN SQL lookup per cron turn. Co-authored-by: Jason (Json) <[email protected]>
What Problem This Solves
Scheduled automation prompt preparation reselects the cron partition synchronously even though the Gateway already selected and owns it.
User Impact
Gateway cron turns avoid a runtime MAIN-thread database lookup. Scratch contents, partition selection, standalone callers, and session storage behavior are preserved. No migration or configuration change is required.
Why This Change Was Made
Carry the selected cron store through the existing job runner and preparation request as
cronStorePath. It remains distinct from the sessionstorePath. Standalone callers retain their configuration-based selection. This removes a repeated lookup without adding a cache, generation, schema change, transaction, or authority check.Evidence
d2c70ddbf19: cron 242 SQL / 64 requests / 1 MAIN; warm median 45 [45–48] / 11 [11–12] / 0. Measured cron: 242/64/1 → 242/64/0; the removed MAIN lookup is offset by one unrelated background statement. Warm causal counts remain 45 [45–48] / 11 [11–12] / 0. Whole workload 2934/798/98 → 2939/801/96. The single frozen pair passed 14 turns, cron, shutdown and restart. No aggregate or latency savings claim.Concurrent Work
Natural merge checks are clean against #178965 (
35ae687) and #178904 (5570f12). Draft heads #179011 (ffc0372), #179062 (941c2b0) and #179669 (3b24d61) have exactly the same 17 conflicts with both the unchanged base and this head, all outside this PR's edited files. The coordinator accepted these inherited conflicts. Additional main-targeted PRs #156667, #152243, #141018, #172601, #173953 and #175678 have unchanged conflict sets against the base and corrected head. Their existing conflict blocks are unchanged except for the expected addedstorePathargument inside #152243’s broadserver-cron.tsblock; no Workshop logic changed. The release-branch backport #180270 is excluded from the main-branch fence.Credit: builds on the scheduled-command runner by Jason (Json), @fuller-stack-dev. Preserve this human credit in the squash commit:
Co-authored-by: Jason (Json) [email protected]