Skip to content

fix(update): npx 起動時に GUI アップデートが誤動作するのを防ぐ (#1394)#1396

Merged
Kewton merged 1 commit into
developfrom
fix/1394-npx-gui-update-guard
Jul 18, 2026
Merged

fix(update): npx 起動時に GUI アップデートが誤動作するのを防ぐ (#1394)#1396
Kewton merged 1 commit into
developfrom
fix/1394-npx-gui-update-guard

Conversation

@Kewton

@Kewton Kewton commented Jul 18, 2026

Copy link
Copy Markdown
Owner

概要

npx commandmate で起動したサーバの GUI アップデート機能が npx を「グローバルインストール」と誤認し、「今すぐアップデート」ボタンが 202 started を返すのに実体は no-op → 5 分 timeout に陥る不具合を修正します。CLI (#1319) にあった npx ガードが GUI 経路(update-check / update route)に未反映でした。

Closes #1394

変更内容

  • GET /api/app/update-check: isNpxExecution()isGlobalInstall() より先に判定し installType: 'npx' を新設。updateCommand=== 'global' ゲート済みで npx では null 維持。
  • POST /api/app/update: lock/spawn 前に npx ゲートを追加し 400 code:'npx' で拒否。検知失敗時は fail-safe で既存 not_global ゲートにフォールバック。
  • UpdateNotificationBanner: installType: 'npx' で更新ボタンを出さず、正しいコマンド npx commandmate@latest の案内ブロックを表示。
  • i18n: update.npxTitle / update.npxDescriptionlocales/{en,ja} に追加。
  • : InstallType union を 'global' | 'local' | 'npx' | 'unknown' に拡張(route / api-client / banner props)。

受け入れ条件

  • npx を global と誤認せず「今すぐアップデート」ボタンを表示しない
  • POST /api/app/update が npx 実行時に spawn せず 400 code:'npx' を返す
  • GUI が表示する案内コマンドが正しい(commandmate update ではなく npx commandmate@latest
  • グローバルインストール時の既存ワンクリック更新は不変
  • ユニットテスト追加

検証

  • npx tsc --noEmit: exit 0
  • npm run lint: 0 errors
  • 影響4テストファイル: 86 passed(npx 系テスト新規追加)
  • 全ユニットスイート: 10132 passed(worker 実行)

スコープ外

npx 起動サーバの「その場更新」実装は本 PR のスコープ外。別 Issue #1395 (feature) で対応します。

🤖 Generated with Claude Code

https://claude.ai/code/session_01AqhdEu33W6t3ing8ksA6J3

npx で起動したサーバは isGlobalInstall() が true を返す(Issue #1195 の
意図的挙動)ため、GUI の update-check / update route が npx を global と
誤認していた。結果「今すぐアップデート」ボタンが表示され、押下すると 202
started を返すが実体は no-op(spawn した commandmate update が #1319 の npx
ゲートで即終了)で、バナーは 5 分 timeout に陥っていた。CLI (#1319) の
ガードが GUI 経路に未反映だった。

- GET /api/app/update-check: isNpxExecution() を isGlobalInstall() より先に
  判定し installType: 'npx' を新設。updateCommand は 'global' ゲート済みで
  npx では null を維持。
- POST /api/app/update: lock/spawn 前に npx ゲートを追加し 400 code:'npx' で
  拒否。検知失敗時は fail-safe で既存 not_global ゲートにフォールバック。
- UpdateNotificationBanner: installType 'npx' で更新ボタンを出さず、正しい
  コマンド `npx commandmate@latest` の案内ブロックを表示。
- i18n: update.npxTitle / update.npxDescription を locales/{en,ja} に追加。
- InstallType union を 'global' | 'local' | 'npx' | 'unknown' に拡張
  (route / api-client / banner props)。

npx でのその場更新の実装は本 Issue のスコープ外(#1395 で別途対応)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AqhdEu33W6t3ing8ksA6J3
@Kewton Kewton added the bug Something isn't working label Jul 18, 2026
@Kewton
Kewton merged commit e994955 into develop Jul 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant