Repository navigation
Claude on Copilot: pass Claude Code a modelOverrides map for Copilot's dotted Claude model ids - #68839
Conversation
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
External Claude detection can still receive neither workflow-provided settings nor the required model overrides.
2 open findings
What changed in this PR
Adds Claude model-ID overrides to gh-aw’s Copilot inference path so Claude Code uses the correct reasoning and context defaults.
Changes:
- Add a static override map and warnings for workflow-provided settings.
- Add detector-harness transport and compiler, harness, and catalog tests.
- Document the behavior and regenerate six smoke workflows.
🧠 Review effort: Max
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 1281085
|
Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
…ed detection model for warning Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>


Copilot writes Claude model versions with a dot (
claude-haiku-4.5), but Anthropic uses a hyphen (claude-haiku-4-5). Claude Code doesn't recognise the Copilot id, so it falls back to guessed defaults, including reasoning efforthigh. Copilot rejects that effort for Haiku 4.5 with400 invalid_reasoning_effort, which failssmoke-claude-on-copiloton every run. The other dotted models run on a guessed 200k-token context window.Compiler (
pkg/workflow)claude_copilot_model_overrides.go(new): a static list of the Copilot Claude ids in the catalog. From it, the compiler builds a fixed-order--settingsJSON value that maps each Anthropic id to the Copilot id for the 11 dotted ids. Ids that already match (claude-sonnet-5,claude-opus-5,claude-fable-5,claude-sonnet-4) get no entry.claude_engine.go: when the resolved provider is GitHub (model-provider: githubor acopilot/prefix),--settings <map>is added to the Claude Code command. The map doesn't depend on the model, so fixed, run-time (ANTHROPIC_MODEL) and routed models all get it. The Anthropic provider's output is unchanged.--settings(--settings Xor--settings=X, inengine.argsorsafe-outputs.threat-detection.engine.args): it is kept as is, nothing is added, and compilation emits a warning (configured_model_validation.go).Threat detection
threat-detect --engine copilot, with no map.threat-detection.engine: {id: claude, model-provider: github}, inline path (features.gh-aw-detection: false): uses gh-aw's Claude command builder, so it gets--settingsdirectly.threat-detect --engine claudepath:threat-detectbuilds its own Claude Code arguments, so the detection step instead setsGH_AW_CLAUDE_SETTINGS.claude_harness.cjsappends it as--settingsunless the arguments already have one. Covered from gh-aw only;github/gh-aw-threat-detectionis unchanged.threat-detectlaunches Claude Code through the harness only when the harness file is present; without it, the map doesn't reach Claude Code.Catalog drift guard
models.jsonis embedded inpkg/cliand isn't reachable frompkg/workflow.pkg/cli/model_costs_claude_copilot_ids_test.gofails if the compiler's list drifts from thegithub-copilotClaude ids inmodels.json.models.jsonitself is unchanged.Lock files and docs
docs/.../engines/claude.mddocuments the map and how a workflow-provided--settingsis handled.Notes for reviewers
smoke-claude-on-copilotandsmoke-claude-routedon this branch.smoke-claude-routed'sallowed-modelsis intentionally left unchanged.pkg/cliandactions/setupsession-parser tests fail withCannot find module './otlp_header_helpers.cjs'. Two of them were re-run without this change and fail the same way.TestAgentExecutionNumericReaderParityalso fails. It was not re-run without this change.