Skip to content

fix(cli): generate refuses --continue/--resume/--fork instead of ignoring them - #426

Merged
mrnasil merged 1 commit into
mainfrom
fix/generate-resume-flags
Nov 7, 2026
Merged

mrnasil merged 1 commit into
mainfrom
fix/generate-resume-flags

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 7, 2026

Copy link
Copy Markdown
Member

Found while measuring token use for the efficiency series (#418–#425).

Problem

--continue, --resume and --fork are global flags, so whycodes generate --continue "…" is accepted. But only the interactive run path reads them (resolve_resume_want in cmd/run.rs). generate always starts a new session, and that session is never saved to the database: after several generate runs, session list shows only the interactive sessions.

The caller therefore believes a continuation is running, while the model sees none of the earlier history and redoes the work.

Change

generate now fails up front with a setup error that names the flag:

generate runs a new session that is not saved, so --continue does not apply; continue a saved session with whycodes --plain --continue or in the TUI

The error is text on stderr, or a CiEvent::Error for --format json|stream-json, the same as the other headless setup errors. It returns before config or credentials are touched.

Saving generate sessions so they can be continued would be a product change (CI runs would fill the session list), so it is left out here.

Checks

  • New test cmd_generate_refuses_resume_flags_instead_of_ignoring_them covers all three flags.
  • whycodes-cli --bin whycodes: 399 passed. The 4 failures are the known Windows-only ones that fail identically on main (lockfile PIDs ×2, upgrade zip, run_shell).
  • fmt and clippy (cli) are ok.

🤖 Generated with Claude Code

…ring them

`--continue`, `--resume` and `--fork` are global flags, so `generate`
accepted them, but it never read them: it always ran a new session,
which it does not save, so the caller believed a continuation was
running while the model saw none of the earlier history.

`generate` now fails up front with a message that names the flag and
points at `whycodes --plain --continue` / the TUI (text or JSON error,
like the other setup errors).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil force-pushed the fix/generate-resume-flags branch from 603e8cc to eff81bd Compare November 7, 2026 14:20
@mrnasil
mrnasil merged commit 1797882 into main Nov 7, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/generate-resume-flags branch November 7, 2026 14:30
@mrnasil mrnasil mentioned this pull request Nov 7, 2026
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