fix(context): use Ollama loaded runtime allocation#5631
Closed
RaresKeY wants to merge 1933 commits into
Closed
Conversation
Keep an unhealthy MemoryVectorStore instance available for health reporting instead of discarding it as disabled. This lets health checks report a degraded/down vector-store state while preserving focused regression coverage for initializer behavior.
…mporter (#5261) * Harden skill importer against SSRF: block private targets + revalidate redirects per hop The skill importer validated only the initial URL with the lenient SSRF guard (block_private=False) and then fetched with follow_redirects=True, so a 3xx to an internal/metadata address (169.254.169.254, 127.0.0.1, RFC-1918) was still connected to — inconsistent with the hardened services/search/content.py :_get_public_url path. Add a _get_checked() helper that follows redirects manually and re-runs the SSRF guard with block_private=True on every hop, and route all three fetch sites (skills.sh unwrap, _fetch_bytes, _list_github_dir) through it. GitHub's own redirects and the final-host _assert_github_url checks are preserved. Adds hermetic regression tests (IP-literal hosts, faked HTTP layer) and updates the existing mock signature for the new block_private kwarg. Defense-in-depth: the endpoint is admin-gated (require_admin) and admins are trusted per THREAT_MODEL.md, so this is not a cross-boundary vulnerability. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test: enforce follow_redirects=False invariant in mock client Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Add Arch-specific package installation and NVIDIA runtime configuration to the Docker setup guide. Cover passthrough verification, the NVIDIA Compose overlay, and the distinction between GPU passthrough and CUDA-backed model serving Refs #831
…7-odysseus chore: sync upstream changes from odysseus-dev/odysseus
fix(docker): bump Docker CLI to a patched release
fix(docker): bump Docker CLI to a patched release
* feat(models): define capability schema and readers * fix(models): harden Google catalog probing Restrict native catalog probing to the Gemini host, keep provider keys out of request URLs, filter non-chat model resources, and preserve the manual refresh default in the built-in Google add flow.
This was referenced Jul 20, 2026
pewdiepie-archdaemon
force-pushed
the
dev
branch
from
July 23, 2026 16:22
6c3b6d3 to
d8a2059
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use Ollama's
/api/psloaded-model allocation for context budgeting insteadof promoting a static model maximum to effective runtime truth. The runtime
response is normalized through the provider adapter layer, and
src/model_context.pyremains the consumer that performs the local probe,handles caching, and returns the effective value.
Manually added local Ollama endpoints stored as
endpoint_kind="api"now probebefore the existing API/proxy short-circuit. A valid Ollama response with no
matching loaded model remains runtime-unknown, so the static model table is not
sent back as
options.num_ctx. Remote endpoints and configured proxies do notreceive the probe, and non-Ollama local endpoints keep their existing request
sequence.
Stack
This draft depends on #5576 and the focused runtime-context evidence adapter in
#5628 / #5630. After those layers land, rebase this branch so the PR contains
only
src/model_context.pyandtests/test_model_context.py.Related implementation
PR #5355 targets the same bug but reads
/api/showmodel metadata as theserving window. This implementation instead uses
/api/ps, which reports theallocation for currently running models, and keeps model maximum, configured
num_ctx, and loaded allocation distinct.Target branch
dev, notmain.Linked Issue
Fixes #5193
Part of #2737
Type of Change
Checklist
dev.How to Test
Run:
Expected result: 94 tests pass.
Configure a local Ollama endpoint as
endpoint_kind="api", return amatching
/api/psrow withcontext_length: 65536, and verifyget_context_length()returns 65536 without querying/v1/models.Return a valid
/api/psresponse before the model is loaded and verify theresult remains unknown; load the model at 32768 and verify the next lookup
returns 32768 rather than a cached static-table value.
Verify remote endpoints, configured proxies, and an unconfigured
localhost:8080 OpenAI-compatible endpoint do not receive
/api/psprobes.Broader context, compaction, capability, Ollama, and endpoint tests pass 285
tests. Python compilation passes for all changed modules. The full suite
reaches 4,711 passing tests and 5 skips; its 12 unrelated failures reproduce
unchanged on the #5576 base.
Optional live check:
GET /api/pswith Odysseus's logged context length.model is running.
Visual / UI changes
N/A — backend context discovery and tests only; no UI rendering changed.