mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-11 06:30:25 +00:00
Enable Claude extended thinking by default, drop the settings field
Fixed 8192 budget; the provider profile key stays a hidden override (0 = off). Per-turn composer control is future work.
This commit is contained in:
@@ -328,7 +328,7 @@ const PROVIDERS = [
|
||||
// openai: configured + used (drives the "Last used" sub-line and the status dot).
|
||||
{ name: "openai", title: "OpenAI", needs_key: true, fields: [{ key: "api_key", label: "OpenAI API key", secret: true, required: true, help: "", placeholder: "sk-…" }], configured: true, values: {}, suggested_models: ["gpt-5.5"], key_set_at: "2026-06-12", last_used_at: Math.floor(Date.now() / 1000) - 7200 },
|
||||
// anthropic: configured but never used ("Not used yet").
|
||||
{ name: "anthropic", title: "Claude (Anthropic)", needs_key: true, fields: [{ key: "api_key", label: "API key", secret: true, required: true, help: "", placeholder: "sk-…" }, { key: "thinking_budget", label: "Extended thinking budget (tokens, optional)", secret: false, required: false, help: "Turns on Claude's extended thinking for every request.", placeholder: "e.g. 8192 — blank = off" }], configured: true, values: {}, suggested_models: ["claude-opus-4-8"], key_set_at: null, last_used_at: null },
|
||||
{ name: "anthropic", title: "Claude (Anthropic)", needs_key: true, fields: [{ key: "api_key", label: "API key", secret: true, required: true, help: "", placeholder: "sk-…" }], configured: true, values: {}, suggested_models: ["claude-opus-4-8"], key_set_at: null, last_used_at: null },
|
||||
// zai: an OpenAI-compatible vendor — unconfigured, with a prefilled editable endpoint + blurb.
|
||||
{ name: "zai", title: "Z AI (GLM)", needs_key: true, blurb: "Uses Z AI's OpenAI-compatible API — the endpoint is prefilled, just add your key.", fields: [{ key: "api_key", label: "Z AI API key", secret: true, required: true, help: "", placeholder: "" }, { key: "base_url", label: "Endpoint", secret: false, required: false, help: "Prefilled with Z AI's international endpoint.", placeholder: "https://api.z.ai/api/paas/v4", default: "https://api.z.ai/api/paas/v4" }], configured: false, values: {}, suggested_models: ["glm-5.2"], key_set_at: null, last_used_at: null },
|
||||
// ollama: keyless local provider — "configured" without proving anything runs; the
|
||||
|
||||
@@ -53,20 +53,21 @@ test("a configured provider's form opens with the saved state, no plaintext key"
|
||||
await expect(page.getByTestId("set-field-api_key")).toHaveAttribute("placeholder", "••••••••");
|
||||
});
|
||||
|
||||
test("non-secret extras blur-save on a configured provider (thinking budget)", async ({
|
||||
test("non-secret fields blur-save on a configured provider (ollama endpoint)", async ({
|
||||
page,
|
||||
}) => {
|
||||
// Owner-hit 2026-07-23: typed a thinking budget, left Settings, value silently never
|
||||
// saved — the Test button was the form's only save path. Blur now saves extras.
|
||||
// Owner-hit 2026-07-23 (as the thinking-budget field, since folded into a default):
|
||||
// the Test button was the form's only save path — typing into a non-secret field and
|
||||
// leaving Settings silently discarded it. Blur now saves.
|
||||
await openModels(page);
|
||||
await page.getByTestId("set-provider-anthropic").click();
|
||||
const budget = page.getByTestId("set-field-thinking_budget");
|
||||
await budget.fill("8192");
|
||||
await budget.blur();
|
||||
await expect(page.getByTestId("set-field-saved-thinking_budget")).toBeVisible();
|
||||
await page.getByTestId("set-provider-ollama").click();
|
||||
const endpoint = page.getByTestId("set-field-base_url");
|
||||
await endpoint.fill("http://127.0.0.1:9999");
|
||||
await endpoint.blur();
|
||||
await expect(page.getByTestId("set-field-saved-base_url")).toBeVisible();
|
||||
|
||||
// Leave and come back: the value survived (served from the provider's stored values).
|
||||
await page.getByTestId("set-back").click();
|
||||
await page.getByTestId("set-provider-anthropic").click();
|
||||
await expect(page.getByTestId("set-field-thinking_budget")).toHaveValue("8192");
|
||||
await page.getByTestId("set-provider-ollama").click();
|
||||
await expect(page.getByTestId("set-field-base_url")).toHaveValue("http://127.0.0.1:9999");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user