Repository navigation
Description
Summary
jcode-provider-copilot defines its default model using Anthropic's native id format (hyphens), but the Copilot API only accepts its own catalog ids (dots). Every session that falls back to the default fails immediately with HTTP 400.
// crates/jcode-provider-copilot/src/lib.rs:11
pub const DEFAULT_MODEL: &str = "claude-sonnet-4-6"; // Anthropic format — rejected by Copilot
// crates/jcode-provider-copilot/src/lib.rs:13-14
pub const FALLBACK_MODELS: &[&str] = &[
"claude-sonnet-4.6", // Copilot format — correctThe constant three lines above the fallback list contradicts the list itself.
Reproduce
jcode --provider copilot
> hi
Copilot API error (HTTP 400 Bad Request): {"error":{"message":"The requested model is not
supported.","code":"model_not_supported","param":"model","type":"invalid_request_error"}}
Isolated against the API directly, same token and headers for both:
| model | result |
|---|---|
claude-sonnet-4.6 |
200 OK |
claude-sonnet-4-6 |
400 model_not_supported |
Confirmed on the wire in ~/.jcode/logs/:
[INFO] Copilot request: X-Initiator=user model=claude-sonnet-4-6
[ERROR] ... phase=stream_error provider=Copilot ... "The requested model is not supported."
Meanwhile tier detection reads the catalog correctly, so the right id is already in hand:
Copilot tier detection: 54 total, 26 picker-enabled, default -> claude-sonnet-4.6
Impact
Copilot is unusable out of the box for any session using the default model. Passing -m claude-sonnet-4.6 works, as does pinning default_model in config — so this is purely the constant. claude-opus-4.8, gemini-3.6-flash, and kimi-k2.7-code all work once a valid id is supplied.
Suggested fix
Set DEFAULT_MODEL to "claude-sonnet-4.6". Better still, prefer the default from the /models tier-detection response, which already reports claude-sonnet-4.6, and fall back to the constant only if that fetch fails.
Environment
jcode v0.61.1 (438789e), macOS, Copilot plus_monthly_subscriber_quota
Activity
[-]Copilot DEFAULT_MODEL is an Anthropic-native id (claude-sonnet-4-6) that the Copilot API rejects with 400[/-][+][bug] Copilot unusable by default: DEFAULT_MODEL `claude-sonnet-4-6` rejected with HTTP 400[/+]almai commentedon Jul 28, 2026
Related: #641 — a separate Copilot auth bug that produces a byte-identical
model_not_supportederror from an unrelated cause. Worth triaging together, since fixing either one alone leaves the symptom unchanged.almai commentedon Jul 28, 2026
Workaround
Pinning the model id explicitly avoids the bad constant, since
DEFAULT_MODELis only consulted when nothing else supplies a model.Per-invocation:
Or persistently, in
~/.jcode/config.toml:Verified working with this in place:
claude-sonnet-4.6,claude-opus-4.8,gemini-3.6-flash,kimi-k2.7-code.Note that the value must use Copilot's catalog id (dots), not the Anthropic-native form (hyphens). The ids reported by
Copilot tier detectionin~/.jcode/logs/are the correct ones to copy.1jehuang commentedon Jul 28, 2026
Confirmed and fixed in #643. Your diagnosis was exactly right:
DEFAULT_MODELwas the Anthropic-native id (claude-sonnet-4-6), which Copilot's API rejects since it only accepts its own dot-separated catalog ids. It is nowclaude-sonnet-4.6, matching the head ofFALLBACK_MODELS.Thanks for isolating it against the API directly and for posting the workaround, that saved a lot of guesswork. Also noting your point about preferring the
defaultfrom the/modelstier-detection response: that is the better long-term shape and worth a follow-up, but the constant fix unblocks the out-of-box case now.Labeled
priority: criticalsince it made Copilot unusable by default.— Jcode agent (automated triage), on behalf of @1jehuang
fix(copilot): use Copilot catalog ids and accept apps.json client-id …
fix(copilot): use Copilot catalog ids and accept apps.json client-id …
fix(copilot): use Copilot catalog ids and accept apps.json client-id …
fix(copilot): use Copilot catalog ids and accept apps.json client-id …