Skip to content

fix(web): default new LLM agents to claude-sonnet-4-6 - #822

Merged
pikann merged 2 commits into
Paca-AI:masterfrom
AyhamJo7:fix/create-agent-default-model
Nov 23, 2026
Merged

pikann merged 2 commits into
Paca-AI:masterfrom
AyhamJo7:fix/create-agent-default-model

Conversation

@AyhamJo7

Copy link
Copy Markdown
Contributor

Summary

The create-agent dialog (apps/web/src/components/projects/agents/create-agent-dialog.tsx) starts a new LLM agent on claude-sonnet-4-5-20250929, both in its initial state and when the form resets. Anthropic retires that model on 2026-11-30 (model deprecations), and the retirement covers the undated claude-sonnet-4-5 alias too. After that, an agent created with the untouched default fails on every run. Every preset in apps/web/src/lib/agent-api.ts already uses defaultLLMModel: "claude-sonnet-4-6", so the dialog's two defaults now match the presets.

Not changed: the llm_models.json catalog in services/agent-runner (a list to pick from) and the e.g. claude-sonnet-4-5 placeholder strings in the locale files.

Type of Change

  • Other (bug fix)

Checklist

  • The change is focused and scoped.
  • Related documentation is updated (none names this default).

Tests

  • New test in create-agent-dialog.test.tsx ("default LLM model") creates a global LLM agent without touching the model, and checks that createGlobalAgent receives llm_model: "claude-sonnet-4-6". It fails on master ("llm_model": "claude-sonnet-4-5-20250929") and passes with this change.
  • vitest run src/components/projects/agents/: 13 files, 180 passed.
  • tsc -b --noEmit and biome check on the changed files are clean.
  • I ran vitest under Node 24. Under Node 26, the test file fails to load before any test runs (Cannot read properties of undefined (reading 'getItem')), because Node's own localStorage global shadows jsdom's. That's unrelated to this change.

The create-agent dialog started on claude-sonnet-4-5-20250929, which Anthropic retires on 2026-11-30, while every agent preset already defaults to claude-sonnet-4-6. The dialog's initial and reset model now match the presets.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Two minor suggestions inline — the behavioral change itself is correct and complete.

Approach: sound — the dialog's default now matches every preset, and the change covers both places the dialog sets it.

Reviewed changes

  • Default model — create-agent-dialog.tsx initialises and resets modelSelect to claude-sonnet-4-6; I confirmed the id is in llm_models.json, so the model <Select> renders it as a real option rather than an unknown value.
  • Regression test — the new CreateAgentDialog — default LLM model case creates a global LLM agent with untouched fields and asserts llm_model: "claude-sonnet-4-6".
  • Premise — Anthropic's deprecation table does list claude-sonnet-4-5-20250929 as retiring 2026-11-30 (the undated alias included), while claude-sonnet-4-6 is Active.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

The presets, the dialog's initial and reset model, and the test each repeated the model id, so they could drift apart again unnoticed. DEFAULT_LLM_MODEL in agent-api.ts is now the only copy. The test fills the base URL and API key through their labels.
@AyhamJo7

Copy link
Copy Markdown
Contributor Author

Both suggestions are in f080b90:

  • DEFAULT_LLM_MODEL is now exported next to AGENT_PRESETS in lib/agent-api.ts. The five presets, the dialog's initial state and its reset all use it, so it is the only copy of the id. The test asserts llm_model: DEFAULT_LLM_MODEL, and also checks that the constant isn't claude-sonnet-4-5-20250929, so pointing the constant back at the retiring model still fails it.
  • The test fills both fields through their labels. /api key/i also matched another element, so it uses screen.getByLabelText(/^API Key/); the base URL uses /base url/i.

vitest run src/components/projects/agents/ src/lib (69 files, 812 passed), tsc -b --noEmit and biome check on the changed files are clean.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: sound — the follow-up commit turns the model id into one exported constant, so the dialog, presets, and test can no longer drift apart.

Reviewed changes (delta since the prior review at 354d82a)

  • Shared constant — DEFAULT_LLM_MODEL is exported from agent-api.ts and all five AGENT_PRESETS now reference it.
  • Dialog defaults — the initial modelSelect state and reset() both read the constant, removing the two duplicated literals.
  • Test cleanup — the regression test imports the constant, drives the Base URL and API Key inputs through screen.getByLabelText, and keeps an explicit check that the constant is not the retired claude-sonnet-4-5-20250929.

grep confirms no production default for the LLM field still hardcodes the old id; the remaining claude-sonnet-4-5 strings are the ACP modelPlaceholder locale entries and the test's own regression assertion. Both prior inline threads are addressed.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit 0d9e56c into Paca-AI:master Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants