fix: add LiteLLM-style aliases for GitHub Copilot context windows (#606)
The OPENAI_CONTEXT_WINDOWS/OPENAI_MAX_OUTPUT_TOKENS tables only contained the `github:copilot:<model>` namespaced form used when talking directly to Copilot via /onboard-github. When OpenClaude is pointed at a LiteLLM proxy (which routes Copilot using the standard `github_copilot/<model>` convention), the lookup missed and fell back to the conservative 8k default — causing the compaction loop to fire repeatedly on every tick and blocking requests before they left the client with repeated "not in context window table" warnings on stderr. Mirror the 11 active Copilot models with LiteLLM-style keys in both tables. No behavior change for users of /onboard-github since namespaced entries remain untouched and `lookupByKey` picks exact matches first.
This commit is contained in:
committed by
GitHub
parent
a02c44143b
commit
2e0e14d713
@@ -18,6 +18,7 @@ const OPENAI_CONTEXT_WINDOWS: Record<string, number> = {
|
|||||||
// Claude
|
// Claude
|
||||||
'github:copilot:claude-sonnet-4': 216_000,
|
'github:copilot:claude-sonnet-4': 216_000,
|
||||||
'github:copilot:claude-haiku-4': 200_000,
|
'github:copilot:claude-haiku-4': 200_000,
|
||||||
|
'github:copilot:claude-haiku-4.5': 144_000,
|
||||||
'github:copilot:claude-sonnet-4.5': 200_000,
|
'github:copilot:claude-sonnet-4.5': 200_000,
|
||||||
'github:copilot:claude-sonnet-4.6': 200_000,
|
'github:copilot:claude-sonnet-4.6': 200_000,
|
||||||
'github:copilot:claude-opus-4': 200_000,
|
'github:copilot:claude-opus-4': 200_000,
|
||||||
@@ -46,6 +47,25 @@ const OPENAI_CONTEXT_WINDOWS: Record<string, number> = {
|
|||||||
// Grok
|
// Grok
|
||||||
'github:copilot:grok-code-fast-1': 256_000,
|
'github:copilot:grok-code-fast-1': 256_000,
|
||||||
|
|
||||||
|
// LiteLLM format — when OpenClaude talks to a LiteLLM proxy, Copilot models
|
||||||
|
// keep their "<provider>/<model>" naming convention (standard LiteLLM routing)
|
||||||
|
// instead of the "github:copilot:<model>" namespaced form used by /onboard-github.
|
||||||
|
// Entries below cover the aliases currently exposed by LiteLLM's github_copilot
|
||||||
|
// provider — this is a curated subset, not an exhaustive mirror of the
|
||||||
|
// namespaced entries above. Values are sourced from copilotModels.ts to stay
|
||||||
|
// consistent with the /onboard-github path.
|
||||||
|
'github_copilot/claude-sonnet-4.6': 200_000,
|
||||||
|
'github_copilot/claude-opus-4.6': 200_000,
|
||||||
|
'github_copilot/claude-haiku-4.5': 144_000,
|
||||||
|
'github_copilot/gpt-4.1': 128_000,
|
||||||
|
'github_copilot/gpt-4o': 128_000,
|
||||||
|
'github_copilot/gpt-5-mini': 264_000,
|
||||||
|
'github_copilot/gpt-5.4': 400_000,
|
||||||
|
'github_copilot/gpt-5.4-mini': 400_000,
|
||||||
|
'github_copilot/gemini-2.5-pro': 128_000,
|
||||||
|
'github_copilot/gemini-3-flash': 128_000,
|
||||||
|
'github_copilot/grok-code-fast-1': 256_000,
|
||||||
|
|
||||||
// NOTE: bare Claude model names (e.g. 'claude-sonnet-4') are intentionally
|
// NOTE: bare Claude model names (e.g. 'claude-sonnet-4') are intentionally
|
||||||
// omitted. Different OpenAI-compatible providers may impose different context
|
// omitted. Different OpenAI-compatible providers may impose different context
|
||||||
// limits for the same model name, so we cannot safely hardcode values here.
|
// limits for the same model name, so we cannot safely hardcode values here.
|
||||||
@@ -127,6 +147,7 @@ const OPENAI_MAX_OUTPUT_TOKENS: Record<string, number> = {
|
|||||||
// Claude
|
// Claude
|
||||||
'github:copilot:claude-sonnet-4': 16_000,
|
'github:copilot:claude-sonnet-4': 16_000,
|
||||||
'github:copilot:claude-haiku-4': 64_000,
|
'github:copilot:claude-haiku-4': 64_000,
|
||||||
|
'github:copilot:claude-haiku-4.5': 32_768,
|
||||||
'github:copilot:claude-sonnet-4.5': 32_000,
|
'github:copilot:claude-sonnet-4.5': 32_000,
|
||||||
'github:copilot:claude-sonnet-4.6': 32_000,
|
'github:copilot:claude-sonnet-4.6': 32_000,
|
||||||
'github:copilot:claude-opus-4': 32_000,
|
'github:copilot:claude-opus-4': 32_000,
|
||||||
@@ -155,6 +176,19 @@ const OPENAI_MAX_OUTPUT_TOKENS: Record<string, number> = {
|
|||||||
// Grok
|
// Grok
|
||||||
'github:copilot:grok-code-fast-1': 64_000,
|
'github:copilot:grok-code-fast-1': 64_000,
|
||||||
|
|
||||||
|
// LiteLLM format — see note on context windows above.
|
||||||
|
'github_copilot/claude-sonnet-4.6': 32_000,
|
||||||
|
'github_copilot/claude-opus-4.6': 32_000,
|
||||||
|
'github_copilot/claude-haiku-4.5': 32_768,
|
||||||
|
'github_copilot/gpt-4.1': 16_384,
|
||||||
|
'github_copilot/gpt-4o': 4_096,
|
||||||
|
'github_copilot/gpt-5-mini': 64_000,
|
||||||
|
'github_copilot/gpt-5.4': 128_000,
|
||||||
|
'github_copilot/gpt-5.4-mini': 128_000,
|
||||||
|
'github_copilot/gemini-2.5-pro': 64_000,
|
||||||
|
'github_copilot/gemini-3-flash': 64_000,
|
||||||
|
'github_copilot/grok-code-fast-1': 64_000,
|
||||||
|
|
||||||
// NOTE: bare Claude model names omitted — see context windows comment above.
|
// NOTE: bare Claude model names omitted — see context windows comment above.
|
||||||
|
|
||||||
// OpenAI
|
// OpenAI
|
||||||
|
|||||||
Reference in New Issue
Block a user