Skip to content

refactor(session): drop the run.json snapshot debounce - #1484

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-10776-drop-snapshot-debounce
Oct 17, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-10776-drop-snapshot-debounce

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Turn-boundary snapshots write running immediately; the 5s debounce and its flushes are gone.

Fixes CL-10776

@linear-code

linear-code Bot commented Oct 17, 2026

Copy link
Copy Markdown

CL-10776

@corbits-triage

corbits-triage Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Request changes

The timer is gone. Turn boundaries write running immediately, and rotation still writes done then running.

Findings

  • src/tui/runner/session.ts:179 — void persistRunSnapshot("running") does not catch a rejecting saveState. The debouncer used to. installCrashHandlers treats that rejection as fatal, so a mid-run snapshot IO error crashes the TUI. Exec already catches inside persist. Catch in persistRunSnapshot the same way, and add a test that this call does not surface unhandledRejection.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Request changes

The timer is gone. Turn boundaries write running immediately, and rotation still writes done then running.

Findings

  • src/tui/runner/session.ts:179 — void persistRunSnapshot("running") does not catch a rejecting saveState. The debouncer used to. installCrashHandlers treats that rejection as fatal, so a mid-run snapshot IO error crashes the TUI. Exec already catches inside persist. Catch in persistRunSnapshot the same way, and add a test that this call does not surface unhandledRejection.

@TheGreatAxios
TheGreatAxios changed the base branch from cl-10774-drop-snapshot-skip to main October 17, 2026 03:13

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Approve

The 5-second snapshot timer and its flushes are gone. Turn boundaries write running immediately. A failed saveState is logged and does not crash the process. Rotation still writes done, then running.

No findings.

@TheGreatAxios
TheGreatAxios merged commit ad064f9 into main Oct 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant