Skip to content

fix(desktop): harden automation timezone and restart recovery - #269

Draft
wangtsiao wants to merge 1 commit into
7df-lab:mainfrom
wangtsiao:fix/desktop-automation-reliability
Draft

wangtsiao wants to merge 1 commit into
7df-lab:mainfrom
wangtsiao:fix/desktop-automation-reliability

Conversation

@wangtsiao

Copy link
Copy Markdown
Contributor

Summary

First bounded slice toward reliable long-running automation, not a daemon/24×7 claim.

  • Honor the saved IANA timezone in scheduler and creation preview, independent of host zone. Share calendar calculation and explicit DST policy: skip nonexistent times, run repeated times once at the earlier instant.
  • Bound timer delays to 60-second checkpoints to prevent Node's ~24.8-day timeout overflow, recheck clock after sleep/clock changes, and invalidate asynchronous scheduling after pause/remove/replace/stop.
  • Prevent overlapping scheduled callbacks after replacement and retain interval anchors for the current process lifetime.
  • Recover old queued/running SQLite records transactionally as failed with an explicit outcome-unknown message, preserve session/worktree evidence, and never automatically replay uncertain work. Gate API admission on one startup recovery and reject work after quit.
  • Document actual close versus quit behavior, missed-occurrence policy, known limits and a five-stage Native daemon/attach, durable-lease, supervision and soak-test roadmap in docs/desktop-automation-lifecycle.md.

Verification

  • 20 new targeted tests, including calendar/DST, long timers, cancellation races, sleep catch-up, replacement overlap, SQLite recovery and startup/quit admission.
  • Full Desktop suite: 946 pass, 1 existing macOS tray skip, 0 fail (Bun 1.4.4, writable temporary XDG_CONFIG_HOME).
  • TypeScript tsc --noEmit: pass.
  • electron-vite build: pass.
  • Calendar suite also passes in a separate TZ=America/Los_Angeles process.
  • New modules pass Biome checks; git diff --check: pass.
  • Initial full-suite attempt hit the existing backup test's read-only home-directory limitation; setting XDG_CONFIG_HOME for the test process resolved it without source changes.

Boundaries / follow-up

Electron must still be running. Explicit Quit stops local execution. No daemon installation, durable lease/exactly-once guarantee, manual Run-now deduplication, automatic replay of interrupted runs, or persisted interval phase across restarts is claimed. Packaged OS sleep/wake, logout/reboot and multi-day soak tests remain necessary. No Rust/subagent runtime or Desktop queue files are changed. Draft for review; do not merge automatically.

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