Skip to content

fix(mod): dispatch native Claude workers on advertised model IDs - #115

Merged
PBJ-2 merged 3 commits into
PBJ-2:mainfrom
RedBoardDev:fix/mod-native-claude-model-ids
Oct 30, 2026
Merged

PBJ-2 merged 3 commits into
PBJ-2:mainfrom
RedBoardDev:fix/mod-native-claude-model-ids

Conversation

@RedBoardDev

@RedBoardDev RedBoardDev commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolve native Claude worker family aliases to the concrete model IDs already declared in CLAUDE_WORKERS before dispatching a subagent.

The catalogue advertises concrete Claude versions, but spawnModel() previously returned aliases such as sonnet. Claude Code resolved those aliases independently, so the dispatched version was not guaranteed to match the advertised worker. This is a product-level consistency fix, not a user-specific settings change.

  • Share the existing worker table between advertised candidates and actual model selection; do not duplicate version constants.
  • Normalize automatic selections and applicable direct worker spawns before dispatch and title generation.
  • Preserve explicit versioned IDs, custom/routed models, inheritance, context annotations and effort suffixes.
  • Keep engine-owned spawn boundaries and provider-disable checks intact.
  • Add real mod-engine dispatch regressions, not just display-name assertions.

Scope

No global settings.json edits, no router-wide replacement of explicitly selected older models, and no changes to the Auto mode security classifier.

Validation

  • node --test test/mod/*.test.ts: 169 passed, 0 failed.
  • npm run typecheck: passed.
  • npm run check:mod: passed.
  • git diff --check: passed.
  • claude plugin test packages/mod: 329 passed, 9 failed, 338 total. All 37 newly added engine dispatch cases passed.

The full engine suite is not green with the installed Claude Code 2.1.309 engine. I also ran it against an untouched worktree at the same upstream base: 292 passed, the same 9 tests failed, 301 total. Eight failures concern the existing ui.view API/tests; one concerns the existing Workflow spawn-rewrite test, which this engine disallows. The final branch introduces no additional failing test names. These compatibility failures were left unchanged rather than weakening the tests or altering unrelated behavior.

The engine regressions intercept the actual agent.spawn dispatch boundary with external effects stubbed. No live inference, user configuration, or running router was changed by this PR.

Windows CI baseline

The Windows job is still failing, but this is also true of the unchanged upstream base:

These failures are in existing CLI ownership/launcher/tray and remote filesystem tests, not the native Claude model-dispatch tests. Windows portability fixes are separately proposed in PBJ-2/clauderipple#98. They have not been folded into this focused PR, and Windows CI is not claimed to pass.

@PBJ-2 PBJ-2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks — resolving the worker aliases through CLAUDE_WORKERS so the advertised version is the one that runs is the right fix, and it merges cleanly on current main (typecheck, test/mod 174/174, engine tests 341/341 here). The Windows job failure is the pre-existing one that #98 fixed; the failing test names are identical to main's at 1bd2580.

One change before merging:

  • Don't put @level on a native claude-* id. register.tsx (marker branch, ~L2256) now sends claude-sonnet-5-5@high for model: 'sonnet' + [[ripple: sonnet@high]], and native-models.test.tsx:74-84 pins that. The router only splits @effort off routed models; a claude-* id is passed through byte for byte (routing.ts PASS), so the suffix would reach Anthropic as part of the model name. With [1m] in front it also defeats the CLI's trailing-[1m] strip (claude-sonnet-5-5[1m]@high). Native workers already get their effort through the spawn's effort field (register.tsx ~L1912) — please carry the level there (or drop it) and update the test.

Smaller, optional:

  • if (e.resume) return next(e) (~L2193) also skips the disabled-provider and nested-worker denials. Skipping only the content rewrite on resume would keep the fail-closed policy from the 2026-10-25 decision in ARCHITECTURE.
  • Since the ids are now pinned, a retired model makes that worker fail hard instead of sliding to the CLI default. A line in ARCHITECTURE saying CLAUDE_WORKERS must be updated on a model change would help.

PBJ-2 and others added 2 commits October 30, 2026 15:10
The router passes a claude-* id through byte for byte, so claude-sonnet-5-5@high
would reach Anthropic as the model name and hide a trailing [1m] from the
CLI's strip. The marker is still consumed; the level is dropped.

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

@PBJ-2 PBJ-2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Pushed the one requested change onto this branch (d174d7b): a direct native marker's model now goes out as the bare concrete id, with no @level. Also merged current main. Engine tests 341/341 and test/mod 174/174 pass. Merging — thanks!

@PBJ-2
PBJ-2 merged commit 3f0c434 into PBJ-2:main Oct 30, 2026
2 of 3 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