[PR #6870] [MERGED] feat(anthropic): add Claude Sonnet 5.5 #7361

Closed
opened 2026-10-23 04:19:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6870
Author: @SpicyMarinara
Created: 9/29/2026
Status: ✅ Merged
Merged: 9/29/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/claude-sonnet-5-5


📝 Commits (5)

  • 1d8001b feat(anthropic): add Claude Sonnet 5.5
  • 837c7b5 Merge remote-tracking branch 'origin/staging' into feat/claude-sonnet-5-5
  • af3e17d docs(anthropic): note Sonnet 5.5 between_tools normalization at Off sites
  • 753874e fix(anthropic): match strict Claude IDs for history system messages
  • dcb7625 Merge branch 'staging' into feat/claude-sonnet-5-5

📊 Changes

8 files changed (+427 additions, -34 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
➕ e2e/claude-sonnet55.e2e.ts (+73 -0)
📝 packages/server/src/services/llm/providers/anthropic.provider.ts (+36 -19)
📝 packages/server/src/services/llm/providers/claude-subscription.provider.ts (+9 -4)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+12 -10)
📝 packages/shared/src/constants/model-lists.ts (+20 -1)
➕ scripts/regressions/claude-sonnet55.regression.ts (+273 -0)
📝 scripts/regressions/generation-parameter-relevance.regression.ts (+3 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6869

Why this change

  • Anthropic released Claude Sonnet 5.5 (claude-sonnet-5-5) on 2026-09-28, and Marinara should offer it. Sources: the model page and What's new.
  • The existing Claude 5 pattern already matches claude-sonnet-5-5, which covers sampling stripping and xhigh/max. It would also have sent Sonnet 5's thinking: {type: "disabled"} for Off, and Sonnet 5.5 rejects that with a 400. Sonnet 5.5 also rejects forced tool_choice (any/tool), and it rejects assistant prefill like Sonnet 5. Without this PR, Off, forced agent tool calls and Continue would fail.

What changed

  • Catalog: claude-sonnet-5-5 in ANTHROPIC_MODELS and CLAUDE_SUBSCRIPTION_MODELS (1M context, 128K output). findKnownModel resolves dotted gateway IDs (anthropic/claude-sonnet-5.5, claude-sonnet-5.5), as it already does for Opus 5.5.
  • New predicates in model-lists.ts: isClaudeSonnet55Model, and isClaudeStrictRequestModel (Opus 5.5 plus Sonnet 5.5). Opus 5.5's existing request normalization now uses the strict predicate everywhere its rule also holds for Sonnet 5.5:
    • Anthropic: no samplers, forced tool choice → auto, prefill → continuation prompt.
    • Gateways: no reasoning disable, effort none → low, auto tool choice, no saved samplers.
    • Subscription: saved settings can't disable thinking.
  • Off on the Anthropic API is sent as thinking: {"type": "between_tools"}. That's the documented replacement for disabled: no other fields, and it's accepted only at low/medium/high effort. Above high it falls back to adaptive. A saved custom disabled is translated too.
  • Off on Claude (Subscription), OpenRouter and compatible gateways runs adaptive at low effort. The pinned Claude Agent SDK (0.3.282, ThinkingConfig = adaptive | enabled | disabled) and OpenAI-style reasoning fields can't express between_tools. This is marked with a ponytail: comment naming the upgrade path.
  • History-level system messages are enabled for Sonnet 5.5 (supported, unlike Sonnet 5).
  • Unchanged: Sonnet 5.5's default effort (high, versus Opus 5.5's medium), Opus 5.5 behavior, and Sonnet 5 behavior. The regressions pin all three.
  • Tests:
    • New claude-sonnet55 regression.
    • New e2e/claude-sonnet55.e2e.ts.
    • Sonnet 5.5 added to the parameter-relevance truth table (Anthropic, Subscription, OpenRouter).
  • One Unreleased changelog entry.

Thinking blocks are bound to the model and conversation on Sonnet 5.5, but Marinara doesn't replay signed thinking blocks, so this doesn't affect it.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated checks run locally on 1d8001bb6:

  • claude-sonnet55 regression, 6/6 checks. It covers:
    • catalog on every surface;
    • native requests at every effort (adaptive, default high, no samplers, auto tool choice);
    • native Off → exactly {type: "between_tools"}, including a translated saved disabled, with adaptive above high;
    • Sonnet 5 still disabled;
    • continuation without prefill and history system messages kept in place;
    • OpenRouter/Custom/NanoGPT: Off → low, no samplers, auto;
    • Subscription: Off → adaptive low, never disabled.
  • With the three provider changes reverted, 5 of those 6 checks fail. The catalog check passes, because the shared entries stay.
  • The 31 other regressions that touch the Anthropic, subscription or OpenAI providers or the model lists pass. These include claude-opus55, claude-subscription-cache, provider-compat and generation-parameter-relevance with Sonnet 5.5 added.
  • e2e/claude-sonnet55.e2e.ts: 6/6 (Anthropic and Subscription × desktop Chromium, mobile Chromium, mobile WebKit). It covers picker selection (1.0M / 128K), and Off and max persisting across a reload.
  • Local CodeRabbit review (--committed against the staging merge base): 0 findings.
  • The full pnpm check result is reported in a follow-up comment.

Manual verification notes

  • Manually verify with a real Anthropic key:
    • Send a Roleplay and a Conversation message on claude-sonnet-5-5 at the default effort and at max.
    • Set reasoning Off and confirm the request succeeds. No 400 about disabled should appear, and replies should start without up-front thinking.
    • Trigger an agent that forces a tool call and confirm it runs with automatic tool choice.
    • Use Continue on a partial reply and confirm it continues without a prefill error.
  • Manually verify with a Claude subscription: Sonnet 5.5 with Off succeeds (it runs at low effort).
  • Manually verify through OpenRouter (anthropic/claude-sonnet-5.5): the model is recognized with 1M context, and Off succeeds.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Only CHANGELOG.md changes. No user-facing docs list individual Claude models, and there is no new UI copy.

UI evidence (if applicable)

Playwright (e2e/claude-sonnet55.e2e.ts) selects Sonnet 5.5 from the model picker (1.0M context, 128K output) on Anthropic and Claude (Subscription). The Reasoning Effort control offers Off (unlike Opus 5.5), and Off and max both persist across a reload.

Summary by CodeRabbit

  • New Features
    • Added Claude Sonnet 5.5 for Anthropic and Claude Subscription connections, with a 1M-token context window and a 128K output limit.
    • Added reasoning effort options from low to max. When reasoning is Off, Anthropic skips upfront thinking; Claude Subscription and compatible gateways use low effort where Off isn’t supported.
    • For supported Claude models, forced tool calls use automatic tool selection, and sampling settings are not applied.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6870 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/29/2026 **Status:** ✅ Merged **Merged:** 9/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/claude-sonnet-5-5` --- ### 📝 Commits (5) - [`1d8001b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1d8001bb652a9b9ad5ac7b5cc4813da820df45bb) feat(anthropic): add Claude Sonnet 5.5 - [`837c7b5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/837c7b5a5fd9afbc7f8ca51d910a4cbfed35baf2) Merge remote-tracking branch 'origin/staging' into feat/claude-sonnet-5-5 - [`af3e17d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/af3e17df34f54ea4cc5744be68b89d8f6ffc6e7f) docs(anthropic): note Sonnet 5.5 between_tools normalization at Off sites - [`753874e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/753874e1fcbf271c7aa5ac43b68204fbde441b7a) fix(anthropic): match strict Claude IDs for history system messages - [`dcb7625`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dcb762526f7a70c24e206569e5bb33eada191c0d) Merge branch 'staging' into feat/claude-sonnet-5-5 ### 📊 Changes **8 files changed** (+427 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) ➕ `e2e/claude-sonnet55.e2e.ts` (+73 -0) 📝 `packages/server/src/services/llm/providers/anthropic.provider.ts` (+36 -19) 📝 `packages/server/src/services/llm/providers/claude-subscription.provider.ts` (+9 -4) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+12 -10) 📝 `packages/shared/src/constants/model-lists.ts` (+20 -1) ➕ `scripts/regressions/claude-sonnet55.regression.ts` (+273 -0) 📝 `scripts/regressions/generation-parameter-relevance.regression.ts` (+3 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6869 ## Why this change - Anthropic released **Claude Sonnet 5.5** (`claude-sonnet-5-5`) on 2026-09-28, and Marinara should offer it. Sources: the [model page](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) and [What's new](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5). - The existing Claude 5 pattern already matches `claude-sonnet-5-5`, which covers sampling stripping and `xhigh`/`max`. It would also have sent Sonnet 5's `thinking: {type: "disabled"}` for Off, and Sonnet 5.5 rejects that with a 400. Sonnet 5.5 also rejects forced `tool_choice` (`any`/`tool`), and it rejects assistant prefill like Sonnet 5. Without this PR, Off, forced agent tool calls and Continue would fail. ## What changed - **Catalog:** `claude-sonnet-5-5` in `ANTHROPIC_MODELS` and `CLAUDE_SUBSCRIPTION_MODELS` (1M context, 128K output). `findKnownModel` resolves dotted gateway IDs (`anthropic/claude-sonnet-5.5`, `claude-sonnet-5.5`), as it already does for Opus 5.5. - **New predicates** in `model-lists.ts`: `isClaudeSonnet55Model`, and `isClaudeStrictRequestModel` (Opus 5.5 plus Sonnet 5.5). Opus 5.5's existing request normalization now uses the strict predicate everywhere its rule also holds for Sonnet 5.5: - Anthropic: no samplers, forced tool choice → `auto`, prefill → continuation prompt. - Gateways: no reasoning disable, effort `none` → `low`, `auto` tool choice, no saved samplers. - Subscription: saved settings can't disable thinking. - **Off on the Anthropic API** is sent as `thinking: {"type": "between_tools"}`. That's the documented replacement for `disabled`: no other fields, and it's accepted only at `low`/`medium`/`high` effort. Above `high` it falls back to adaptive. A saved custom `disabled` is translated too. - **Off on Claude (Subscription), OpenRouter and compatible gateways** runs adaptive at `low` effort. The pinned Claude Agent SDK (0.3.282, `ThinkingConfig` = adaptive | enabled | disabled) and OpenAI-style reasoning fields can't express `between_tools`. This is marked with a `ponytail:` comment naming the upgrade path. - **History-level system messages** are enabled for Sonnet 5.5 (supported, unlike Sonnet 5). - **Unchanged:** Sonnet 5.5's default effort (`high`, versus Opus 5.5's `medium`), Opus 5.5 behavior, and Sonnet 5 behavior. The regressions pin all three. - **Tests:** - New `claude-sonnet55` regression. - New `e2e/claude-sonnet55.e2e.ts`. - Sonnet 5.5 added to the parameter-relevance truth table (Anthropic, Subscription, OpenRouter). - One Unreleased changelog entry. Thinking blocks are bound to the model and conversation on Sonnet 5.5, but Marinara doesn't replay signed thinking blocks, so this doesn't affect it. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated checks run locally on `1d8001bb6`: - `claude-sonnet55` regression, 6/6 checks. It covers: - catalog on every surface; - native requests at every effort (adaptive, default `high`, no samplers, `auto` tool choice); - native Off → exactly `{type: "between_tools"}`, including a translated saved `disabled`, with adaptive above `high`; - Sonnet 5 still `disabled`; - continuation without prefill and history system messages kept in place; - OpenRouter/Custom/NanoGPT: Off → `low`, no samplers, `auto`; - Subscription: Off → adaptive `low`, never `disabled`. - With the three provider changes reverted, 5 of those 6 checks fail. The catalog check passes, because the shared entries stay. - The 31 other regressions that touch the Anthropic, subscription or OpenAI providers or the model lists pass. These include `claude-opus55`, `claude-subscription-cache`, `provider-compat` and `generation-parameter-relevance` with Sonnet 5.5 added. - `e2e/claude-sonnet55.e2e.ts`: 6/6 (Anthropic and Subscription × desktop Chromium, mobile Chromium, mobile WebKit). It covers picker selection (1.0M / 128K), and Off and max persisting across a reload. - Local CodeRabbit review (`--committed` against the staging merge base): 0 findings. - The full `pnpm check` result is reported in a follow-up comment. ### Manual verification notes - Manually verify with a real Anthropic key: - Send a Roleplay and a Conversation message on `claude-sonnet-5-5` at the default effort and at `max`. - Set reasoning Off and confirm the request succeeds. No 400 about `disabled` should appear, and replies should start without up-front thinking. - Trigger an agent that forces a tool call and confirm it runs with automatic tool choice. - Use Continue on a partial reply and confirm it continues without a prefill error. - Manually verify with a Claude subscription: Sonnet 5.5 with Off succeeds (it runs at low effort). - Manually verify through OpenRouter (`anthropic/claude-sonnet-5.5`): the model is recognized with 1M context, and Off succeeds. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Only `CHANGELOG.md` changes. No user-facing docs list individual Claude models, and there is no new UI copy. ## UI evidence (if applicable) Playwright (`e2e/claude-sonnet55.e2e.ts`) selects Sonnet 5.5 from the model picker (1.0M context, 128K output) on Anthropic and Claude (Subscription). The Reasoning Effort control offers Off (unlike Opus 5.5), and Off and max both persist across a reload. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Claude Sonnet 5.5 for Anthropic and Claude Subscription connections, with a 1M-token context window and a 128K output limit. * Added reasoning effort options from low to max. When reasoning is Off, Anthropic skips upfront thinking; Claude Subscription and compatible gateways use low effort where Off isn’t supported. * For supported Claude models, forced tool calls use automatic tool selection, and sampling settings are not applied. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:01 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7361
No description provided.