#128k context limit for gemini-3-flash-preview?

1 messages · Page 1 of 1 (latest)

warm smelt
#

The context size for google/gemini-3-flash-preview is reported as "Context: 15k/128k (12%)" in the status. I'm pretty sure that the context size in gemini-3-flash should be 1M. What could be causing this inconsistency?
I see that in pi-ai, the gemini-3-flash-preview contextWindow for provider github-copilot is 128k but it's 1048576 for all other provider, I wonder if openclaw is somehow getting confused because of this.

jolly oliveBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

cyan heathBOT
#

That “15k/128k” number is OpenClaw’s token-budgeting estimate, not necessarily Gemini’s true max context.

What’s happening (and yes, it matches your suspicion):

  • OpenClaw caches contextWindow by model id only (e.g. gemini-3-flash-preview), not by provider+model.
  • If the same model id exists under multiple providers (e.g. google and github-copilot) with different limits, OpenClaw intentionally picks the smallest one as a fail-safe.
  • In pi-ai / pi-coding-agent, github-copilot reports gemini-3-flash-preview as 128k, so OpenClaw will clamp the budget to 128k even if google would be 1M.

So you’re not crazy: OpenClaw isn’t “confused”, it’s being conservative because it can’t currently distinguish per-provider context limits for the same model id.

How to confirm quickly

Run:

  • openclaw --version
  • openclaw models list
    and check whether you see gemini-3-flash-preview coming from both google and github-copilot.

Also check whether you have any of these set (even unintentionally): COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN — OpenClaw may auto-enable the Copilot provider when those exist.

#

Fix options

  1. If you don’t care about Copilot models: remove/unset the Copilot token/profile/env var and restart the gateway. Then the discovered minimum should stop being pulled down to 128k.

  2. Force an override in config: set an explicit contextWindow for your Google Gemini model in models.providers.google.models[...]. Config overrides are applied after discovery, so they win.

If you want, paste your openclaw models list output lines for gemini-3-flash-preview (google + copilot), and I’ll tell you which of the two fixes is cleaner for your setup.

warm smelt
#

openclaw models list

🦞 OpenClaw 2026.2.19-2 (45d9b20) — Meta wishes they shipped this fast.

Model Input Ctx Local Auth Tags
minimax-portal/MiniMax-M2.5 text 195k no yes default,configured,alias:minimax-m-25
moonshot/kimi-k2.5 text 250k no yes fallback#1,configured,alias:moonshot-kimi-25
google/gemini-3-flash-preview text+image 1024k no yes configured,alias:gem-3-flash
google/gemini-2.5-flash-preview-09-2025 text+image 1024k no yes configured
google/gemini-3-pro-preview text+image 977k no yes configured,alias:gem-3-pro
google/gemini-flash-lite-latest text+image 1024k no yes configured,alias:gem-flash-lite
google-antigravity/gemini-3-flash text+image 1024k no yes configured,alias:antig-3-flash
google-antigravity/gpt-oss-120b-medium text 128k no yes configured
github-copilot/grok-code-fast-1 text 125k no yes configured,alias:copilot-grok-code
google-gemini-cli/gemini-3-pro-preview text+image 1024k no yes configured
google-gemini-cli/gemini-3-flash-preview text+image 1024k no yes configured,alias:gcli-3-flash
openrouter/x-ai/grok-4.1-fast text+image 1953k no yes configured,alias:or-grok-41-fast
openrouter/moonshotai/kimi-k2.5 text+image 256k no yes configured,alias:or-moonshot-kimi-25
openrouter/minimax/minimax-m2.5 text 192k no yes configured,alias:or-minimax-m-25
openrouter/qwen/qwen3.5-plus-02-15 text+image 977k no yes configured,alias:or-qwen-35-plus
minimax/MiniMax-M2.5 text 195k no yes configured,alias:minimax-api-m-25

openclaw --version

2026.2.19-2

Where would I find those tokens defined? (COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN)

cyan heathBOT
#

Those Copilot “tokens” can come from either env vars or OpenClaw’s auth-profiles store (and either one is enough to make github-copilot/... show up as Auth yes).

1) Check environment variables (most common “I didn’t mean to enable Copilot” cause)

Copilot auto-enables if any of these are set on the gateway host:

  • COPILOT_GITHUB_TOKEN
  • GH_TOKEN
  • GITHUB_TOKEN

If you’re running the gateway as a service/daemon, remember: it may have a different environment than your interactive shell.

2) Check auth profiles on disk (where OpenClaw stores OAuth/API-key style creds)

Per the docs, auth profiles live here:

  • ~/.openclaw/agents/<agentId>/agent/auth-profiles.json (usually <agentId> is main)

So typically: