# Claude gateway model discovery proof

Environment: Linux web dev app, Chromium, 1280x800 CSS viewport (2560x1600 PNGs), light theme, Claude Code 2.1.332. Two separate worktrees and fresh T3 databases, with dev database copying disabled. No conversation was sent to a paid model. Claude uses an isolated config directory per side and a discovery-only local HTTP gateway.

Base: 8c6a4a578bb8eb9b33dada4cac45b729db9a7b31
Head: ccb43e4ecf453231d2fde5ecbfef5e035a815d40

1. Run gateway.py with models.json containing ["gateway/claude-sonnet-retained", "gateway/claude-opus-removed"].
2. Start each checkout with T3CODE_DEV_SEED=0, T3CODE_ENVIRONMENT_LABEL="Gateway proof", CLAUDE_CONFIG_DIR set to a separate synthetic configuration directory, ANTHROPIC_BASE_URL=http://127.0.0.1:18761, ANTHROPIC_AUTH_TOKEN=synthetic-test-token, and CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1. Run vp run dev. Install dependencies first using vp i.
3. Pair the browser using the app-generated pairing URL. Open Settings > Providers, refresh provider status, and wait for Claude to show Authenticated / Custom API endpoint. Refresh again to consume Claude's asynchronously updated model cache if needed.
4. Open the composer model picker, select Claude and search gateway/. Confirm both gateway models appear.
5. Change models.json to ["gateway/claude-sonnet-retained"], leaving the gateway endpoint and credentials unchanged.
6. Open Settings > Providers > Refresh provider status. Wait until completed, then refresh once more and wait until completed. The first probe initializes with the old cache while updating it in the background; the second initializes with the new cache. This exact two-refresh sequence was used on both commits.
7. Reopen the picker, select Claude, and search gateway/. Base retains both models. Head lists only gateway/claude-sonnet-retained.
8. Stop the entire dev app with Ctrl+C, restart using the same environment and data directory, reload the web client, and reopen the same picker/search. Base still lists both; head still lists only the retained model.

Artifacts: refresh recordings show the provider refresh interaction on each side; restart recordings show the app going away, relaunching, and the reopened picker. Endpoint removal happens via models.json outside the browser. PNGs used for the restart comparison were checked as identical pixel-for-pixel in captures more than 500 ms apart after blurring the search input to stop its caret blinking. No code, registry snapshots, or database rows were mocked or edited.

The scenario runner was not used because its documented exclusions include provider-specific discovery behavior. The real installed Claude binary and its actual /v1/models cache were exercised.
