fix(dreamer): advance last_run_at from run start, not completion - #463
Open
TreedsSlop wants to merge 1 commit into
Open
TreedsSlop wants to merge 1 commit into
TreedsSlop wants to merge 1 commit into
Conversation
last_run_at is the cutoff the "changed since" gates compare against the timestamps of the input they govern (maintain-docs: compartments since the last run). advanceAfterRun wrote the run's COMPLETION time, so a message or compartment that arrived during the run was older than the new cutoff and was silently skipped on the next slot. Record the run's start instead: input that lands mid-run is newer than the cutoff and re-triggers the gate next slot (at-least-once).
There was a problem hiding this comment.
No issues found across 3 files
You’re at about 94% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
TreedsSlop
force-pushed
the
dreamer-last-run-start
branch
from
September 18, 2026 01:06
e4e2863 to
3bf683c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
last_run_at is the cutoff the "changed since" gates compare against the timestamps of the input they govern (maintain-docs: compartments since the last run). advanceAfterRun wrote the run's COMPLETION time, so a message or compartment that arrived during the run was older than the new cutoff and was silently skipped on the next slot.
Record the run's start instead: input that lands mid-run is newer than the cutoff and re-triggers the gate next slot (at-least-once).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes
last_run_atadvancement in the dreamer scheduler so input that arrives mid-run re-triggers the "changed since" gates next slot instead of being silently skipped.nextDueAtstill advances from completion.Written for commit 3bf683c. Summary will update on new commits.
The PR appears safe to merge, with no outstanding correctness, security, or repository-rule issues identified.
Summary
Updates Dreamer scheduling bookkeeping so successful tasks record their start time as
last_run_at, preserving at-least-once processing for inputs that arrive while a task is running.next_due_atfrom completion time.Diagram
sequenceDiagram participant S as Scheduler participant E as Executor participant DB as Schedule State S->>S: Record startedAt S->>E: Execute due task Note over E: New input may arrive during execution E-->>S: Completed S->>DB: "last_run_at = startedAt" S->>DB: "next_due_at = schedule from finishedAt" Note over DB: Mid-run input remains newer than cutoffReviews (2) · Last reviewed commit: "fix(dreamer): advance last_run_at from r..."