Skip to content

Usage ボタンを設定で非表示にできるようにし、未インストール CLI の起動を防止 - #44

Merged
nananek merged 4 commits into
masterfrom
plan/usage-hide-and-installed-apps
Aug 12, 2026
Merged

Usage ボタンを設定で非表示にできるようにし、未インストール CLI の起動を防止#44
nananek merged 4 commits into
masterfrom
plan/usage-hide-and-installed-apps

Conversation

@nananek

@nananek nananek commented Aug 12, 2026

Copy link
Copy Markdown
Owner

概要

2 つの要件を実装:

  1. Usage ボタンの非表示設定sandbox.config.jsonshowUsage: false (既定 true) でタブバー右端の Usage ボタン (Claude Code /usage) を非表示にできる。加えて claude がサーバーにインストールされていない環境では設定に関わらず自動的に非表示になる (/api/usage が恒久的に失敗するため)。
  2. インストール済みアプリのみ選択可能 — サーバー側の実行ファイル解決 (resolveApp) に found フラグを追加し、installedApps() を新設。GET /dirs/homeavailableApps として公開し、起動モーダル (シングル・コンボ両方) で未インストールの CLI をグレーアウト + 既定アプリの自動補正。createSession は未インストールのアプリ指定を明示エラーで拒否し、従来の execvp/ENOENT 失敗を全起動経路 (WS・予約プロンプト・オーケストレーター再起動) で根絶。

変更内容

ファイル 変更
server/ws/sandbox.js loadSandboxConfigshowUsage / resolveAppfound / installedApps() 新設
server/routes/dirs.js /dirs/homeshowUsageavailableApps を追加 (後方互換)
server/ws/sessionManager.js 未インストール起動を明示エラーで拒否 (CLI 解決は 1 回に統一)
server/usage.js claude 不在時に fail-fast (CLI 解決は 1 回に統一)
client/src/App.jsx /dirs/home を取得し usageHiddenshowUsage・claude 不在を反映
client/src/components/DirectoryBrowser.jsx モーダル (シングル+コンボ) の無効化・既定アプリ補正・クリックガード
server/sandbox.config.example.json / README.md 設定の説明・利用法を追記

テスト

  • npm test (server): 344 pass / 1 skip (インストール状況依存)
  • npm run build --workspace=client: 成功

レビュー経緯

  • workerB 自己レビュー 3 ラウンド後に claude 最終レビュー実施済み (本 PR 作成時に検証完了)。

- sandbox.config.json showUsage (default true) disables the top-bar Usage
  button; it is also hidden automatically when claude is not installed.
- resolveApp returns a found flag; installedApps() exposes per-app install
  state via GET /dirs/home (availableApps) so the launch modal greys out
  uninstalled CLIs and corrects a stale default app.
- createSession refuses uninstalled agents with a clear error instead of
  opaque execvp/ENOENT; /usage capture fails fast when claude is missing.
…fault app

- chooseApp now refuses uninstalled apps (like chooseSandbox's forceSandbox
  guard), so the disabled row can no longer move the checkmark / launch
  button label to an app that cannot start.
- The default-app availability correction evaluated a stale appDefault:
  the server's defaultApp seeding runs in the same effect tick, so a
  server default pointing at an uninstalled CLI was never corrected.
…t combo role defaults for missing CLIs

- App.jsx: !availableApps?.claude hid the Usage button whenever the
  /dirs/home fetch was pending/failed or the key was absent (older
  server), contradicting the 'absent keys keep the button shown' intent.
  Auto-hide now only when the server actually reports claude missing.
- DirectoryBrowser: combo roles (workerA/workerB/orchestrator) kept a
  default pointing at an uninstalled CLI as selected-active, so コンボ起動
  advertised and fired a launch the server refuses. Correct them to the
  first available combo app (claude/opencode only) when availableApps
  arrives, mirroring the single-launch default correction.
@nananek
nananek merged commit 7997291 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