diff --git a/e2e/RESULTS.md b/e2e/RESULTS.md index bbe16cc..6ca1e99 100644 --- a/e2e/RESULTS.md +++ b/e2e/RESULTS.md @@ -3,6 +3,11 @@ Latest run of the end-to-end suite. Regenerate after every code change with `npm run test:e2e` and update this file (paste the summary). +- **2026-06-29 (native /model picker)** — setup writes CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 + so Claude Code populates /model from our /anthropic/v1/models; ANTHROPIC_MODEL[1m] stays the 1M + default and does NOT lock the picker (verified vs docs). Reset clears the new key. Picker lists + claude* ids; CC >=2.1.129. Project suite **422 passed**, e2e **43 passed**, build clean. + - **2026-06-29 (TUI UX batch)** — Status shows per-scope client model (not just a check); chat setup tools require scope+model (ask before write); added recent_errors/metrics chat tools for command parity; /report body restructured to the #5 template; heartbeat interval configurable; diff --git a/src/tui/setup/apply.ts b/src/tui/setup/apply.ts index bd89197..8532420 100644 --- a/src/tui/setup/apply.ts +++ b/src/tui/setup/apply.ts @@ -13,6 +13,7 @@ export const CLAUDE_ENV_KEYS = [ "ANTHROPIC_BASE_URL", "ANTHROPIC_API_KEY", "ANTHROPIC_MODEL", "ANTHROPIC_AUTH_TOKEN", "CLAUDE_CODE_AUTO_COMPACT_WINDOW", "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE", "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "CLAUDE_CODE_ATTRIBUTION_HEADER", + "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY", ]; export const CODEX_ENV_KEYS = ["OPENAI_BASE_URL", "OPENAI_API_KEY", "OPENAI_MODEL"]; diff --git a/src/tui/setup/clients.ts b/src/tui/setup/clients.ts index 3c9ac77..32c62ae 100644 --- a/src/tui/setup/clients.ts +++ b/src/tui/setup/clients.ts @@ -32,6 +32,10 @@ export function claudeCopilotReverseEnv(base: string, apiKey: string, model: str CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: "80", CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1", CLAUDE_CODE_ATTRIBUTION_HEADER: "0", // keep prompt caching working on a non-Anthropic gateway + // Populate Claude Code's /model picker from our /anthropic/v1/models so the user can switch + // models natively. Coexists with ANTHROPIC_MODEL (which stays the 1M default — it does NOT lock + // the picker). Claude Code >=2.1.129 only; older builds ignore it. Picker lists claude* ids. + CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY: "1", }; } diff --git a/tests/tui/setup.test.ts b/tests/tui/setup.test.ts index a1e5855..4a18ede 100644 --- a/tests/tui/setup.test.ts +++ b/tests/tui/setup.test.ts @@ -20,6 +20,7 @@ describe("claudeCopilotReverseEnv", () => { expect(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW).toBe("1000000"); expect(env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE).toBe("80"); expect(env.CLAUDE_CODE_ATTRIBUTION_HEADER).toBe("0"); + expect(env.CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY).toBe("1"); // /model picker is populated, not locked }); it("omits the window/suffix when it's unknown", () => { const env = claudeCopilotReverseEnv("http://x", "k", "gpt-4o");