Repository navigation
fix(harness): clear error for unknown model id (dot-vs-dash guard) + M6 spec notes - #4
Merged
Merged
Conversation
getModel() returns undefined for an id not in the pi-ai registry (e.g. the dotted claude-sonnet-4.6 is a github-copilot key; the anthropic id is the dash-form claude-sonnet-4-6), which crashed cryptically on baseModel.headers. Add requireModel(provider, modelId): throws a clear error with a dot/dash 'did you mean' suggestion (or known ids / known providers). Document the guard and the headless-lifecycle finding (session_start not emitted; open question on session_compact/turn_end) in the M6 spec. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clear error for unknown model id (+ M6 spec notes)
Follow-up to the merged M6 PR #3. Surfaced while running the live E5 experiment through the litellm gateway.
Problem
getModel(provider, modelId)returnsundefinedfor an id not in the pi-ai registry. A common trap: the dottedclaude-sonnet-4.6is agithub-copilotkey, while theanthropicid is the dash-formclaude-sonnet-4-6. Left unguarded,run-turnthen crashes cryptically on the gateway branch:Fix
requireModel(provider, modelId)wraps the lookup and throws a clear, actionable error:./-), or the known ids;run-turnusesrequireModelin place of the rawgetModelcall. Behavior is unchanged for valid ids; defaults still resolve toanthropic/claude-opus-4-8.Tests
harness/test/run-turn-model.test.ts: +3 cases (known id resolves; dot-vs-dash trap throws naming the dash form; unknown provider throws naming valid providers). 7/7 green, no LLM key needed.Docs
M6 spec updated: §4.2 documents the guard; §7 records the headless-lifecycle finding (
session_startis not emitted in the headlessrunTurnpath — the root cause of the budget-voter fix in PR #3) and flags the open question for M7: whethersession_compact/turn_endlikewise requirebindExtensions(if so, the checkpoint marker is never written in production andopenFromCheckpointalways falls back to full replay).Assisted-By: Claude Code