Skip to content

fix(scheduler): preserve catch-up and retry overdue work - #6855

Merged
M4n5ter merged 3 commits into
apache:rust-previewfrom
kesonm:sklil/fix-rust-scheduler-6827
Nov 13, 2026
Merged

M4n5ter merged 3 commits into
apache:rust-previewfrom
kesonm:sklil/fix-rust-scheduler-6827

Conversation

@kesonm

@kesonm kesonm commented Nov 13, 2026

Copy link
Copy Markdown

Summary

Fixes #6827 on rust-preview.

  • Preserve overdue triggers when resuming with Misfire::Latest, including one-shot tasks. A trigger due exactly at resume time remains claimable; pending fires retain their identity.
  • Select the next timer using the same cutoff used to load ready tasks, so a deadline crossed during a tick causes an immediate next pass instead of losing its wake.
  • Reconcile scheduler errors with exponential retry delays from 1 to 30 seconds, without postponing earlier scheduled deadlines or replacing the original pending fire.

Verification

Tested on macOS 26.5.2, Rust 1.99.1, based on 7d572089b. The locally installed development build contains this patch.

  • cargo test --locked -p maka-scheduler --lib: 8 passed. The new overdue-resume regressions also failed against the original policy source in an isolated harness.
  • cargo test --locked -p maka-agent-native --lib scheduler::: 2 passed, covering deadline crossing and bounded retry wakes. Deadline crossing is a deterministic unit test, not a desktop timing reproduction.
  • Built the producer_reopen test executable and ran its scheduler_ cases with runtime CARGO_BIN_EXE_maka pointing to the installed fixed binary: 3 passed, 0 failed, 54.55 seconds:
scheduler_resumes_overdue_latest_reminders_through_public_host ... ok
scheduler_retries_original_fire_when_workspace_returns_without_host_mutation ... ok
scheduler_user_approved_due_fire_fails_original_run_without_redispatch_after_reopen ... ok

The retry test temporarily moves an isolated workspace directory, observes an unexecuted pending fire, restores the same directory without a Host mutation, and verifies automatic admission with the original fire ID. It also exercises cold-reopen deduplication. Tests use temporary data and a loopback model fixture, not production credentials.

  • just build: passed; installed app signature verification and desktop launch passed.
  • cargo fmt -p maka-scheduler -p maka-agent-native -p maka-cli --check, git diff --check, and node scripts/ci.mjs check licenses: passed.
  • Full just check and all reverse-dependent suites were not run locally; the focused tests above are the local evidence. A merge-tree check against rust-preview at d68c10f60 is conflict-free; the installed build was not rebased onto those later upstream changes.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex assisted with implementation, regression tests, local build and verification, and this description. The commit includes its Generated-by trailer.

Checklist

  • Tests cover the change and fail without it — original-source failure was verified for the resume regressions; a complete before/after run of every new test was not performed.
  • Format, typecheck and the affected suites pass locally — build, formatting and the focused tests above passed; full affected-suite coverage is left to CI.

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@M4n5ter
M4n5ter merged commit 73570d4 into apache:rust-preview Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants