Skip to content

Fix claude availability detection; remember combo role app picks - #45

Merged
nananek merged 1 commit into
masterfrom
fix/claude-absence-detection-combo-memory
Aug 12, 2026
Merged

Fix claude availability detection; remember combo role app picks#45
nananek merged 1 commit into
masterfrom
fix/claude-absence-detection-combo-memory

Conversation

@nananek

@nananek nananek commented Aug 12, 2026

Copy link
Copy Markdown
Owner

概要

ホストから claude CLI を削除した後も、起動モーダルで Claude Code が選択可能なまま表示され、Usage ボタンが自動非表示にならない不具合と、コンボ起動のロール別アプリ選択が記憶されない不具合を修正します。

変更内容

1. claude 不在の検出を正しくする (server/ws/sandbox.js)

  • which()/ を含むパス形コマンドを存在チェックなしでそのまま返していたのを修正。
    statSync + 実行可能ビットで実在を確認し、なければ null を返す。
  • これにより stale な claudeBin (例: 削除済み /usr/bin/claude へのピン) が found: true
    生んでいた経路が断たれ、installedApps().claude が正しく false になる。
  • 下流の全機構 (起動モーダルのグレーアウト、Usage ボタンの自動非表示、未インストール起動の
    サーバー側拒否、/usage キャプチャの fail-fast) がそのまま正しく働くようになる。
  • テスト: sandbox-resolve.test.js に「存在しないパス形 claudeBin は found: false」のテストを追加。
    (本ホストで従来失敗していた sandbox-resolve.test.js:64 も green に戻る)

2. コンボ起動のロール別アプリ選択を localStorage に記憶 (client/src/components/DirectoryBrowser.jsx)

  • 新キー ccserver-combo-apps ({ workerA, workerB, orchestrator })。
  • 初期値を localStorage から読み込み (値は claude/opencode のみ許可、不正は既定へフォールバック)、
    chooseComboApp(role, app) で選択変更時に保存。
  • availableApps 補正の結果も write-through し、再読込後も補正後値が維持される。
  • 単発起動の ccserver-app-default とは独立 (README の「コンボには defaultApp 非適用」と整合)。

3. ドキュメント・e2e

  • README: コンボ起動のロール別アプリ選択も localStorage に記憶される旨を追記。defaultApp
    説明を実態 (ワーカーB の初期値は opencode) と整合するよう修正。
  • tests/launch-modal.spec.js: 全ロールを opencode に変えてモーダルを閉じ、reload 後も
    選択が保持される e2e を追加。

検証

  • npm test: 343 pass / 0 fail (修正前は sandbox-resolve.test.js:64 が 1 件失敗)
  • npm run build --workspace=client: green
  • npm run test:e2e: 本変更に関連する spec (launch-modal 3 件含む) は全て green。
    opencode TUI を実際に操作する 4 件 (mobile-scroll / sandbox-resume / scroll-buttons) は
    master でも失敗する既存の環境依存問題で、本変更とは無関係。
  • 実機: installedApps(){ claude: false, opencode: true, copilot: true } を返すことを確認。

…bo role app picks

- which(): a path-form command (configured claudeBin) must exist and be
  executable; a stale pin at a removed CLI no longer reads found: true,
  so the launch-modal grey-out, Usage auto-hide, and server-side launch
  refusal all work again
- combo role app picks (workerA/workerB/orchestrator) are remembered in
  localStorage (ccserver-combo-apps) and restored on the next combo
  launch, with the availableApps correction written through
- tests: deterministic path-form claudeBin missing test (server), combo
  pick persistence across reload (e2e)
@nananek
nananek merged commit d4c165f into master Aug 12, 2026
3 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.

1 participant