Skip to content

fix(daemon): map opus, sonnet and haiku model aliases to their current ids - #4005

Open
cavalcanticampos wants to merge 1 commit into
mvschwarz:mainfrom
cavalcanticampos:fix/4000-fix-daemon-map-opus-sonnet-and-haiku-mod
Open

cavalcanticampos wants to merge 1 commit into
mvschwarz:mainfrom
cavalcanticampos:fix/4000-fix-daemon-map-opus-sonnet-and-haiku-mod

Conversation

@cavalcanticampos

@cavalcanticampos cavalcanticampos commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What a user gets

Before: CANONICAL_MODEL_PINS mapped only fable, and to claude-fable-5-1. A seat pinned to opus, sonnet or haiku could never match the full id the runtime reports, so the divergence monitor raised a false divergence for a seat running exactly the model its alias names. rig spec validate also gave no canonical-id nudge for those aliases.

After: every alias in Claude Code's /model picker resolves to the model it currently selects, measured from the existing fixture packages/daemon/test/fixtures/claude-model-2.1.322.txt:

  • opus → claude-opus-5-5
  • fable → claude-fable-5-2 (was claude-fable-5-1; the 2.1.322 picker lists Fable 5.2)
  • sonnet → claude-sonnet-5-5
  • haiku → claude-haiku-5-5

The map is still the single, null-prototype mapping home. No comparison logic changed.

Fixes #4000

How you verified it

  • New tests in model-divergence-monitor.test.ts:
    • each alias matches its id;
    • an opus-pinned claude-code seat running claude-opus-5-5 makes no proclamation;
    • opus[1m] matches;
    • an alias on the wrong model still diverges, and opusplan stays unmapped.
  • spec-validation-advisory.test.ts now covers the opus, sonnet and haiku advisories.
  • Run against the unchanged spec-validation-advisory.ts, these tests fail. The monitor test proclaims pinned=opus effective=claude-opus-5-5. With the change they pass.
  • Existing fable expectations moved to claude-fable-5-2. The rigspec-schema.test.ts fixture now pins claude-sonnet-5-5 instead of sonnet, so its exact-advisory assertions stay about what they test.
  • With the change, these vitest files pass: rigspec-schema, model-divergence-monitor, spec-validation-advisory and startup-orchestrator (510 passed, 1 skipped), plus current-generation-record, plan-model-alias-notice, permission-account, effort-lifecycle-e2e and effective-model-occupant-identity.
  • npm run lint passes.
  • A full daemon suite run on Linux was stopped by my 10-minute limit. Before that, its only failure was one tmux-timing test in rig-teardown.test.ts, which is unrelated to model pins.
  • I did not run npm test or the macOS suites.

Anything you were unsure about

  • These are static mappings, so they go stale when Claude Code moves an alias. A seat on an older Claude Code whose fable still selects 5.1 now reports a divergence. That is the same trade-off fix(daemon): avoid false divergence for Claude model pins #1482 made.
  • The other fix the issue suggests, comparing against the id the runtime resolved the alias to, would remove the staleness but needs a resolution source. I left that out of scope.
  • Specs that pin opus, sonnet or haiku now get the existing fail-open advisory at validate time. No shipped spec pins these aliases.

If this is security-related

Not security-related.

  • One concern per PR; no version bump; no CHANGELOG.md edit
  • Tests added or updated where the change is testable
  • I listed the checks I ran, their results, and any checks I could not run

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated the recognized Claude model aliases to match their current canonical model IDs, including the fable model update.
    • Improved model validation advisories so recognized aliases and their canonical IDs are handled consistently, while unrelated or unmapped model names are not treated as matches.

…t ids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The canonical model map now resolves four Claude aliases to full model IDs, including an updated ID for fable. Tests cover advisory behavior and model divergence matching.

Changes: Claude model aliases

Layer / File(s) Summary
Canonical aliases and advisories
packages/daemon/src/domain/spec-validation-advisory.ts, packages/daemon/test/spec-validation-advisory.test.ts
The canonical map adds opus, sonnet, and haiku, and updates fable to claude-fable-5-2. Advisory tests check the aliases and canonical IDs.
Divergence matching coverage
packages/daemon/test/model-divergence-monitor.test.ts, packages/daemon/test/rigspec-schema.test.ts
Tests cover alias matching, mismatches, context-window pins, and snapshot pins. The rig-spec fixture uses claude-sonnet-5-5.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: mvschwarz, openrig-review

Merge Risk: Minimal · up to 1ded9

