Skip to content

[Bug] Context window size not handled correctly for Ollama models #411

Open

Description

Environment

  • OS: Windows 11
  • Eclipse Version: 0.43
  • Plugin Version: 0.21

Describe the bug
Copilot shows for my local model that the context window size is 256K, but Ollama reports 4K. Also after 4K Copilot runs out of context.

To Reproduce
Steps to reproduce the behavior:

  1. Select local model, e.g. qwen3.5:latest
  2. Start conversation with Copilot, context shows 256K in the UI.
  3. Execute ollama ps in the console, which shows 4096 as CONTEXT.
  4. Keep talking to Copilot until you have filled up the 4K.
  5. Message appears:
    I don't have context from a previous turn in this conversation. What were you working on? Please share the task or file you'd like me to continue with.
    

Expected behavior
I would expect one of the two following things:

  • Ideally: Copilot runs the Ollama model with its maximum context window size. Seemingly the plugin is already reading this information from the Ollama API Reference, as it already shows the 256K.
  • At least: Copilot shows the correct context window size, so the user knows that he / she has to change it in Ollama (e.g. via modelfile and setting the default context window size for the model).

Screenshots
The context which shows 256K (is 262,1K a rounding issue?) as well that I exceeded 4K.

Image

And the message that we ran out of context, as Copilot cannot remember anything anymore:

Image

Additional context
Add any other context about the problem here.

Activity

  1. added
    bug
    on Aug 10, 2026
  2. gerrit-hohl commented on Aug 19, 2026

    @gerrit-hohl
    Author

    As I had some time about thinking this: Maybe Copilot should not overwrite / overrule the default context size set in the model. 🤔

    People with weaker hardware might set a lower context size than the possible maximum of a model intentionally, either a) so it runs on their hardware or b) it doesn't overspill from GPU / VRAM to CPU / RAM and runs permanent.

    Same applies for other parameters, as top_k, top_p, temperature and so on.

    But Copilot still might read the value when working with a model, so it can display it correctly. Not sure if it also needs it for doing a compression of the context windows as well as other things.

  3. gerrit-hohl commented on Aug 31, 2026

    @gerrit-hohl
    Author

    After some testing, it seems without this bug being solved I cannot use Copilot with Ollama.

    Reason is that Copilot always assume the maximum context window, as it fetches that value from the model, not the actual, currently configured context window size.

    In my case that means I have to run Qwen3.8B-27B with 256K. And for that I don't have enough VRAM. I mean, I would have a (slight) overspill this or that way, but in this case it is too much and even the answer for the most simplest prompt takes ages.

  4. gerrit-hohl commented on Sep 1, 2026

    @gerrit-hohl
    Author

    In the meantime I tried to figure which value from /api/tags or /api/show is used for determine the context window size of the selected model. Putting a web proxy between Ollama and Copilot I tried to play around with some values, by intercepting the JSON payload and modifying it. But none of the values I touched seemed to have any effect. 😵‍💫

    Can someone please shed some light on this? 🙏

  5. vayshya commented on Nov 11, 2026

    @vayshya

    I have same bug in IDEA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions