Skip to content

feat: add --resume/--continue CLI session flags#682

Merged
will-lamerton merged 2 commits into
Nano-Collective:mainfrom
llupRisinglll:rc/session-resume-continue
Jul 20, 2026
Merged

feat: add --resume/--continue CLI session flags#682
will-lamerton merged 2 commits into
Nano-Collective:mainfrom
llupRisinglll:rc/session-resume-continue

Conversation

@llupRisinglll

@llupRisinglll llupRisinglll commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Description

  • Adds --continue / -c — resume the most recent session for the current directory (starts fresh with a notice if none exists).
  • Adds --resume [id] / -r [id] — resume a session by id, 1-based list index, or last; a bare --resume opens the session picker at startup. Both flags are interactive-only and mutually exclusive.
  • Sessions saved by the existing autosave are now reachable directly from the shell; --help text and docs updated.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

Automated Tests

  • New features include passing tests in .spec.ts/tsx files
  • All existing tests pass (pnpm test:all completes successfully)
  • Tests cover both success and error scenarios

25 new tests: 10 specs for resolveSession (source/session/resolve-session.spec.tslast, undefined-arg default, index resolution, raw uuid from another cwd, not-found, out-of-range index, empty scoped list, empty global list, the all option, and the digit-prefixed-uuid-vs-index case) and 15 specs for CLI flag parsing (source/cli.spec.ts — flag/shorthand detection, id capture, flag/run tokens not swallowed as ids, mutual exclusion, and non-interactive rejection).

Manual Testing

  • Tested with Ollama
  • Tested with OpenRouter
  • Tested with OpenAI-compatible API
  • Tested MCP integration (if applicable)

Used as a daily driver: --continue and --resume (bare, by index, by id, and last) exercised across real multi-day sessions, including the fresh-start path in a directory with no sessions and quit-then---continue round trips confirming the exit flush preserves the conversation tail.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)
  • Appropriate logging added using structured logging (see CONTRIBUTING.md)

--help text and examples updated for both flags. New surface area is additive only — running with neither flag is byte-identical to before, and pre-render failures use plain console.error + exit like the surrounding CLI validation code.

@akramcodez akramcodez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Excellent work on this PR. The implementation is clean, the user flow feels well thought out, and the test coverage is thorough.

One small request for future contributions: for features of this scope, please open a GitHub issue before starting implementation. It gives us a chance to discuss the design and expected behavior up front, keeps development aligned with the roadmap, and provides useful context for future contributors.

@llupRisinglll

Copy link
Copy Markdown
Contributor Author

@akramcodez

One small request for future contributions: for features of this scope, please open a GitHub issue before starting implementation. It gives us a chance to discuss the design and expected behavior up front, keeps development aligned with the roadmap, and provides useful context for future contributors.

Fair point on opening an issue first. In this case the changes were already built and incubating on my fork, where I use and test them daily, since I implemented them ahead of time for my own personal use. So there's no wasted effort to worry about here, even without a prior discussion.

That said, I'm open to feedback, and I'd prefer to have it on the PR itself. If the PR doesn't cleanly match the repo's goals or overlaps an existing one, that's fine by me. The changes I bring are things I already run daily, and if the community wants them, they can have them.

@will-lamerton

Copy link
Copy Markdown
Member

Hey @llupRisinglll - brilliant work :)

@will-lamerton
will-lamerton merged commit e513d27 into Nano-Collective:main Jul 20, 2026
10 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.

3 participants