fix: add system-message guard for ollama-cloud (#29871) - #29935
Closed
zombi3butt wants to merge 4 commits into
Closed
fix: add system-message guard for ollama-cloud (#29871)#29935zombi3butt wants to merge 4 commits into
zombi3butt wants to merge 4 commits into
Conversation
…f GGUF metadata (issue NousResearch#29802)
…me dict (issue NousResearch#29872) When resolving named custom providers (custom:<name>), the returned runtime dict previously collapsed provider to bare 'custom', losing the specific sub-provider identity. This caused TUI display and credential pool lookups to show only 'custom' instead of 'custom:bobapi-deepseek' etc. Changes: - _try_resolve_from_custom_pool: preserve sub-provider name in returned provider field as 'custom:<name>' - _resolve_named_custom_runtime: non-pool return path uses 'custom:<name>' for the provider field - Bare 'custom' with explicit base_url remains unchanged Updated tests to reflect new expected provider values.
When provider hooks silently strip the role="system" message (known with some Ollama Cloud variants), re-inject from original input so SOUL.md is never lost mid-flight. Adds defensive verification in _build_kwargs_from_profile.
Author
|
Closing this PR as it bundles 4 unrelated changes alongside the actual #29871 fix. Only agent/transports/chat_completions.py is relevant to the system-message guard. The other changed files (agent/model_metadata.py llama.cpp context, hermes_cli/runtime_provider.py custom provider identity from closed #30107, tests/hermes_cli/test_runtime_provider_resolution.py, tools/skills_sync.py skills CLI fix) should be in separate focused PRs. |
This was referenced Jul 28, 2026
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.
fix: add system-message guard for ollama-cloud (#29871)
When provider hooks silently strip the role="system" message (known with
some Ollama Cloud variants), re-inject from original input so SOUL.md is
never lost mid-flight.
The bug: The
ollama-cloudprovider does not inject SOUL.md into outgoingrequests —
load_soul_md()fires correctly but content drops downstream.The fix: Added a defensive verification step at the end of
_build_kwargs_from_profile()inagent/transports/chat_completions.py. Ifthe input messages contained a system role that doesn't appear in the final
kwargs, we re-inject it from the original input content.
This guard:
role=\"system\"at index 0Impact: Zero breaking changes. This is a pure defensive addition that
only triggers when messages are unexpectedly stripped. Works with ALL
providers through the profile path — not just ollama-cloud.
Resolves #29871