From c921067eb8dda5ad609fadeb310de1e76fb39a6c Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 13:31:18 -0500 Subject: [PATCH] fix(client): regenerate model compatibility type (#49204) Co-authored-by: rekram1-node --- packages/client/src/promise/generated/types.ts | 1 + packages/tui/test/command-selection.test.tsx | 11 ++++++++++- packages/tui/test/fixture/local.tsx | 10 +++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index b6f01eec95d..763389848eb 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -1342,6 +1342,7 @@ export type ModelCompatibility = { maxTokensField?: ModelMaxTokensField requireFinishReason?: boolean requireAssistantAfterTool?: boolean + supportsPromptCacheKey?: boolean } export type ProviderInfo = { diff --git a/packages/tui/test/command-selection.test.tsx b/packages/tui/test/command-selection.test.tsx index 90f291d28fe..f03940e3bfb 100644 --- a/packages/tui/test/command-selection.test.tsx +++ b/packages/tui/test/command-selection.test.tsx @@ -87,8 +87,9 @@ test("custom commands commit the captured agent, model and variant before execut expect(mutations).toEqual([{ type: "agent", body: { agent: "plan" } }]) // A later local edit must not change the in-flight command's selection. + await waitForFrame(setup, (frame) => frame.includes("Plan · second model Demo · low")) setup.mockInput.pressKey("F7") - await setup.waitForFrame((frame) => frame.includes("high")) + await waitForFrame(setup, (frame) => frame.includes("high")) agent.resolve(new Response(null, { status: 204 })) await setup.waitFor(() => mutations.length === 2) expect(mutations[1]).toEqual({ @@ -106,3 +107,11 @@ test("custom commands commit the captured agent, model and variant before execut model.resolve(new Response(null, { status: 204 })) } }) + +async function waitForFrame(setup: Awaited>, matches: (frame: string) => boolean) { + const started = Date.now() + while (!matches(setup.captureCharFrame())) { + if (Date.now() - started > 2_000) throw new Error("Timed out waiting for command selection frame") + await Bun.sleep(10) + } +} diff --git a/packages/tui/test/fixture/local.tsx b/packages/tui/test/fixture/local.tsx index 7dac10ac59e..22f55de7994 100644 --- a/packages/tui/test/fixture/local.tsx +++ b/packages/tui/test/fixture/local.tsx @@ -88,7 +88,7 @@ export async function renderLocal( ), { width: 100, height: 30, kittyKeyboard: true }, ) - await setup.waitFor(() => local !== undefined && local.model.ready) + await waitForModel(() => local !== undefined && local.model.ready) await data.location.sync() return { ...setup, @@ -106,6 +106,14 @@ export async function renderLocal( } } +async function waitForModel(ready: () => boolean) { + const started = Date.now() + while (!ready()) { + if (Date.now() - started > 2_000) throw new Error("Timed out waiting for local model data") + await Bun.sleep(10) + } +} + export function model(id: string, variants: string[] = []): ModelInfo { return { id,