Skip to content

fix(install): trap SIGINT so Ctrl+C exits cleanly during upgrade doctor#76386

Merged
openclaw-clownfish[bot] merged 7 commits into
openclaw:mainfrom
SebTardif:fix/install-ctrl-c-handling
Jul 6, 2026
Merged

fix(install): trap SIGINT so Ctrl+C exits cleanly during upgrade doctor#76386
openclaw-clownfish[bot] merged 7 commits into
openclaw:mainfrom
SebTardif:fix/install-ctrl-c-handling

Conversation

@SebTardif

@SebTardif SebTardif commented May 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #90011
Fixes #82304

Problem

When running curl -fsSL https://openclaw.ai/install.sh | bash, pressing Ctrl+C during openclaw doctor in the upgrade flow does not abort the installer. The SIGINT kills the doctor subprocess but the installer catches it as a regular failure, continues past the prompt, and opens a browser to an unconfigured dashboard URL.

Fix

  1. Add SIGINT/SIGTERM trap: abort_install_int/abort_install_term handlers clean up temp files, show a warning, and exit 130/143
  2. Propagate doctor exit code 130: capture openclaw doctor exit code separately; if 130 (SIGINT), call abort_install_int instead of treating it as a regular failure
  3. Preserve signal exit codes through run_quiet_step: the wrapper previously normalized all failures to exit 1, which swallowed SIGINT (130). Now returns signal exit codes (>128) so the doctor exit-130 check fires correctly, while preserving exit 1 for non-signal failures to maintain existing caller semantics across all 66+ installer call sites
  4. Clear dashboard flag on doctor failure: when the interactive upgrade-doctor exits non-zero (Clack cancellation exit 1, SIGINT exit 130, or ordinary failure), clear should_open_dashboard so the installer does not launch a dead dashboard after an incomplete upgrade
  5. Guard every run_doctor caller: the existing-config fresh-install path called run_doctor without checking its return value, so a failed doctor would still set should_open_dashboard=true. Now guarded with if run_doctor; then should_open_dashboard=true; fi
  6. Fix Clack cancel exit code: guardCancel in onboard-helpers.ts called runtime.exit(0) when the user cancelled at a Clack prompt (Escape key), making the install script treat cancellation as success. Changed to runtime.exit(1) to match the WizardCancelledError pattern used by clack-prompter.ts and onboard-interactive.ts

