Skip to content

refactor(models): Claude Sonnet 5.5 is the platform default (was Sonnet 4.6) (#4757) - #4758

Merged
vybe merged 5 commits into
devfrom
feature/4757-sonnet-55-default
Nov 24, 2026
Merged

vybe merged 5 commits into
devfrom
feature/4757-sonnet-55-default

Conversation

@trinity-ability

@trinity-ability trinity-ability commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4757

Operator request, 2026-11-24: make Sonnet 5.5 the system default (it was Sonnet 4.6).

What an upgraded install with no chosen default does

Trinity never seeded a platform_default_model row, so an install where no admin saved a default reads the code default. After this release:

  1. Agents restarted on the rebuilt base image have Claude Code 2.1.322 and the new trinity.claude-code-version label. Every turn that names no model, and that the agent's own model does not cover, runs on claude-sonnet-5-5.
  2. Agents still running an older base image have no label, or a CLI older than 2.1.284 (Sonnet 5.5's min_claude_code). Their turns keep running on claude-sonnet-4-6, exactly as before. They do not fail model_unsupported. The backend logs one warning per agent: [#4757] <agent>'s Claude Code (…) cannot run the platform default claude-sonnet-5-5; its turns run on claude-sonnet-4-6 until it restarts on the current base image. The existing fleet_base_image_stale alert names those agents. Restarting one moves it to 5.5.
  3. Settings → Platform shows Sonnet 5.5 (recommended) as the default.

An install whose admin saved a default keeps that value and runs it exactly as before this PR, on every image, restarted or not: the step-down never touches a saved value.

An unlabelled image is treated as older, so an agent on such an image keeps the older model (Sonnet 4.6) until it is restarted onto the rebuilt image.

Design

Nothing told the backend which Claude Code an agent runs. min_claude_code was only checked against the base-image pin in CI. So:

  • docker/base-image/Dockerfile: LABEL trinity.claude-code-version="${CLAUDE_CODE_VERSION}". Docker merges image labels into container labels.
  • docker_service.get_agent_claude_code_version: reads the label and never raises.
  • model_catalog: recommended moves to claude-sonnet-5-5. New OLD_CLI_DEFAULT_MODEL = "claude-sonnet-4-6", asserted at import to need no minimum CLI and to be admin-selectable. New claude_code_can_run(model, cli_version): an absent or unparseable version is not proof.
  • agent_model_service.resolve_default_model, the one resolver every no-model path uses (task, schedule, loop, reminder, A2A, chat, Workspace): only the platform-default rung is checked, and only when that default is the code default (no saved row). If the default has no min_claude_code, no container is read. Explicit per-turn/per-schedule models and the agent's own default_model are not touched (AC4). Non-Claude runtimes still get None, and OpenCode keeps its own default (AC5).
  • settings_service.PLATFORM_DEFAULT_MODEL_VALUE = "claude-sonnet-5-5".
  • Agent image: the three hard-coded fallbacks become one headless_executor.DEFAULT_CLAUDE_MODEL, re-exported by claude_code.py. A test keeps it equal to the backend constant.
  • Frontend: Settings.vue seeds from the catalog's recommended entry. TasksPanel.vue now defaults to no model (placeholder "Default model"). It used to post a hard-coded claude-sonnet-4-6 as an explicit model. Moving that to 5.5 would have bypassed the step-down and broken old-image agents from the Tasks tab, so it is empty now and the backend resolves the model. A remembered per-agent choice is still sent.

Behaviour notes

  • The step-down applies only when no admin saved a platform default (settings_service.platform_default_model_is_saved()). A saved default, including Sonnet 5.5 or Opus 5.5, is used as saved, exactly as before this PR.
  • With no remembered choice, a Tasks-tab task now runs on the agent's own model if it has one, rather than a forced Sonnet 4.6. That is the ent#1202 ladder applied to this form too.

Release notes: "Config keys whose behaviour changed"

To carry into the next release notes (no draft file exists after v1.0.5):

  • platform_default_model (system setting, Settings → Platform): the default moves claude-sonnet-4-6 → claude-sonnet-5-5 (refactor: make Claude Sonnet 5.5 the platform default model (was Sonnet 4.6) #4757). An install that never saved a value moves on upgrade, and a saved value is kept. An agent still on a base image older than this release keeps running on claude-sonnet-4-6 until it restarts on the rebuilt image. The stale-base-image alert lists those agents.

Tests

  • tests/unit/test_4757_sonnet_55_default.py: 26 tests. They run through the real resolve_default_model, the real get_platform_default_model and the real agent-image _setup_headless_command. One of them, test_the_default_cli_reader_is_the_container_label, patches docker_service.get_agent_container, so the production label wiring is exercised.
    • TestSavedDefaultIsNeverSteppedDown (added in the fix round): a saved default runs as saved on an unlabelled, older or unparseable image and reads no container; it is driven through the real settings_service too. Mutation: with the saved-default guard in _runnable_platform_default removed, 5 of these go red. Restored, all 26 pass.
    • Mutation check: with the step-down line in the resolver removed, 5 go red (test_image_without_the_version_label_steps_down, …older_than_the_models_minimum…, …unparseable_label…, …failed_container_read…, …default_cli_reader_is_the_container_label). Restored, all pass.
  • src/frontend/tests/unit/tasksPanelModelDefault4757.spec.js: mounted. With || 'claude-sonnet-5-5' put back in the panel, posts no model when none was chosen goes red.
  • Updated tests that pinned the old value: test_platform_default_model.py, test_platform_default_model_regression.py (now pin DEFAULT_CLAUDE_MODEL), test_2086_model_catalog_parity.py.
  • I ran 38 related backend unit files: 1359 passed, 1 failed. The failure is test_ent754_agent_server_skillinfo.py::test_a_different_home_keeps_both_folders; it fails the same way on untouched dev in this container, because of the home path, and is unrelated. Frontend: the 32 TasksPanel/Settings/ModelSelector specs plus the ratchets pass (609 tests).

Deploy

Base-image change: rebuild needed (./scripts/deploy/build-base-image.sh). Agents get the label and the 5.5 fallback at their next cold start.

Docs: model-selection.md (table + revision row), feature-flows.md index, workspace-model-choice.md, architecture/agent-runtime.md (label paragraph), user docs agents/agent-configuration.md.

🤖 Generated with Claude Code

…et 4.6) (#4757)

- PLATFORM_DEFAULT_MODEL_VALUE and the catalog's `recommended` flag move to
  claude-sonnet-5-5. No row is seeded, so an install that never chose a
  default moves on upgrade; an admin's saved choice is kept.
- The base image labels itself with its Claude Code version
  (trinity.claude-code-version). The platform-default rung steps down to
  claude-sonnet-4-6 (model_catalog.OLD_CLI_DEFAULT_MODEL, no minimum) for an
  agent whose label is absent, unparseable or below the default's
  min_claude_code, so an older image does not start failing
  model_unsupported. Explicit models and the agent's own default are not
  stepped down; non-Claude runtimes unchanged.
- Agent image fallbacks become one DEFAULT_CLAUDE_MODEL constant, equal to
  the backend default (tested). Settings.vue seeds from the catalog's
  recommended entry; TasksPanel defaults to no model instead of posting a
  hard-coded id.

Base-image change: rebuild needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@trinity-ability

Copy link
Copy Markdown
Contributor Author

/validate-pr — REQUEST CHANGES (lane C, independent run)

Tier 1 is green (pytest head + base + regression diff, journey-smoke, e2e, prod-image-smoke, verify-non-root). Precedence, non-Claude runtimes and the turn paths are correct. One behaviour regression blocks the merge.

Blocking: a saved admin default that works today is silently downgraded. _runnable_platform_default steps down any platform-default rung that has a min_claude_code, and it treats a missing trinity.claude-code-version label as "too old". No image built before this PR carries the label. So an install that saved claude-opus-5-5 (min 2.1.280) runs it today on v1.0.5 images (CLI 2.1.281). After upgrade, every agent not yet restarted runs claude-sonnet-4-6 instead. Agents on dev images since 2026-11-18 (CLI 2.1.322) are hit the same way for any 5.x default. Reproduced against the head resolver:

admin opus-5-5, no label       -> claude-sonnet-4-6   (ran opus-5-5 before this PR)
admin opus-5-5, label 2.1.281  -> claude-opus-5-5
code default,   no label       -> claude-sonnet-4-6   (intended, AC3)

This goes beyond AC3, which asks only that agents not start failing because of this change. It also cuts against AC2 ("an admin's choice is kept"). The only signal is a backend log line. Settings → Platform and the Workspace roster label still show the admin's model.

This PR requires the following changes before merge:

Not blocking: the Tasks tab change is sound. A remembered choice is still sent. Someone who never picked a model used to get a forced Sonnet 4.6. Now they see "Default model", and the task runs on the agent's own model or the platform default.

Please address these items and request re-review.

@trinity-ability trinity-ability added the status-needs-fix PR has an unaddressed review/validation finding; cleared by the author's next push (#2815) label Nov 24, 2026
Trinity Agent (trinity) and others added 3 commits November 24, 2026 07:55
…4757)

The old-CLI step-down to Sonnet 4.6 now applies only when no admin saved a
platform_default_model. A saved default is used as saved, exactly as before
this PR, so an install already running a newer model keeps it after the
upgrade, restarted or not.

settings_service.platform_default_model_is_saved() reports whether the cached
value came from a row (refreshed in the same block, so cache resets cover it).

Mutation: with the guard in _runnable_platform_default removed, 5 tests in
TestSavedDefaultIsNeverSteppedDown go red; restored, all 26 pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot removed the status-needs-fix PR has an unaddressed review/validation finding; cleared by the author's next push (#2815) label Nov 24, 2026
# Conflicts:
#	tests/registry.json

@vybe vybe 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.

Second independent pass APPROVE at ad03337 on the one finding; since then only a merge of current dev. All checks green.

@vybe
vybe merged commit bad84de into dev Nov 24, 2026
27 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