Skip to content

fix(cli): delegate happy update/upgrade to claude - #1727

Open
charliezong18 wants to merge 1 commit into
slopus:mainfrom
charliezong18:fix/update-subcommand-passthrough
Open

fix(cli): delegate happy update/upgrade to claude#1727
charliezong18 wants to merge 1 commit into
slopus:mainfrom
charliezong18:fix/update-subcommand-passthrough

Conversation

@charliezong18

Copy link
Copy Markdown
Contributor

Neither update nor upgrade is in the subcommand chain, so both fall through to the session launcher, which appends Happy's hook --settings — an option claude's update command rejects. That is the failure #1529 reports.

Route both aliases straight to claude, propagating exit status and signals.

Why not reuse claudeCliPath (as the --help path at index.ts:798 does): that constant points at scripts/claude_local_launcher.cjs, which sets DISABLE_AUTOUPDATER = '1' (line 4) and replaces global.fetch to report progress over fd 3 (lines 16-19). Running the updater through a launcher that disables the auto-updater is not what anyone wants, so this branch resolves the claude binary itself.

Fixes #1529

Proof

Isolated HAPPY_HOME_DIR, and HAPPY_CLAUDE_PATH pointed at a stub that prints its argv and exits with a chosen code — so the real claude is never invoked.

Before — main, happy update: never reaches claude at all; update is treated as a session launch.

How would you like to authenticate?

› 1. Mobile App
  2. Web Browser

After — this branch:

$ happy update
FAKE-CLAUDE received argv: update

$ happy upgrade --some-flag
FAKE-CLAUDE received argv: upgrade --some-flag

No --settings, alias and trailing flags pass through. Exit status propagates — with the stub exiting 7, happy exits 7.

Validation

  • happy-cli typecheck: no new errors relative to main
  • Single file, packages/happy-cli/src/index.ts
  • index.ts has not been modified upstream since this fix was written

🤖 Generated with Claude Code

Neither alias was in the subcommand chain, so both fell through to the session
launcher, which appends Happy's hook --settings — an option claude's update
command rejects, so it always failed.

Resolves the claude binary directly rather than going through
claude_local_launcher.cjs, whose DISABLE_AUTOUPDATER=1 and fetch interception
have no business in a one-shot update.

Fixes slopus#1529
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.

happy update fails: --settings passed to claude update subcommand

1 participant