This change maps the Claude aliases opus, sonnet, haiku and fable to their current full model IDs, so pinned seats stop reporting false model divergence. No actionable merge-blocking risk was found, and the daemon tests that were run passed.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the daemon fix and the three aliases it changes (opus, sonnet, haiku). The summary and objectives also say the PR changes the fable mapping from claude-fable-5-1 to claude-fable-5-2, w…
Linked Issues check Passed Issue #4000 asks that every alias Claude Code accepts (opus, sonnet, haiku, fable) map to its current full id, or that the advisory compare against the runtime-resolved id. The PR takes the static-map…
Out of Scope Changes check Passed The source change is limited to the CANONICAL_MODEL_PINS map and its comment in spec-validation-advisory.ts. No comparison logic changed. The test edits in model-divergence-monitor.test.ts and spec-va…
Full details: Title check

Explanation

The title names the daemon fix and the three aliases it changes (opus, sonnet, haiku). The summary and objectives also say the PR changes the fable mapping from claude-fable-5-1 to claude-fable-5-2, which the title leaves out. The title is accurate and specific, but it does not cover every change.

Full details: Linked Issues check

Explanation

Issue #4000 asks that every alias Claude Code accepts (opus, sonnet, haiku, fable) map to its current full id, or that the advisory compare against the runtime-resolved id. The PR takes the static-mapping option. At the reviewed head, packages/daemon/src/domain/spec-validation-advisory.ts defines CANONICAL_MODEL_PINS (still a null-prototype object) with opus -> claude-opus-5-5, fable -> claude-fable-5-2, sonnet -> claude-sonnet-5-5, and haiku -> claude-haiku-5-5. The fixture packages/daemon/test/fixtures/claude-model-2.1.322.txt lists the picker entries as Opus 5.5, Fable 5.2, Sonnet 5.5, and Haiku 5.5, which supports the chosen versions. The fixture shows display names, not full ids, so the full-id strings are an inference from those names. The tests in model-divergence-monitor.test.ts and spec-validation-advisory.test.ts cover the new aliases. The required coding change is present. Related #1926 (Bedrock ids) is not in scope and is not required.

Full details: Out of Scope Changes check

Explanation

The source change is limited to the CANONICAL_MODEL_PINS map and its comment in spec-validation-advisory.ts. No comparison logic changed. The test edits in model-divergence-monitor.test.ts and spec-validation-advisory.test.ts update or add cases for the mapped aliases. The rigspec-schema.test.ts change replaces the sonnet alias with claude-sonnet-5-5 in a fixture, which keeps its exact-advisory assertions focused on their target. These changes support the objective. The PR description states no version bump and no CHANGELOG edit, and the diff shows no unrelated files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b766a2a9-c5e9-47da-8841-a044bcc11375
Commits

Reviewing files that changed from the base of the PR and between f83b04e and 1ded934.

Files selected for processing: 4

  • packages/daemon/src/domain/spec-validation-advisory.ts
  • packages/daemon/test/model-divergence-monitor.test.ts
  • packages/daemon/test/rigspec-schema.test.ts
  • packages/daemon/test/spec-validation-advisory.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@mvschwarz

Copy link
Copy Markdown
Owner

Thanks, @cavalcanticampos, for the focused patch and for spelling out the alias-table limitation. While we were reviewing it, @dannykeane replied on #4000: they'd prefer runtime-resolved IDs and have offered to send a fix. Could you coordinate there so the two changes don't duplicate each other's work? Your alias cases and tests are useful input to that discussion.

One concrete point on this patch: please leave fable at claude-fable-5-1, with its existing tests. Mapping it unconditionally to claude-fable-5-2 makes a seat pinned to fable and observed on claude-fable-5-1 compare as divergent. As your description notes, updating one global entry doesn't solve the difference between runtime versions. We're not asking you to build a separate version-aware resolver here.

We can review this as a narrow alias-table correction while discussing the runtime-resolved approach; that doesn't settle the longer-term design or promise a merge. Thanks for bringing the fix and the trade-off together.

@mvschwarz mvschwarz added this to the v0.7.25 milestone Nov 26, 2026
@mvschwarz mvschwarz moved this to In Progress in OpenRig roadmap Nov 26, 2026
@mvschwarz mvschwarz modified the milestones: v0.7.25, v0.7.26, v0.7.27 Nov 28, 2026
@mvschwarz

Copy link
Copy Markdown
Owner

Hi @cavalcanticampos, a friendly check-in on our last comment. Its one change is still open: please leave fable at claude-fable-5-1, with its existing tests.

Since then, the order is set on #4000 (our comment there): #4005 and its tests first, with fable kept at claude-fable-5-1, then @dannykeane's #4010 rebased on top of it. That comment also asked for one small change here: "Fixes #4000" to "Refs #4000" in the description, since this PR covers only the alias table.

Are you still planning to update #4005?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Model divergence advisory can't resolve opus/sonnet aliases: CANONICAL_MODEL_PINS maps only fable

2 participants