Skip to content

Pick attach vs resume from actual session liveness when jumping into a session - #116

Merged
MJohnson459 merged 1 commit into
mainfrom
jump-in-liveness-verb
Aug 2, 2026
Merged

Pick attach vs resume from actual session liveness when jumping into a session#116
MJohnson459 merged 1 commit into
mainfrom
jump-in-liveness-verb

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

a on a review task whose claude --bg session was still resident failed with
the supervisor's refusal (Session <uuid> is currently running as a background agent), because jump_into_session read its verb from task state alone:
Running → attach, Review/Stalled → resume. Session liveness does not track
task state in either direction — a bg session commonly outlives running (the
operator jumps into a review task's session to ask for a rebase, DESIGN.md §8),
and a session can die while its task is still running, where attach has
nothing to join.

What changed

  • New crates/voro/src/session_probe.rs holds the run-and-parse of an
    agent's sessions verb, previously duplicated in reconcile.rs and
    dispatch.rs. run_sessions_command(cmd, cwd) and listing_says_live
    serve reconcile (which keeps its own per-agent listing cache) and dispatch's
    ref capture (which keeps its cwd/startedAt filtering); session_is_live
    serves a caller holding no listing. Liveness stays three-valued: None when
    there is no sessions verb, no captured ref, or the listing would not run.
  • jump_into_session probes on keypress — synchronous, since the TUI is
    about to hand the terminal over anyway — and picks the verb from the answer,
    falling back to the task-state mapping only when liveness is unknowable.
  • Verb availability is a further fallback: jump_verb takes whichever
    template the agent defines when its preferred one is absent (the built-in
    codex has only resume), and errors naming both verbs only when it
    defines neither.
  • The existing gates are untouched: jump-in is still offered only on
    running/review/stalled, and the no-session / no-ref status lines are as they
    were.

No DESIGN.md change: §8 already describes the operator attaching to a review
task's still-open session, which is what this makes possible.

Verification

cargo test --workspace and cargo clippy --workspace --all-targets -- -D warnings pass. The verb choice is a pure function with unit tests over the
liveness × state × available-verbs grid; the app-level jump-in tests now drive
a against a canned listing in each configuration — review + live → attach,
running + finished → resume, no sessions verb → state mapping unchanged,
one-verb agent → that verb, no verbs → both named in the message.

Also driven through the real TUI against a scratch database with a stub agent:
on a review task whose listing showed the session blocked, a logged
attach: echo I-AM-ATTACHING '<ref>' in launches.log; rewriting the listing
to state: done and pressing a again logged the resume command.

`a` on a review task whose `claude --bg` session was still resident failed:
jump-in read its verb from task state alone, and `claude --resume` refuses a
session the supervisor still holds. The two do not track each other — a bg
session commonly outlives `running` (DESIGN.md §8's stale-review rebase
attaches to a review task's session), and a session can die while its task is
still `running`, where `attach` has nothing to join.

Liveness now decides the verb wherever the agent can report it, and task state
stands in only when it cannot. The `sessions` run-and-parse step reconcile
owned moves to a `session_probe` module shared by all three callers —
reconcile, dispatch's ref capture, and the jump-in key — keeping liveness
three-valued, so an agent with no `sessions` verb behaves exactly as before.
The chosen verb then degrades to whichever template the agent actually defines
(the built-in codex has only `resume`), erroring only when it defines neither.

Verified with unit tests over the verb choice, app-level tests driving the key
against a canned listing in each configuration, and the TUI itself against a
scratch database: `a` on a review task logs `attach` while its session is
listed live, and `resume` once the listing marks it done.
@MJohnson459
MJohnson459 merged commit 76a4010 into main Aug 2, 2026
6 checks passed
@MJohnson459
MJohnson459 deleted the jump-in-liveness-verb branch August 2, 2026 20:50
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