Skip to content

Conversation

uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Sep 11, 2025

Description

Use the Ollama configured default context length of 4096 (instead of Continue's 32,768).

resolves CON-3817

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

before

image

after

image

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Use Ollama’s actual context length: we now default to 4096 (Ollama’s config) and use the model-provided value when available, instead of Continue’s 32,768. This prevents overestimating the token window and aligns with CON-3817.

  • Bug Fixes
    • Added a contextLength getter that returns the detected model value, or 4096 as fallback.
    • Replaces the incorrect 32,768 default to avoid overflow and truncation issues.

@uinstinct uinstinct requested a review from a team as a code owner September 11, 2025 05:59
@uinstinct uinstinct requested review from RomneyDa and removed request for a team September 11, 2025 05:59
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 11, 2025
@RomneyDa
Copy link
Collaborator

4096 might be a bit too restrictive, wondering if we should do 8192

@uinstinct
Copy link
Contributor Author

4096 might be a bit too restrictive, wondering if we should do 8192

We can do it. It would take around 20% more memory in 8192 (attached image below).

image

Wondering if it would concern the users? Or should we put a user facing setting which can configure this num_ctx parameter (it also helps users know its changeable)?

@RomneyDa
Copy link
Collaborator

I think 20% is fine, 4096 makes sense for text in text out but for an agent application it's too restrictive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants