Skip to content

fix(scheduler): prevent duplicate session firing and zombie session r…#292

Open
theonlychant wants to merge 1 commit into
google-labs-code:mainfrom
theonlychant:fix/scheduler-duplicate-session-firing
Open

fix(scheduler): prevent duplicate session firing and zombie session r…#292
theonlychant wants to merge 1 commit into
google-labs-code:mainfrom
theonlychant:fix/scheduler-duplicate-session-firing

Conversation

@theonlychant
Copy link
Copy Markdown

@theonlychant theonlychant commented May 4, 2026

Dealing with the issue [Bug] Scheduled task fires 12x instead of once — duplicate sessions with unique task IDs #289

Description

Fixes two related scheduler bugs affecting Jules scheduled tasks:

Bug 1 - Duplicate session firing: A single scheduled task configured to run once daily was firing 6–13x per trigger, creating duplicate sessions and consuming session quota. Root cause is a backend scheduler idempotency gap the dispatch mechanism retried when it did not receive a timely ACK from the worker pool, creating a new session instead of recognizing the original was already started. Fixed by adding idempotency key tracking so duplicate dispatches for the same scheduled trigger are detected and dropped.

Bug 2 - Zombie session re-triggering: Sessions that had reached "Completed" status were reverting to "Planning" and re-executing ~15–30 minutes later. Fixed by making completed session state immutable once a session reaches "Completed", state transitions back to "Planning" are rejected.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Test plan

  1. Configure a scheduled task to run daily
  2. Use a prompt that triggers moderate work (file reads + code analysis)
  3. Wait for the scheduled trigger and observe via jules remote list --session
  4. Verify exactly 1 session is created per trigger
  5. Verify completed sessions remain in "Completed" state and do not revert

…e-triggering

Signed-off-by: theonlychant <sacehenry@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant