import { expect } from "e2e";
import { test, WEB } from "./t3.ts";

test("Discovered OpenCode xhigh reasoning is labelled Extra High", WEB, async ({ t3, app, screen, browser }) => {
  const project = await t3.project("Reasoning labels");
  const thread = await t3.thread({ project, title: "OpenCode reasoning", messages: ["hello"] });
  await t3.open("/settings/providers");
  await screen.getByRole("button", "Add provider", { exact: true }).first().tap();
  await screen.getByRole("radio", "OpenCode", { exact: true }).tap();
  await screen.getByRole("button", "Next", { exact: true }).tap();
  await screen.getByRole("button", "Next", { exact: true }).tap();
  await screen.getByRole("button", "Add instance", { exact: true }).tap();
  await t3.open(thread);
  await screen.getByRole("button", "Multi turn", { exact: true }).tap();
  await screen.getByRole("button", "Opencode 2", { exact: true }).tap();
  await screen.getByPlaceholder("Search models...").fill("gpt-5.4");
  await screen.getByRole("option", "GPT-5.4", { exact: false }).first().tap();
  await app.screenshot("opencode-reasoning-options");
  await expect(screen.getByRole("radio", "Extra High", { exact: true })).toBeVisible();
});
