Skip to content

fix(translator): keep a separate host for each Ollama model - #3565

Open
SaiPisey2 wants to merge 3 commits into
kagent-dev:mainfrom
SaiPisey2:fix/3070-ollama-per-model-host
Open

SaiPisey2 wants to merge 3 commits into
kagent-dev:mainfrom
SaiPisey2:fix/3070-ollama-per-model-host

Conversation

@SaiPisey2

Copy link
Copy Markdown

What changed

Previously, all Ollama models in an agent used whichever host was compiled last, and a model without a host could inherit another model’s host. Each model now carries its own host, which the Go and Python runtimes and the egress check use. The runtimes fall back to OLLAMA_API_BASE only when a model has no host; a ModelConfig host takes precedence over the Harness environment variable.

Older or custom runtime images will reject the new host field after a controller upgrade, as with #3458.

Testing

Translator tests cover per-model hosts, embedder and egress behavior, and URL normalization. Go and Python runtime tests verify per-host requests and environment fallback. Go lint passed; Go tests passed across 25 packages with race detection; Ruff passed; pytest passed (659 tests). One TLS E2E test also fails on main.

AI tools provided non-trivial assistance with the code and tests; I reviewed the changes and ran the checks.

Fixes #3070

Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
@SaiPisey2
SaiPisey2 requested review from a team and supreme-gg-gg as code owners November 7, 2026 14:14
@github-actions github-actions Bot added the bug Something isn't working label Nov 7, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because of no activity in the last 15 days. It will be closed in the next 5 days unless it is tagged "no stalebot" or other activity occurs.

@github-actions github-actions Bot added the stale This issue or PR has become stale label Nov 23, 2026
@SaiPisey2

Copy link
Copy Markdown
Author

Still keen on this one. I will resolve the conflict with main shortly, and I am happy to make any changes you need.

Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
@SaiPisey2

Copy link
Copy Markdown
Author

Merged main in to resolve the conflict. The tests now use ModelConfigReference (from #3604). Go and Python tests and make lint pass.

@github-actions github-actions Bot removed the stale This issue or PR has become stale label Nov 28, 2026
EItanya
EItanya previously approved these changes Nov 30, 2026
@EItanya
EItanya enabled auto-merge November 30, 2026 16:58
@SaiPisey2

Copy link
Copy Markdown
Author

Thanks @EItanya! go-unit-tests failed in TestSpansExportedBeforeResponseBodyCloses (go/adk/pkg/a2a/server). This PR doesn't touch that package, and the same workflow failed on main on 12-03, so it looks flaky. Could you re-run it?

Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
auto-merge was automatically disabled December 5, 2026 05:58

Head branch was pushed to by a user without write access

@SaiPisey2

Copy link
Copy Markdown
Author

Merged main again to clear the new conflict. #3345 and #3500 added messages to adk.proto, which conflicted in the generated adk_pb2.py. I regenerated it with the repo's buf (v1.72.0) instead of resolving by hand. Afterwards adk.pb.go and adk_pb2.pyi matched the generated output, and adk_pb2.py has both main's new messages and ADKOllama.host. Go adk and translator tests, make lint and ruff pass.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Ollama ModelConfigs in one agent share a single host

2 participants