Skip to content

feat(cli): /session interactive picker to resume a saved session#204

Merged
emal-avala merged 3 commits intomainfrom
feat/session-picker
Apr 23, 2026
Merged

feat(cli): /session interactive picker to resume a saved session#204
emal-avala merged 3 commits intomainfrom
feat/session-picker

Conversation

@emal-avala
Copy link
Copy Markdown
Member

@emal-avala emal-avala commented Apr 23, 2026

Summary

The existing /sessions lists session IDs; to resume one, the user has to copy-paste the full ID into /resume <id>. Painful with long IDs.

/session (singular) opens an arrow-key picker over the 20 most recent sessions. Enter resumes the selection; Esc/q leaves the current session untouched.

> /session
  › abc123  [dataset-cleanup]  #prod
    def456  [refactor-auth]
    ...

    cwd      /home/emal/AvalaBot/avala-7
    model    your-preferred-model
    turns    12
    updated  2026-04-23T01:12:05

Each option shows the ID + label + tags on the main line, cwd/turns/msgs/updated on the description, and cwd/model/turns/updated in the live preview panel below.

Why

Session IDs are long 36-character UUIDs. Typing or pasting them reliably is annoying. A picker turns a 10-second copy-paste into a 2-keystroke operation.

Implementation

  • Reuses existing ui::selector::select (the same helper that powers the setup wizard)
  • Reuses existing /resume code path for the actual load — no new logic for restoring messages, turn_count, model, cost
  • Alias /pick-session for discoverability

Test plan

  • cargo fmt --all — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test -p agent-code --test smoke — 4/4 pass
  • Manual: create 2 sessions, /session shows both; ↓↑ navigates; Enter resumes; Esc cancels

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread crates/cli/src/commands/mod.rs Fixed
@emal-avala emal-avala force-pushed the feat/session-picker branch from de4b81c to 8cf3650 Compare April 23, 2026 06:19
The existing `/sessions` lists IDs; to resume one, the user has to
copy-paste the ID into `/resume <id>`. Painful with long IDs.

`/session` (singular) opens an arrow-key picker over the 20 most
recent sessions. Enter resumes the selection; Esc/q leaves the
current session untouched.

Each option shows:
  id [label] #tags       (main line)
  cwd · turns · msgs · updated_at   (description)
  [live preview: cwd, model, turn count, updated_at]

Resume uses the same code path as /resume <id> — no new logic for
restoring messages / turn_count / model / cost.

Alias /pick-session for discoverability.
@emal-avala emal-avala force-pushed the feat/session-picker branch from 8cf3650 to f07e59f Compare April 23, 2026 07:06
The three resolve_editor_* tests mutate the global VISUAL/EDITOR env
vars and raced under Windows' parallel test runner. Add a per-module
Mutex so they run one at a time regardless of test thread count.
Comment thread crates/cli/src/commands/mod.rs Fixed
The error path already has the exception text; the id was redundant
(the user just saw it in the picker one line above). Dropping it also
side-steps a CodeQL false positive on the `rust/cleartext-logging`
rule which flags session identifiers as if they were auth secrets.
@emal-avala emal-avala merged commit 422feb9 into main Apr 23, 2026
14 checks passed
@emal-avala emal-avala deleted the feat/session-picker branch April 23, 2026 07:25
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.

2 participants