Skip to content

[Fix] Ollama tasks condense before their configured context limit - #1174

Open
zoomote[bot] wants to merge 1 commit into
mainfrom
fix/ollama-context-management-1kv2451y1vp71
Open

[Fix] Ollama tasks condense before their configured context limit#1174
zoomote[bot] wants to merge 1 commit into
mainfrom
fix/ollama-context-management-1kv2451y1vp71

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Naved Merchant. View the task or mention @roomote for follow-up asks.

What changed

Native Ollama now fetches model metadata before task context management reads the model limits. The fetch is single-flight, avoids repeat requests once metadata is populated, and can recover after a failed request.

Focused regression coverage verifies that a detected 1M context window replaces the 128k fallback before a model request, while preserving duplicate suppression and retry behavior.

Why this change was made

After VS Code restarted or rebuilt the API handler, existing Ollama tasks could condense around 125k because context management ran before native Ollama fetched /api/show metadata.

Closes #1151.

Impact

Ollama tasks now use the model's detected context window for condensing decisions from the start of a resumed task, avoiding premature context loss for large-context models.

Related PRs

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@navedmerchant
navedmerchant marked this pull request as ready for review August 6, 2026 06:07
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Native Ollama still uses 128k fallback for context management before fetching model metadata in v3.74.0

1 participant