Skip to content

fix(#709): non-interactive update path — add --yes, replace ExitPromptError crash - #715

Merged
admarble merged 3 commits into
mainfrom
feature/709-fix-update-no-non-interactive-path-crashes-without
Jun 4, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/709-fix-update-no-non-interactive-path-crashes-without

Conversation

@admarble

@admarble admarble commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds -y, --yes to sequant update to apply updates without prompting (CI / non-interactive shells).
  • Guards both prompt sites — first-run dev-URL setup and the apply-confirm — so a needed prompt with non-TTY stdin and no --yes prints an actionable message naming --yes and exits non-zero, instead of crashing with a raw ExitPromptError stack trace.
  • --yes (auto-answer) stays distinct from --force (overwrite in-place customizations).
  • Docs updated: cheat-sheet + troubleshooting document --yes and the automation path (paired with the fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 sync fix).

Pre-PR AC Verification

AC Description Status Evidence
AC-1 update --yes/-y applies updates without prompting ✅ Implemented bin/cli.ts flag; update.ts:184 skips confirm; test AC-1 + E2E: echo "" | update --yes → "Updated 5 files", exit 0
AC-2 Non-TTY + no --yes → actionable message naming --yes, clean non-zero exit, no ExitPromptError ✅ Implemented update.ts refuseNonInteractive() on both prompt sites; tests AC-2 x2; E2E: piped update → message + exit 1, no stack trace
AC-3 --help, cheat-sheet, troubleshooting document --yes + automation guidance ✅ Implemented --help shows -y, --yes; docs/reference/cheat-sheet.md; docs/troubleshooting.md

Test plan

  • npm run build — passes
  • npm run lint — passes (0 warnings)
  • npx vitest run src/commands/update.integration.test.ts — 5/5 pass (3 new for AC-1/AC-2)
  • E2E in temp-init'd project: piped stdin without --yes → clean message + exit 1 (no ExitPromptError); with --yes → applies updates, exit 0

Notes

Touches bin/cli.ts — coordinate with #713 (also edits bin/cli.ts); rebase whichever merges second. The change is a single additive .option() on the update command, so conflicts should be trivial.

Closes #709

🤖 Generated with Claude Code

…tError crash

`sequant update` was interactive-only and crashed with a raw ExitPromptError
stack trace when run without a TTY. Add `-y, --yes` to apply updates without
prompting, and guard both prompt sites (first-run dev-URL setup and
apply-confirm): when a prompt is needed but stdin is not a terminal and --yes
was not passed, print an actionable message naming --yes and exit non-zero.

--yes (auto-answer) stays distinct from --force (overwrite in-place
customizations). Docs updated in cheat-sheet and troubleshooting.

Entire-Checkpoint: d53130c95a6b
admarble added 2 commits June 3, 2026 23:10
…-run preview

Two follow-up gaps from QA review of the non-interactive update path:

- CI with an allocated pseudo-TTY would still prompt and hang, because the
  guard keyed on `isStdinTTY()` alone. Route both prompt sites through a new
  `isNonInteractive()` (= `!isStdinTTY() || isCI()`) so unattended CI jobs
  refuse cleanly. The refusal message now names the actual reason via
  `getNonInteractiveReason()`.

- `update --dry-run` on a first-run (no-config) project refused with exit 1
  and, on the apply path, previously persisted config as a side effect. Add a
  dry-run branch to first-run setup that previews with default tokens without
  prompting, and skip `saveConfig` in dry-run so a preview leaves the project
  untouched in any shell.

Adds integration tests for both (CI-refuses-with-TTY, dry-run-first-run-no-write)
and updates CHANGELOG + troubleshooting docs.
…e-no-non-interactive-path-crashes-without

# Conflicts:
#	CHANGELOG.md
@admarble
admarble merged commit 17fb431 into main Jun 4, 2026
4 checks passed
@admarble
admarble deleted the feature/709-fix-update-no-non-interactive-path-crashes-without branch June 4, 2026 04:18
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.

fix(update): no non-interactive path — crashes without a TTY, add --yes

1 participant