Skip to content

feat(cli): add -c/--continue alias and 'nothing to continue' notice - #1346

Open
shauryagangrade wants to merge 2 commits into
CodebuffAI:mainfrom
shauryagangrade:feat/continue-session-resume
Open

feat(cli): add -c/--continue alias and 'nothing to continue' notice#1346
shauryagangrade wants to merge 2 commits into
CodebuffAI:mainfrom
shauryagangrade:feat/continue-session-resume

Conversation

@shauryagangrade

Copy link
Copy Markdown

Summary

Implements part of the ask in #1338: freebuff -c (and the long form freebuff --continue) now resume an active session instead of wasting the remaining time when the CLI crashed, the terminal closed, or an update interrupted the previous run.

Changes

  • cli/src/cli-args.ts — added the -c short alias to --continue [conversation-id] (freebuff and codebuff parsers).
  • cli/src/index.tsx / cli/src/app.tsx — thread the raw continueRequested flag (distinct from history-pick resume) down to the landing screen.
  • cli/src/components/freebuff-landing-screen.tsx — when --continue was requested but the session probe finds no active seat to resume (none, expired, or explicitly ended), the landing screen now clearly says there is nothing to continue. Rows are accounted for in the picker's height budget.
  • Tests for flag parsing (cli-args.test.ts) and the notice render (freebuff-nothing-to-continue.test.tsx).

Resume behavior

The actual session resume relies on the existing free session infra: on startup the probe auto-takes over the server seat when the prior local process is dead (the crash/terminal-close/update case), which preserves the server session and its remaining time, while --continue restores the previous conversation state. When the seat is held by a live process, the existing "Take over" confirmation is shown rather than silently superseding it.

Verification

  • New + adjacent tests pass; full cli suite has no new failures (the 21 failures/19 errors are pre-existing at HEAD: missing private packages/internal env + release-wrapper checks).
  • Typecheck clean for the touched files (only pre-existing tar/react-dom/server declaration errors remain).

Closes #1338

Add the -c short flag for --continue and surface a clear "nothing to
continue" notice on the landing screen when a session resume is requested
but no active session exists. The underlying resume path (auto-takeover of
a dead local process's seat plus conversation restore) already preserves the
server session and its remaining time.
@shauryagangrade

Copy link
Copy Markdown
Author

This implements the resume-an-active-session flow for freebuff -c / freebuff --continue described in #1338. Would appreciate a review from the maintainers who know the free session lifecycle best.

  • -c short flag added for --continue
  • Landing screen now clearly says there is nothing to continue when a resume is requested but no active session exists
  • Session resume itself relies on the existing auto-takeover + conversation-restore paths

@jahooma @charleslien @brandonkachen — could one of you take a look?

@codebuff-team

Copy link
Copy Markdown
Contributor

Good bones: the -c alias in cli-args.ts is a one-line, low-risk change, and the new FreebuffNothingToContinueNotice component plus its render/flag-parsing tests are genuine, useful additions that close a real UX gap (silently landing on the picker after --continue fails to find a session is confusing).

A few things worth tightening before this gets ported:

  1. The title/body claim this "resumes an active session," but per your own writeup the actual resume/seat-takeover logic already existed. The real diff is: add -c alias, thread a continueRequested boolean through index.tsxapp.tsxfreebuff-landing-screen.tsx, and render a notice when landing with that flag set. Worth retitling so reviewers on the private side know what's actually new vs. pre-existing.

  2. In index.tsx you pass both continueChat={continueChat} and continueRequested={continueChat} — identical values at the call site. The distinction ('raw flag' vs. 'effective/folded value') only becomes meaningful inside app.tsx where effectiveContinueChat is computed elsewhere (not shown in this diff). That's fine, but it's not obvious from this PR alone that the two props ever diverge — a comment at the index.tsx call site referencing where effectiveContinueChat gets combined would help a reviewer trust the plumbing.

  3. No check that -c doesn't collide with an existing single-letter flag in either the freebuff or codebuff commander configs — worth confirming there's no -c already claimed (e.g. --cwd) since commander won't warn cleanly on some conflicts.

  4. The notice's correctness depends on isLanding truly meaning "no session was resumed," which seems right by construction (a successful resume wouldn't render the landing screen at all), but that invariant isn't asserted anywhere in tests.

Overall: reasonable, scoped, and testable — worth a maintainer look, with the framing/title corrected.

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree labels Sep 13, 2026
@shauryagangrade shauryagangrade changed the title feat(cli): add freebuff -c/--continue to resume an active session feat(cli): add -c/--continue alias and 'nothing to continue' notice Sep 13, 2026
@shauryagangrade

Copy link
Copy Markdown
Author

Addressed the review feedback:

  1. Retitled the PR to feat(cli): add -c/--continue alias and 'nothing to continue' notice — the resume logic was pre-existing, so the title now reflects the actual new surface (-c alias, continueRequested plumbing, notice).

  2. Call-site comment at cli/src/index.tsx:381continueRequested is the raw CLI flag and diverges from continueChat once app.tsx folds in a history-pick resume via effectiveContinueChat = continueChat || resumeChatId !== null.

  3. -c collision check — confirmed there is no conflict with an existing short flag in either the freebuff or codebuff commander configs (-v/version, -h/help are the only other shorts; --cwd has none).

  4. Pinned the isLanding invariant — extracted shouldShowContinueNotice (gates on session?.status === 'none') and used it in both the render and the row-budget math. New tests assert the notice never shows for any resumed/non-none session (active, takeover_prompt, ended, superseded, consent_required), a null still-probing session, or a missing flag.

Typecheck is clean (only pre-existing react-dom/server / tar errors remain) and the full touched test suite passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "freebuff -c" / "freebuff --continue" to resume an active session

2 participants