Skip to content

fix(context): resolve llama-server host port from OLLAMA_PORT and default to 11434 - #5863

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/context-ollama-port
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/context-ollama-port

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/build-installation-context.py, the builder constructs the dynamic 'About this installation' context block by querying _loaded_model(llm_port=...) against the local host. However, the host port resolution logic only inspected LLM_PORT and LLAMACPP_PORT, omitting OLLAMA_PORT and LLAMA_SERVER_PORT, and defaulted to 8080. In ODS Compose topologies, 8080 is the container-internal port while the host publishes llama-server on ${OLLAMA_PORT:-11434}. As a result, when run on default installations or where OLLAMA_PORT is customized, the script probed 127.0.0.1:8080 where nothing was bound on the host, silently failing to detect the active model. Additionally, invoking _loaded_model with keyword arguments broke 0-argument test mocks.

This patch updates the environment port resolution in build_context_block to prioritize OLLAMA_PORT and LLAMA_SERVER_PORT before falling back to LLM_PORT and defaulting to 11434, updates the default parameter of _loaded_model to 11434, and wraps the call to handle 0-argument mock callables cleanly.

Validation

  • Repro baseline: Evaluated default environment block generation without LLM_PORT and with OLLAMA_PORT=11435; confirmed _loaded_model was called with port 8080 and test_persona_running_containers.py failed with TypeError.
  • Post-fix: Verified all 3 unit tests in test_build_installation_context_port.py and 4 parameterized tests in test_persona_running_containers.py pass with exit code 0.
  • Context suites: 7 passed. New-test Ruff and diff checks pass; new regressions wired into Linux CI.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens host port resolution and mock interoperability for local installation context generation, not runtime model routing. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5861 at 2a24f49 without conflicts. Production and test diffs passed together; persona running container contracts remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants