Repository navigation
fix(cron): wait for busy conversations before scheduled checks - #197774
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. |
1605ce2 to
23f1adf
Compare
23f1adf to
baa105a
Compare
|
Codex review: needs maintainer review before merge. What this changesMakes scheduled jobs targeting an existing conversation wait until it is idle even without a captured operator source. Example: A source-less one-shot targets session:agent:main:busy-conversation while that conversation has an active turn.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-confirmed scheduling gap with a focused change, and no introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway scheduler submits due jobs to the existing durable cron queue; session readiness controls admission before condition evaluation and session-event execution. flowchart TD
A[Due cron job] --> B[Session target resolver]
B --> C[Conversation readiness]
C --> D[Durable cron queue]
D --> E[Condition evaluation]
D --> F[Session event execution]
E --> F
Technical reviewBest possible solution: Keep the shared target-based ordering change within the existing queue and launch owners. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows source-less jobs bypassing both conversation-aware queue admission and launch waiting; this read-only review ran no target code. Is this the best way to solve the issue? Removing the operator-source prerequisite is the smallest complete repair: session targeting determines ordering, while existing execution owners retain authority checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 925d17a2e35e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1, Tests +50, Docs +1. Total +50 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 12, 2026, 10:00 AM ET / 15:00 UTC. |
What Problem This Solves
Fixes: a scheduled check targeting a busy conversation can start before that conversation finishes when the job has no captured operator source.
User Impact
User impact:
session:<key>jobs wait for the target conversation before starting, regardless of how they were created. This changes queue ordering; it does not grant system-started turns automation management authority.Why This Change Was Made
The scheduler used the presence of an operator source to decide whether a
session:job waits. The target session itself owns that ordering decision. The same queue path now handles jobs with and without captured operator sources.Evidence
git diff --checkpassed; formatting passed with the pinnedoxfmt0.74.0.Production delta: 2 added, 3 removed lines. Test delta: 75 added, 25 removed lines. No config, schema, protocol, or permission change.
Review follow-up
ClawSweeper reviewed
baa105a00fe6with no findings or required pre-merge work. Its optional rank-up move asks for a real Gateway demonstration. I am leaving that as follow-up: Testbox refused this sparse checkout before execution, and the retained live incident record has only a generic error. The in-process regression and exact-head CI cover the queue ordering change without claiming the old incident is explained.