Real behavior proof

  • Behavior addressed: (1) Pressing Ctrl+C during openclaw doctor in the upgrade flow does not abort the installer; the installer continues and opens a dead dashboard. (2) guardCancel in onboard-helpers exited with 0/1 instead of 130, so the installer could not distinguish user cancellation from regular failure.

  • Real environment tested: macOS 15.5, Node v26.3.0, OpenClaw built from patched source at /tmp/wt-76386. Gateway started and doctor command exercised on a real OpenClaw deployment.

  • Exact steps or command run after this patch:

    Step 1. Built from branch: CI=true pnpm install --frozen-lockfile && pnpm build

    Step 2. Verified the fix in the compiled production bundle (before vs after).

    Step 3. Started the patched gateway and ran openclaw doctor --non-interactive to confirm the doctor module works correctly.

    Step 4. Sent SIGINT to the installer during a real upgrade to verify the abort path.

    Step 5. Ran the full install script test suite (49 tests).

  • Evidence after fix: terminal output from the patched build:

    Before (upstream/main): guardCancel exits with 0, making the installer treat Clack cancellation as success:

    $ sed -n '27,31p' /tmp/oc-base/dist/onboard-helpers-DxyrQbNM.js
    function guardCancel(value, runtime) {
    if (isCancel(value)) {
    cancel(stylePromptTitle("Setup cancelled.") ?? "Setup cancelled.");
    runtime.exit(0);
    throw new Error("unreachable");

    After (patched): guardCancel exits with 130 (SIGINT convention), which the installer detects and aborts:

    $ sed -n '27,31p' /tmp/wt-76386/dist/onboard-helpers-D47vq5rt.js
    function guardCancel(value, runtime) {
    if (isCancel(value)) {
    cancel(stylePromptTitle("Setup cancelled.") ?? "Setup cancelled.");
    runtime.exit(130);
    throw new Error("unreachable");

    Install script run_doctor now detects exit 130:

    $ grep -n 'doctor_exit.*130\|abort_install_int' /tmp/wt-76386/scripts/install.sh
    35:abort_install_int() {
    47:trap abort_install_int INT
    2835:    if (( doctor_exit == 130 )); then
    2836:        abort_install_int
    3303:            if (( doctor_exit == 130 )); then

    Doctor runs correctly on the live deployment:

    $ cd /tmp/wt-76386 && timeout 5 node openclaw.mjs doctor --non-interactive
    OPENCLAW
    OpenClaw doctor
    Doctor warnings
      - Left migrated plugin install index in place because archive already exists
    [state-migrations] Legacy state migration warnings:
      - Left migrated plugin install index in place
    $ echo "exit code: $?"
    exit code: 0

    Gateway starts cleanly with the patched module:

    $ timeout 10 node openclaw.mjs gateway
    [gateway] http server listening (9 plugins; 1.0s)
    [gateway] ready
    [shutdown] completed cleanly in 77ms

    SIGINT during install triggers clean abort:

    $ set -m; (bash scripts/install.sh --no-onboard --no-prompt 2>&1) & PID=$!; sleep 2; kill -INT -- -$PID; wait $PID; echo "exit=$?"
    Preparing installer interface...
      OpenClaw Installer
    Detected: macos
    [1/3] Preparing environment
    Node.js found
    [2/3] Installing OpenClaw
    ! Installation interrupted
    exit=130

    All 49 install script tests pass:

    $ node scripts/run-vitest.mjs test/scripts/install-sh.test.ts
     ✓ |tooling| install-sh.test.ts (49 tests) 4056ms
     Test Files  1 passed (1)
          Tests  49 passed (49)
  • Observed result after fix: The compiled production code at dist/onboard-helpers-D47vq5rt.js:30 calls runtime.exit(130) instead of runtime.exit(0) when the user cancels at a Clack prompt. The install script at line 2835 detects doctor_exit == 130 and calls abort_install_int, which exits with 130 and the "Installation interrupted" message. Terminal output confirms: (1) doctor runs correctly on the live deployment, (2) SIGINT during install triggers clean abort with exit 130, (3) the gateway loads the patched module without errors.

  • What was not tested: Live interactive Ctrl+C at a real Clack upgrade-doctor prompt (requires a state where doctor triggers an interactive migration question). The exit code propagation from guardCancel(130) through run_doctor to abort_install_int was verified via the compiled bundle, install script grep, and the 49-test suite.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS triage: refactor-only Candidate: refactor/cleanup-only PR without maintainer context. labels May 3, 2026
@clawsweeper

clawsweeper Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 5:05 PM ET / 21:05 UTC.

Summary
The PR adds installer INT/TERM abort handling, preserves signal-like doctor exits, gates dashboard launch on doctor success, narrows doctor-prompt Clack cancellation to exit 130, and adds install-script regression assertions.

PR surface: Source +6, Tests +50, Other +46. Total +102 across 4 files.

Reproducibility: yes. Source inspection on current main shows the installer lacks INT/TERM abort handling, loses child signal status in quiet steps, swallows non-interactive doctor failure, and can enable dashboard launch after doctor without a success check.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: scripts/install.sh, migration/backfill/repair: test/scripts/install-sh.test.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #82304
Summary: This PR is the active fix candidate for the installer Ctrl+C upgrade-doctor bug; the older detailed issue is canonical and the later issue duplicates the same signal-status/dashboard failure mode.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The exact live interactive upgrade-doctor Clack prompt was not replayed after the final doctor-only narrowing; source, dependency, terminal installer proof, and CI support the path, but a maintainer may still ask for that smoke before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land this focused installer/doctor cancellation fix after normal maintainer review, then close the linked installer Ctrl+C issues with the merge commit.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair lane is needed because this review found no concrete code defect; the remaining action is normal maintainer review and optional live interactive smoke judgment.

Security
Cleared: The diff changes installer signal/exit handling and prompt exit adaptation without new dependencies, downloads, permissions, secrets handling, or package-resolution changes.

Review details

Best possible solution:

Land this focused installer/doctor cancellation fix after normal maintainer review, then close the linked installer Ctrl+C issues with the merge commit.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection on current main shows the installer lacks INT/TERM abort handling, loses child signal status in quiet steps, swallows non-interactive doctor failure, and can enable dashboard launch after doctor without a success check.

Is this the best way to solve the issue?

Yes. The latest head is the narrowest maintainable fix found because it repairs installer signal/status propagation and dashboard gating while keeping shared non-doctor Clack cancellation behavior unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 010b61746379.

Label changes

Label justifications:

  • P2: This is a bounded installer reliability bugfix for a real upgrade-flow abort problem with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes terminal after-fix proof for build, doctor, gateway startup, installer SIGINT exit 130, and install-script tests; the only stated gap is the exact interactive upgrade-doctor Clack prompt.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal after-fix proof for build, doctor, gateway startup, installer SIGINT exit 130, and install-script tests; the only stated gap is the exact interactive upgrade-doctor Clack prompt.
Evidence reviewed

PR surface:

Source +6, Tests +50, Other +46. Total +102 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 8 2 +6
Tests 1 50 0 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 55 9 +46
Total 4 113 11 +102

What I checked:

  • Repository policy read: Root AGENTS.md plus the scoped scripts and test guides were read fully; the installer review applied the repo requirements for source-backed review, setup compatibility attention, and wrapper-aware validation. (AGENTS.md:11, 010b61746379)
  • Current main source reproduction: Current main has only the cleanup EXIT trap, flattens quiet-step failures to 1, swallows run_doctor failures with || true, and sets should_open_dashboard=true after doctor without checking success. (scripts/install.sh:33, 010b61746379)
  • PR head installer fix: The PR head adds INT/TERM abort handlers, captures quiet-step exit status, preserves exits above 128, aborts doctor exit 130, returns other doctor failures, and guards dashboard launch behind successful doctor completion. (scripts/install.sh:35, e7e4539f148e)
  • PR head cancellation compatibility: The latest PR head keeps guardCancel defaulting to exit 0 and passes exit code 130 only from doctor-prompter confirm/select paths, preserving the other shared prompt callers' default cancellation behavior. (src/commands/doctor-prompter.ts:50, e7e4539f148e)
  • Clack dependency contract checked: OpenClaw pins @clack/core 1.3.1 and @clack/prompts 1.4.0; direct Clack source inspection shows Ctrl+C (\x03) and Escape map to the cancel action, prompts resolve the cancel symbol, and OpenClaw's guardCancel owns the process exit code choice. (package.json:1973, fe2bcd278635)
  • Related issue cluster: Live GitHub issue search found the older detailed issue and the later duplicate for the same installer Ctrl+C upgrade-doctor failure; this PR is the only matching open PR returned for that search.

Likely related people:

  • SebTardif: Beyond authoring this PR, GitHub path history shows prior merged installer work on scripts/install.sh, and this branch contains the focused commits for the signal/dashboard bug. (role: current fix proposer and prior installer contributor; confidence: high; commits: e7e4539f148e, 1c9851e11539, 527b7c2eed2f; files: scripts/install.sh, src/commands/doctor-prompter.ts, src/commands/onboard-helpers.ts)
  • vincentkoc: GitHub path history shows repeated recent installer and installer-test maintenance near the affected script surface. (role: recent installer area contributor; confidence: high; commits: adc4d9fe02af, bd74a62118aa, 6c5b39291fae; files: scripts/install.sh, test/scripts/install-sh.test.ts)
  • steipete: GitHub path history shows recent doctor-prompter and onboarding-helper work plus installer changes on the same setup boundary. (role: recent adjacent installer and doctor contributor; confidence: high; commits: 0913b6989c73, 2ca936ee9869, 316d97c938c1; files: scripts/install.sh, src/commands/doctor-prompter.ts, src/commands/onboard-helpers.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@SebTardif

Copy link
Copy Markdown
Contributor Author

This is a bug fix, not a refactor — the triage: refactor-only label does not apply.

Reproduction: Run curl -fsSL https://openclaw.ai/install.sh | bash on an upgrade where openclaw doctor shows skills with missing requirements. Press Ctrl+C to abort. The installer ignores the interruption, continues past doctor, and opens a browser to a dead dashboard URL (http://127.0.0.1:18789/).

Root cause: No trap ... INT in the install script, the && doctor_ok=1 pattern swallows SIGINT, and should_open_dashboard is set unconditionally before the interactive section.

This PR fixes real user-facing misbehavior — Ctrl+C during the installer should exit the installer, not silently continue and open dead browser tabs.

@SebTardif

Copy link
Copy Markdown
Contributor Author

@fabianwilliams — this fixes a user-facing bug where Ctrl+C during openclaw doctor in the upgrade flow does not abort the installer and instead opens a browser to a dead dashboard URL. Small diff (net +18 lines in install.sh). Related to my other install.sh fix in #76355.

@SebTardif
SebTardif force-pushed the fix/install-ctrl-c-handling branch from 26d8b98 to c5b41aa Compare May 9, 2026 01:38
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 9, 2026
@SebTardif
SebTardif force-pushed the fix/install-ctrl-c-handling branch from c5b41aa to 1cd353a Compare May 13, 2026 01:42
@SebTardif
SebTardif force-pushed the fix/install-ctrl-c-handling branch from 1cd353a to ce5d7de Compare May 17, 2026 02:42
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 17, 2026
@SebTardif SebTardif closed this May 17, 2026
@SebTardif SebTardif reopened this May 17, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. P2 Normal backlog priority with limited blast radius. labels May 17, 2026
@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Cosmic Crabkin

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: sparkles near resolved comments.
Image traits: location proof lagoon; accessory commit compass; palette seafoam, black, and opal; mood sparkly; pose waving from a small platform; shell soft velvet shell; lighting moonlit rim light; background small review tokens.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Cosmic Crabkin in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 22, 2026
@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SebTardif

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

steipete and others added 7 commits July 1, 2026 11:56
Three changes to fix the install script's Ctrl+C handling:

1. Add INT/TERM signal traps that clean up temp files and exit with
   the correct signal exit codes (130 for SIGINT, 143 for SIGTERM).

2. Preserve signal exit codes (>128) through run_quiet_step so the
   doctor path can distinguish user cancellation from normal errors.
   Non-signal failures still return 1, preserving existing caller
   semantics for all other installer steps.

3. Fix guardCancel in onboard-helpers.ts: exit(0) changed to exit(1)
   so Clack prompt cancellation (Escape/Ctrl+C) is treated as failure,
   not success. This prevents the installer from continuing with plugin
   updates after the user explicitly cancelled.

Signed-off-by: Sebastien Tardif <[email protected]>
When a user cancels the interactive upgrade-doctor prompt (Clack
cancellation exits 1, SIGINT exits 130), clear should_open_dashboard
so the installer does not launch a dead dashboard after an incomplete
upgrade.

Also propagate non-zero exit from run_doctor() so the non-interactive
upgrade path correctly skips dashboard launch on failure.
The existing-config path called run_doctor without checking its return
value, so a failed or cancelled doctor would still launch the dashboard.
Now both run_doctor call sites guard the return value with if-then.

Adds focused tests verifying: every run_doctor caller is guarded,
dashboard flag is cleared on doctor failure, signal exit codes
propagate through run_quiet_step, and SIGINT (exit 130) triggers
abort_install_int.
guardCancel now exits with 130 (SIGINT convention) instead of 1. When
the user presses Ctrl+C at an interactive doctor prompt, the installer
sees doctor_exit=130 and calls abort_install_int, aborting cleanly
instead of continuing after exit 1.

Signed-off-by: Sebastien Tardif <[email protected]>
Revert guardCancel to exit 0 by default (matching main) and pass
exit code 130 only from doctor-prompter where the installer needs
to distinguish user cancellation from normal failures.

This preserves the existing cancellation behavior for configure,
wizard, gateway, and daemon prompts while keeping the SIGINT
convention for the installer's doctor subprocess.

Signed-off-by: Sebastien Tardif <[email protected]>
@SebTardif

Copy link
Copy Markdown
Contributor Author

Update: narrowed exit 130 + rebased onto main

Two changes:

  1. Narrowed exit 130 to doctor-prompter only. guardCancel now defaults to exit 0 (matching main). Only the doctor-prompter passes exit code 130, since that is where the installer needs to distinguish user cancellation from normal failures. Configure, wizard, gateway, and daemon prompts are unaffected.

  2. Rebased onto current main so the Dependency Guard check can pass.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@vincentkoc

Copy link
Copy Markdown
Member

No description provided.

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

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: refactor-only Candidate: refactor/cleanup-only PR without maintainer context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installer Ctrl+C during upgrade doctor does not abort [Bug]: Ctrl+C during upgrade doctor does not abort the installer

4 participants