Skip to content

fix(inspector): don't auto-launch the Run Inspector (default autoOpen → false) - #116

Merged
kateebonner merged 2 commits into
mainfrom
kate/inspector-no-autolaunch
Jul 9, 2026
Merged

fix(inspector): don't auto-launch the Run Inspector (default autoOpen → false)#116
kateebonner merged 2 commits into
mainfrom
kate/inspector-no-autolaunch

Conversation

@kateebonner

Copy link
Copy Markdown
Contributor

What

Flip the contributed default of amicode.inspector.autoOpen from true to false so the Run Inspector panel no longer auto-launches when a solve starts. It stays fully reachable on demand.

Why

The inspector auto-reveals on every solve today. Every auto-reveal path is already gated behind autoOpenEnabled() (run_inspector.ts), whose code fallback is false, and the surrounding comments state the intent is "off by default so a starting solve never steals focus." But package.json contributed the setting with "default": true — and VS Code returns the contributed default, not the code fallback, whenever the user hasn't set the key. So the setting was effectively on in every install, contradicting the code's stated intent.

This is a one-line behavioral fix (default + description). No src changes: the four gated reveal paths (sse_client.ts amico-tool completion, runs_manager.ts run selection + new-live-run auto-follow, run_inspector.ts warming-up focus) all become no-ops by default, matching the existing comments.

On-demand entry points (unchanged)

The inspector still opens via:

  • the status-bar item, and
  • the Amicode: Open Run Inspector command (amicode.openInspector, unconditional — bypasses the gate).

A follow-up will add an in-chat "Inspect Run" button (opencode side) that routes through the same amicode.openInspector command, which is already allowlisted in the chat bridge.

Users who opted in

Anyone who explicitly set amicode.inspector.autoOpen: true keeps auto-launch — only the untouched default changes.

Verification

⚠️ Build/test gates were not run in the authoring environment (no node/pnpm toolchain available). Please run before merge:

  • pnpm --filter amicode-v2 typecheck
  • pnpm --filter amicode-v2 test

🤖 Generated with Claude Code

The Run Inspector auto-launches on every solve today because the
contributed setting default is `true`, while the code (autoOpenEnabled(),
run_inspector.ts) and its comments assume `false`. VS Code returns the
contributed package.json default, not the code fallback, so the panel
steals focus whenever a solve starts.

Flip the contributed default to false so the inspector no longer
auto-launches; it stays reachable on demand via the status-bar item and
the "Amicode: Open Run Inspector" command (and, once the opencode-side
button lands, the in-chat "Inspect Run" button). No src changes — every
auto-reveal path is already gated on autoOpenEnabled().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kateebonner

Copy link
Copy Markdown
Contributor Author

Verification gates now run green (toolchain bootstrapped locally):

  • pnpm install → ok (pnpm 9.15.9)
  • pnpm --filter amicode-v2 typecheck (tsc --noEmit) → exit 0
  • pnpm --filter amicode-v2 test435 passed, 3 skipped, 0 failed

Confirms the default flip doesn't affect any code path — every auto-reveal path was already gated on autoOpenEnabled().

…button press

The autoOpen default flip stops the extension from auto-revealing on solve
start, but VS Code independently restores webview panels that were open in a
prior session — so the Run Inspector still reappeared on window load,
regardless of the setting.

Gate the `amicode.runInspector` view behind a `when: amicode.inspectorRevealed`
context key. That key starts false on every window load and is never persisted,
so VS Code has no visible view to restore — the panel can't come back on its
own. Route every reveal path (open command, run picker, demo replay, and the
opted-in autoOpen auto-reveal) through a single revealInspector() that flips
the key on, then focuses. The inspector now materializes only on a deliberate
open and never via VS Code's view-state restoration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kateebonner
kateebonner merged commit 18c256b into main Jul 9, 2026
5 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