Skip to content

feat(resume): bare path resume — cross-harness session picker - #154

Open
od0 wants to merge 1 commit into
bryan/listing-cachefrom
bryan/bare-resume
Open

feat(resume): bare path resume — cross-harness session picker#154
od0 wants to merge 1 commit into
bryan/listing-cachefrom
bryan/bare-resume

Conversation

@od0

@od0 od0 commented Aug 4, 2026

Copy link
Copy Markdown

Closes #110. Top of the picker-performance stack (#156#157#159 → this) — one squashed feature commit whose tree is byte-identical to the build validated in dogfooding.

path resume with no argument opens a recency-first cross-harness session picker: the newest 100 sessions from every installed harness, ranked cwd-matches-first then newest, hydrated in milliseconds regardless of history size. Picking a session derives it (write-through cache, mirroring share), runs the harness picker (source pre-selected), projects, and execs.

Surface

Invocation Behavior
path resume <input> Unchanged.
path resume (TTY) Recency picker → derive (cache fast-path) → harness picker → project → exec.
path resume (no TTY) no input provided and no TTY for interactive selection; …
path resume --harness X --harness stays the target, validated before the picker; harness picker skipped.
path resume --from Y Session picker filtered to source harness Y (filter-aware empty message).
path resume --project P Full sweep filtered to project P (its matches may be arbitrarily old).

A tail row — … N older sessions — load everything — runs the full sweep on demand.

How the picker stays fast

Codex candidates rank stat-only by mtime; each of the top 100 hydrates from the listing cache on a stamp hit (instant, message count included) or via one streaming read that's cached thereafter. Claude/opencode use the cache-backed collectors. Measured end-to-end on a 3.9 GB codex tree + 455-session claude project: first run ~2.3 s, then 0.03 s warm.

Design notes

  • Cache policy deviates from the issue sketch (which proposed opt-in --cache): write-through by default mirrors share, keeps --no-cache meaning one thing everywhere, and feeds the freshness fast path plus later share/query/sync.
  • A scoped-to-current-project-first design was built and reverted (history + spec addendum retained): it hid other projects behind an extra step, when recency + cwd-first ranking already surfaces the right rows.
  • New SessionPicker seam (mirrors ExecStrategy) makes the whole pipeline headless-testable — FixedPicker (with multi-round sequences) + RecordingExec drive 12 bare-mode integration tests with zero TTY.
  • toolpath-codex 0.6.3 adds peek_metadata (O(1) head+tail, count-free) and factors the shared HeadHunt used by both metadata paths.

Rebase notes

Validated by heavy dogfooding on real multi-gigabyte trees (this PR's picker is how its own review sessions get resumed).

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://2dc0742a.toolpath.pages.dev

@od0

od0 commented Aug 4, 2026

Copy link
Copy Markdown
Author

Dogfooding note: the first bare path resume on a large ~/.codex/sessions tree stalled ~80 s in the pre-picker gather. Two follow-ups landed: a "Gathering sessions..." stderr hint on this branch (7e28f07), and the actual fix — streaming codex metadata — split out as #156 since it equally benefits share and p list codex. Not a hard dependency; this PR works without it, just slowly on multi-GB codex trees.

…n picker

Closes #110. With no <input>, resume opens a picker over the newest
100 sessions from every installed harness (ranked cwd-first then
newest), derives the pick (write-through cache with the freshness fast
path, mirroring share), then flows into the existing harness-picker ->
project -> exec pipeline. A tail row (N older sessions — load
everything) runs the full sweep; --from narrows the source harness;
--project always sweeps fully. Codex candidates rank stat-only and
hydrate from the listing cache (counts included) or one cached
streaming read. New SessionPicker seam (FixedPicker sequences +
RecordingExec) drives 12 bare-mode integration tests headlessly.
A scoped-to-project-first variant was built and reverted during
dogfooding — see the spec addendum.

path-cli 0.17.0; toolpath-codex 0.6.3 (peek_metadata + HeadHunt
refactor).
@od0
od0 force-pushed the bryan/bare-resume branch from 3eb2ed8 to 1524adf Compare August 4, 2026 17:55
@od0
od0 changed the base branch from bryan/parallel-gather to bryan/listing-cache August 4, 2026 17:55
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.

Support bare path resume with interactive session picker

2 participants