Skip to content

feat(tui): add startup session picker - #225

Merged
alx-xo merged 5 commits into
mainfrom
alexm/tui-resume-picker
Sep 16, 2026
Merged

alx-xo merged 5 commits into
mainfrom
alexm/tui-resume-picker

Conversation

@alx-xo

@alx-xo alx-xo commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Open the existing workspace-scoped, newest-first session picker with kit tui --resume, preserving explicit-ID resume and ordinary startup.
  • Reuse selection and inline rename before creating a persisted session or launching the agent; handle cancellation, empty catalogs, and resume errors while retaining --force protections.
  • Keep cancellation active across catalog discovery and ACP startup; isolate read-only discovery so stalled reads cannot block shutdown or global storage recovery.
  • Update CLI help and documentation, with CLI, PTY, signal, and subprocess regression coverage.

Closes #219

Validation

  • Full mise run test -- -- --test-threads=1 passed with temporary HOME and Git configuration isolation.
  • mise run lint passed: formatting and Clippy with all features and no default features.
  • Startup picker PTY tests: 8 passed, including scoping, rename/error expiry, cancellation, disappearing sessions, and stale/live locks.
  • Subprocess tests verify stalled catalog cancellation, recovery, runtime teardown, and exit on SIGINT/SIGTERM/SIGHUP.
  • Independent final review: no actionable findings.
  • User manually tested the local build successfully before review follow-up fixes; follow-ups validated by automated tests and review.

Existing test-environment issues

The ordinary full-suite run reproduced four failures on clean baseline 735409e as well as this branch: two shell assertions polluted by a missing Atuin file in the local .profile, a file-search fixture affected by global Git ignores, and an existing parallel projection-queue test race. The complete suite passes with temporary empty HOME, temporary Git configuration explicitly setting core.excludesFile=/dev/null, and serial execution. No user configuration or unrelated tests were modified.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Startup cancellation can still hang on workspace canonicalization or an in-flight inline rename when filesystem I/O stalls.

Comment thread src/tui/startup.rs Outdated
Comment thread src/tui/startup.rs Outdated
Resolve workspace paths inside the isolated discovery worker so stalled
canonicalization cannot block signal handling or runtime teardown.
Use a portable raw pointer for the PTY window size on Linux and macOS.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inline rename can still prevent process exit after picker cancellation: its filesystem work runs in Tokio鈥檚 blocking pool, so stalled I/O keeps runtime teardown waiting even after the terminal is restored. This previously reported issue remains deferred; workspace-canonicalization cancellation is addressed.

Use a narrow footer fixture and wait for restored help instead of requiring an exact run of terminal clearing spaces.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The previously reported inline-rename shutdown issue remains: filesystem I/O stalled inside the rename's spawn_blocking task can keep Tokio runtime teardown waiting after picker cancellation. The shutdown-policy change is explicitly deferred, and the existing thread remains unresolved.

Isolate cancellable rename reads and preflight from recovery state.
Fence prepared replacements by revision before admitting writes.
Drain admitted commits after terminal restoration to preserve recovery.
kit-code-agent[bot]
kit-code-agent Bot previously approved these changes Sep 15, 2026

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found. The changes look good to merge.

Do not invalidate prepared renames on observational status reads or
provably idle recovery. Keep fencing for mutation and cleanup work.

Add a regression through the production recovery path and consolidate
redundant test scenarios, eliminating 27 process launches while keeping
distinct storage, shutdown, and terminal behavior assertions.
@alx-xo

alx-xo commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up in 724a9a0: fixed an interaction found during the full-branch review where idle background recovery invalidated prepared renames. Observational status reads and genuinely idle recovery now preserve the revision; mutations and cleanup still invalidate it. The production-path regression failed before the fix and passes afterward.

Also consolidated redundant signal/stall permutations and overlapping success/cancellation tests: 27 fewer explicit process launches, retaining all distinct storage and shutdown safety assertions. Full local macOS verification and Linux arm64 default/headless suites, lint, builds and smoke checks passed. Linux headless required one full retry after the previously observed concurrent projection-test failure; original failure logs were preserved. Independent fencing and coverage reviews found no actionable issues.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found. The changes look good to merge.

@alx-xo
alx-xo merged commit 5cae594 into main Sep 16, 2026
6 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.

feat(tui): open session picker with --resume when no ID is supplied

1 participant