Support a per-model input context window override for custom gateways
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start with packages/core/src/core/tokenLimits.ts and trace how model configuration reaches token budgeting and compaction. Check the documented modelConfigs settings and the tests covering those paths. Done means a validated per-model contextWindowTokens override is used when supplied, invalid values are rejected, and existing Gemini defaults remain the fallback; test values below and above 1,048,576.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Custom model gateways can advertise their actual context window, but packages/core/src/core/tokenLimits.ts currently gives every unknown model DEFAULT_TOKEN_LIMIT (1,048,576). The function accepts only the model name. The documented modelConfigs settings allow generation settings such as maxOutputTokens, without an input context-window override.
We encountered this while fixing https://github.com/link-assistant/formal-ai/issues/1582. Our symbolic server derives its context capacity from available resources and publishes context_window_tokens through its model metadata. Assuming the fixed Gemini window can trigger premature compaction when the server supports more, or allow a larger context than a smaller server supports.
Reproduction against the current source (not an installed CLI end-to-end test):
- Configure a custom gateway/model named
formal-aiwhose advertised input window is 1,234,567 tokens. - Evaluate
tokenLimit('formal-ai')frompackages/core/src/core/tokenLimits.ts. - It returns 1,048,576 regardless of the gateway's advertised value. The
defaultbranch cannot receive an override.
Expected: a validated per-model input context-window setting, optionally populated from gateway model discovery. Existing Gemini model defaults should remain the fallback when no override is supplied.
Suggested change: add an optional positive integer contextWindowTokens to model configuration, resolve it alongside the existing model-specific generation configuration, and pass it to the token-budget/compaction code before falling back to tokenLimit(model). Reject invalid/non-finite values and test both values below and above 1,048,576. Do not infer an unlimited context from a model name.
Current workaround: use a client exposing an actual context-window override, or keep the gateway within the fixed window while accepting the reduced capacity. maxOutputTokens alone cannot fix the input budget. We have not patched installed Gemini packages or claimed this workaround satisfies our all-clients acceptance criterion.
- Lingua principale
- TypeScript
- Stelle
- 109k
- Fork
- 15k
- Merge medio
- 1g 1h
- PR unite (30g)
- 106
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google-gemini/gemini-cli
-
status/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google-gemini/gemini-cli#30412 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
--acp never answers initialize when a sandbox is enabled (stdin read as a piped prompt before the sandbox hop)Forse già presa @Raamia l’ha presa 1 giorno fa. Apertastatus/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google-gemini/gemini-cli#30398 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
** Docs: `/shells` slash command (and `/bashes`) is documented but was removed in #22740 — tutorial and tip tell users to run a command that doesn't existForse già presa @DZH166 l’ha presa 1 giorno fa. Apertastatus/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google-gemini/gemini-cli#30396 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
** Docs: System Prompt Override guide links "Persisting Environment Variables" to an anchor that does not exist in authentication.mdxForse già presa @DZH166 l’ha presa 2 giorni fa. Apertastatus/need-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
google-gemini/gemini-cli#30394 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
core tests: orphan PTY slave fd test fails on Macs where /dev/ttys001 existsForse già presa @Anoshor l’ha presa 2 giorni fa. Apertastatus/need-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google-gemini/gemini-cli#30384 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di google-gemini/gemini-cli
Issue simili
-
qa-manually-tested Status: Triage Type: Bug / Error
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mermaid-js/mermaid-v13#1158 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Daily
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Expensify/App#107705 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Changing shipping to country value from storefront homepage creates an invalid URLForse già presa @Riamus78 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
medusajs/dtc-starter#106 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
digitalfabrik/integreat-app#4558 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
redhat-developer/podman-desktop-ibmcloud-account-ext#755 ·
I maintainer di solito rispondono entro 1 giorno