Skip to content

fix(init): --resume skips the interactive questionnaire (#2098) - #2106

Merged
RaghavChamadiya merged 2 commits into
repowise-dev:mainfrom
sloemo01:fix/init-resume-skips-questionnaire
Sep 11, 2026
Merged

fix(init): --resume skips the interactive questionnaire (#2098)#2106
RaghavChamadiya merged 2 commits into
repowise-dev:mainfrom
sloemo01:fix/init-resume-skips-questionnaire

Conversation

@sloemo01

@sloemo01 sloemo01 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

Fixes #2098. repowise init --resume on a TTY re-ran the entire interactive questionnaire — banner, scan, mode menu, provider, embedder, style — indistinguishable from a fresh run, and a user who answered differently resumed under a different provider/style than the pages on disk were written with.

Root cause

is_interactive at init_cmd/command.py:951 never excluded --resume, so the flag had no effect on whether the prompts ran. The prior run's answers were already on disk (config.yaml), which the non-interactive path reads.

Changes

  • Extracted the gate into _interactive_gate() (pure, testable) and added and not resume.
  • A one-line "Resuming ... reusing its answers" notice replaces the menu so the user can see the run was picked up, not restarted.

Tests

  • 6 gate cases (resume/yes/provider/index-only/non-tty all skip; plain TTY prompts).

Note: test_plugin_content is red on main itself (v0.47.0 release bug, unrelated to this PR).

…#2098)

The is_interactive gate never excluded --resume, so a resume on a TTY
re-ran the whole questionnaire (banner, scan, mode menu, provider,
embedder, style) — indistinguishable from a fresh run, and a user who
answered differently resumed under a different provider/style than the
pages on disk were written with.

Extracted the gate into _interactive_gate() (pure, testable) and added
'and not resume'. The prior run's answers are already on disk
(config.yaml), which the non-interactive path reads. A one-line
'Resuming ... reusing its answers' notice replaces the menu so the user
can see the run was picked up, not restarted.

Tests: 6 gate cases (resume/yes/provider/index-only/non-tty all skip;
plain TTY prompts).
@RaghavChamadiya

Copy link
Copy Markdown
Member

The gate is right. Pulling it into _interactive_gate with the five inputs named makes it testable, and the parametrized coverage of each skip reason is more than the line it replaced ever had. --resume re-asking questions whose answers are already in config.yaml and were already used to write pages is the bug, and this closes it.

One line to change before it goes in, the new notice:

Resuming the previous run in {repo_path} - reusing its answers; pass --yes to skip this notice.

--yes does not skip it. The console.print is unconditional under if resume:, so init --resume --yes prints the same notice, and the advice sends people to try a flag that does nothing for what they were told it does. Drop the clause and keep the rest: telling someone their prior answers are being reused is worth saying, and it is the sentence that makes the silent behaviour change legible.

Drop that half-sentence and I will merge it.

@RaghavChamadiya

Copy link
Copy Markdown
Member

Still the one sentence, @sloemo01. The console.print sits under if resume: with nothing else gating it, so "pass --yes to skip this notice" is not true of the code in the same hunk:

    if resume:
        console.print(
            f"[bold]Resuming[/] the previous run in {repo_path} — "
            "reusing its answers; pass --yes to skip this notice."
        )

Replace those two lines with something that only claims what the run does and this merges as it stands:

            f"[bold]Resuming[/] the previous run in {repo_path}, "
            "reusing the answers it already saved to config.yaml."

Everything else is right and I am not asking for more. Pulling the predicate out into _interactive_gate with the six cases tested is better than the inline and chain it replaces, and it is the reason a future flag cannot quietly re-open the questionnaire on a resume.

For your awareness: #2147 arrived on the same issue after this one. Yours is first and yours is tested, so this is the one I want to land. Push the string change and I will merge on green, no further review.

…2098)

Raghav's review: 'pass --yes to skip this notice' is not true of the
code — the console.print is unconditional under 'if resume:', so
--yes does not skip it. Drop the clause; keep the sentence that makes
the silent behaviour change legible.
@sloemo01

sloemo01 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for being late on this one — the notice string is fixed in 564c16c88: dropped the pass --yes to skip this notice clause, since the console.print is unconditional under if resume: and --yes does not skip it. The notice now only claims what the run does:

Resuming the previous run in {repo_path}, reusing the answers it already saved to config.yaml.

40 gate tests pass (test_init_noninteractive + test_resume_run_mode). Thanks for the precise catch — and for the heads-up on #2147.

@RaghavChamadiya RaghavChamadiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That is the change, and thanks for turning it around @sloemo01 — sorry it then sat on my side for four days rather than yours. The notice now claims only what the run does. Pulling the predicate into _interactive_gate with the six cases named is the part that will still be paying off in a year: the next flag added to that chain gets a test that says what it does to a resume, instead of an inline and that nobody reads.

@RaghavChamadiya
RaghavChamadiya merged commit cdb2155 into repowise-dev:main Sep 11, 2026
9 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.

[Bug] init --resume re-runs the whole interactive questionnaire

2 participants