Skip to content

Give each cron run its own session, worktree, and inbox timeline#184

Merged
LIU9293 merged 1 commit intomainfrom
feat/cron-isolated-timelines-187919
Apr 18, 2026
Merged

Give each cron run its own session, worktree, and inbox timeline#184
LIU9293 merged 1 commit intomainfrom
feat/cron-isolated-timelines-187919

Conversation

@LIU9293
Copy link
Copy Markdown
Contributor

@LIU9293 LIU9293 commented Apr 18, 2026

Summary

  • Cron runs previously all shared one threadId (cron-job:{jobId}), so every execution collapsed into a single inbox thread and reused the same OpenCode session + worktree.
  • Incorporate a per-run id (minute-aligned for scheduler, Date.now() for manual triggers) into the threadId, session key, and worktreeId so each run produces a fresh inbox timeline, a brand-new session, and an independent working directory.
  • Keep the cron user id stable (cron-job:{jobId}) so the inbox UI can still group runs by cron job via cronJobId on the thread row.

Notes

  • Older shared cron timelines remain untouched in the database.
  • No schema changes; message_thread rows are naturally keyed by the new unique threadId.
  • bun test packages/core/cron/ packages/config/local/inbox.test.ts passes.

Cron runs previously all shared a single threadId (cron-job:{jobId}),
collapsing every execution into one inbox thread and reusing the same
OpenCode session and worktree. Incorporate a per-run id into the
threadId, session key, and worktreeId so each run is fully isolated
with a fresh timeline and working directory.
@LIU9293 LIU9293 merged commit 4899530 into main Apr 18, 2026
2 checks passed
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