# Gateway model refresh proof

Run each commit as a web development app with T3CODE_DEV_SEED=0 and a fresh database. Use Claude Code 2.1.332, Chromium, a 1280x800 CSS viewport (device scale 2), and the light theme.

1. Start gateway.cjs with Node. GET /reset publishes gateway/claude-current and gateway/claude-retired; GET /retire removes the latter. The gateway implements the real Claude Code GET /v1/models?limit=1000 response.
2. Open Settings > Providers, select Claude, and set CLAUDE_CONFIG_DIR path to a fresh empty directory unique to that side.
3. Add gateway/claude-current as a custom model before enabling gateway discovery.
4. Add per-instance environment variables ANTHROPIC_BASE_URL=http://127.0.0.1:18187, CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, and ANTHROPIC_API_KEY=gateway-proof-dummy. These are synthetic local values.
5. Refresh provider status, allow background discovery to finish, and refresh again. Confirm Claude-Retired and gateway/claude-current (custom) both appear. Filter Models to gateway and scroll the filter into the center.
6. Start a browser recording. GET /retire. Invoke the same Refresh provider status button three times, allowing roughly eight seconds or more between refreshes. The driver can click the offscreen button through DOM .click() so the model list stays visible in the recording.
7. Verify the actual Claude cache (cache/gateway-models.json under its isolated config directory) contains only gateway/claude-current. On base, the retired model still appears; on head it disappears and the custom model remains.
8. Capture the final Settings list after two screenshots at least 500ms apart are pixel-identical. Inspect screenshots and sampled video frames before uploading.

Browser DOM actions used on both sides:
- Select Claude: button[aria-label="Select Claude"].click()
- Type config path: #provider-instance-claudeAgent-homePath, then Tab to save.
- Add custom model: button whose textContent is "Add custom model"; type #provider-instance-claudeAgent-custom-model, then click Add.
- Add variable: button containing "Add variable"; fill inputs aria-label="Environment variable name N" and aria-label="Environment variable value N"; Tab to save each.
- Refresh: [...document.querySelectorAll('button')].find(x=>x.textContent.startsWith('Refresh provider status')).click()
- Filter: input[aria-label="Filter models"], type gateway; scrollIntoView({block:'center'}); blur before stable stills.

The screenshots are unmodified browser captures. The videos retain the actual app refresh behavior; no app state or model inventory is mocked inside T3 Code.
