Fix/copilot default models gpt 5 5 opus 1m#72829
Conversation
Greptile SummaryAdds Confidence Score: 4/5Safe to merge; the core fix is correct and all tests pass. All changes are well-scoped and logically correct. The only finding is a P2: the dynamic forward-compat catch-all in extensions/github-copilot/models.ts — catch-all
|
|
CI failures look unrelated to this change. The failing test is Most likely caused by
Will push a small follow-up commit addressing @greptile-apps' P2 finding shortly. |
|
That analysis tracks. The Your changes ( Tip: You can customize Greptile's behavior for this repo with |
|
Fair catch — addressed in :
The codex-template clone path was already correct — it inherits |
73aafb6 to
53b7e20
Compare
53b7e20 to
bfdee7c
Compare
|
Codex review: needs real behavior proof before merge. Reviewed May 30, 2026, 12:54 AM ET / 04:54 UTC. Summary PR surface: Source +8, Tests +41. Total +49 across 3 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model gpt-5.5, reasoning high; reviewed against b9933b2ec119. Label changesLabel justifications:
Evidence reviewedPR surface: Source +8, Tests +41. Total +49 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
bfdee7c to
1b538aa
Compare
…efault models Both are advertised by the Copilot backend (api.githubcopilot.com/models) but were missing from DEFAULT_MODEL_IDS, forcing users to add them by hand. Also detect -1m / -1m-internal ids in buildCopilotModelDefinition so the 1M-context Opus variant gets contextWindow: 1_000_000 instead of the default 128_000, which would otherwise trigger early compaction. Fixes openclaw#72805
… catch-all resolveCopilotForwardCompatModel previously hardcoded contextWindow to 128_000 in its synthetic catch-all, so manually-added -1m/-1m-internal model ids that aren't in DEFAULT_MODEL_IDS would still be misconfigured. Move resolveCopilotContextWindow from models-defaults.ts to models.ts (avoids a new circular import since models-defaults.ts already imports from models.ts), and use it in the catch-all. Add 3 regression tests covering -1m-internal, plain -1m, and a non-1m guard. Addresses Greptile P2 finding on #<your-PR-number>.
1b538aa to
a9fdcbc
Compare
|
Friendly nudge from a downstream user — no pressure 🙂 Just wanted to flag that this PR (and the sibling #73216) would unblock real-world use of Thanks for the work here — no rush, just letting you know there's a user waiting downstream whenever you have cycles. |
|
This pull request has been automatically marked as stale due to inactivity. |
Fixes #72805
Summary
/modelsendpoint advertisesgpt-5.5andclaude-opus-4.7-1m-internal, butextensions/github-copilot/models-defaults.ts:DEFAULT_MODEL_IDSis missing both. Users have to hand-edit~/.openclaw/openclaw.jsonand runopenclaw config validateto use them.buildCopilotModelDefinitionresolves itscontextWindowto the default128_000, so the runtime would auto-compact long before the model actually runs out of context — silently capping a 1M-context session at ~13% of its real capacity.gpt-5.5andclaude-opus-4.7-1m-internaltoDEFAULT_MODEL_IDS. Added a small helperresolveCopilotContextWindow(id)that returns1_000_000when the id ends with-1mor-1m-internaland128_000otherwise;buildCopilotModelDefinitionnow uses it instead of the bareDEFAULT_CONTEXT_WINDOWconstant. Added 5 unit tests inextensions/github-copilot/models.test.ts.gpt-5.4,gpt-5.4-mini,gpt-5.3-codex,gpt-5.2-codex) — left for a follow-up so this PR matches the explicit "at minimum" ask in GitHub Copilot provider: add gpt-5.5 and claude-opus-4.7-1m-internal to default model list #72805.cost,reasoning,inputmodalities,maxTokens, theresolveCopilotTransportApirouting, and the existinggetDefaultCopilotModelIds()mutable-copy contract are unchanged.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause
DEFAULT_MODEL_IDSis a hardcodedas constarray inextensions/github-copilot/models-defaults.ts. It was last seeded against an older Copilot model availability snapshot and was never updated when Copilot rolled outgpt-5.5and the 1M-context Opus variant. Separately,buildCopilotModelDefinitionapplies a singleDEFAULT_CONTEXT_WINDOW = 128_000to every model id, so even users who added the 1M model manually would get an incorrect context window./modelsendpoint andDEFAULT_MODEL_IDS. The list is updated by hand whenever a maintainer notices a new model has shipped. There was also no per-id context-window resolver, so-1mvariants silently inherited the 128k default.Regression Test Plan
extensions/github-copilot/models.test.tsgetDefaultCopilotModelIds()includes"gpt-5.5".getDefaultCopilotModelIds()includes"claude-opus-4.7-1m-internal".buildCopilotModelDefinition("claude-opus-4.7-1m-internal").contextWindow === 1_000_000.buildCopilotModelDefinition("some-future-model-1m").contextWindow === 1_000_000(covers the bare-1msuffix).buildCopilotModelDefinition("claude-opus-4.7").contextWindow === 128_000(regression guard so non--1mids stay on the default).DEFAULT_MODEL_IDSandbuildCopilotModelDefinitionare both pure helpers with no I/O — unit tests are deterministic and pinpoint regressions to either the array or the resolver. The existing test file already uses the same.toContain(...)style for the other Anthropic-family Copilot ids, so the new tests slot in next to their cousins.gpt-5.5,claude-opus-4.7-1m-internal, or 1M context resolution. The closest existing coverage is the cluster ofgetDefaultCopilotModelIds().toContain(...)checks for the other Claude models, which doesn't constrain the new ids.User-visible / Behavior Changes
gpt-5.5andclaude-opus-4.7-1m-internalnow appear inopenclaw models list --provider github-copilotwithout manual config.agents.defaults.modelsentries that target either model id (or any future Copilot id ending in-1m/-1m-internal) get acontextWindowof1_000_000instead of128_000, so auto-compaction triggers at the model's actual limit rather than ~13% of it.Diagram
Security Impact
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
engines.node >=22.14.0)Copilot-Integration-Id: vscode-chat)Steps
github-copilotprovider with a Copilot subscription that exposesgpt-5.5andclaude-opus-4.7-1m-internal.openclaw models list --provider github-copilot.contextWindowforclaude-opus-4.7-1m-internal(e.g. viaopenclaw models inspect github-copilot/claude-opus-4.7-1m-internal --jsonor by triggering a long session and observing where auto-compaction fires).Expected
gpt-5.5andclaude-opus-4.7-1m-internalappear in the listing without any user-side config edits.claude-opus-4.7-1m-internalreportscontextWindow: 1000000.gpt-5.5reportscontextWindow: 128000.404 Not Found/ availability error from the backend, per the file's existing "intentionally broad" policy.Actual (before fix)
openclaw models list --provider github-copilot.claude-opus-4.7-1m-internalmanually resolves it withcontextWindow: 128000, causing premature auto-compaction at ~13% of the model's real capacity.Evidence
pnpm check:changedis green: conflict markers, typecheck extensions, typecheck extension tests, lint extensions, runtime import cycles all pass.Human Verification (required)
extensions/github-copilot/models.test.ts(29/29 pass locally).pnpm check:changedgate (extensions + extension-tests + lint + import-cycles, all green).extensions/github-copilot/models.tsto confirmresolveCopilotTransportApialready classifiesgpt-5.xids correctly via existing test coverage at line 206 (["gpt-5.4-codex", "gpt-5.5-codex", "gpt-5.4-codex-mini", "gpt-5.3-codex"]), so addinggpt-5.5to the default list does not need any transport-routing change.-1msuffix (covered bysome-future-model-1mtest) — future-proofs the resolver if Copilot ships a non-internal*-1mvariant.-1mids still resolve to128_000— explicit regression guard so the resolver doesn't accidentally widen for unrelated ids.getDefaultCopilotModelIds()mutable-copy invariant unchanged — existing test still passes after the array grew by 2.https://api.githubcopilot.com/modelswith my own token. I do not have a Copilot subscription withclaude-opus-4.7-1m-internalaccess, so I have not exercised the end-to-end path of "auth → list → spawn a session on the new model and watch a long context fill past 128k tokens." The issue reporter has the live evidence fromhttps://api.githubcopilot.com/models, and the file's existing policy already documents that unavailable models surface the Copilot backend error.claude-opus-4.7-1m-internal. The default definition keepsinput: ["text", "image"]since the resolver only changescontextWindow. If the 1M variant has different modality support, that is out of scope for this PR.Review Conversations
(Both will be checked once review activity lands. Currently no bot review conversations on this PR.)
Compatibility / Migration
Risks and Mitigations
claude-opus-4.7-1m-internalis listed by Copilot as "Internal only" and may not be granted on every Copilot plan/org.DEFAULT_MODEL_IDS(e.g.o1,o3-mini).-1mwithout actually offering 1M context, which would set the wrongcontextWindow.-1m/-1m-internalare explicit naming conventions for context-window variants). If Copilot ever ships a-1mid that means something different, the helper is one small place to update. Adding a generic naming-collision guardrail now would be speculative.-1mvariants in the future might forget that the resolver depends on the suffix.resolveCopilotContextWindowhelper is colocated withDEFAULT_MODEL_IDSand the suffix-test test cases, so any future addition will see both at once. No separate documentation needed.