Repository navigation
Description
Rule (owner, 2026-10-04)
No client falls back to an unconfigured service URL. A service's URL comes from the configuration, or from a connection the CLI opened itself (a port-forward it started). When neither exists, the command stops with an error naming the setting to set. It never guesses localhost:<port>. Ollama stays a supported provider when it is configured. This applies to every service the CLI talks to, not only AI.
Where defaults live (owner, 2026-10-04): suggested values, such as the gateway, Qdrant and Jaeger URLs, live in config.example.yaml, not in code. devops k8s deploy-stack writes the URLs of what it deployed into the configuration when they are not set yet. If nothing is configured and nothing is running, the command returns an error naming the setting.
Problem
AI callers fall back to a hard-coded http://localhost:11434 when no Ollama URL is set, even when the configuration names a working provider (ai.provider: gateway with its URL). Ollama stays supported when it is configured. The bug is an invalid implicit default used in place of the valid configuration.
Evidence (owner's iteration runs, 2026-10-04): all three devops ai benchmark --type embedding runs failed with ConnectError to localhost:11434, using the chat model, then exited 0 and were saved as normal runs. The causes:
ai/benchmark/embedding_runner.py:250falls back to["http://localhost:11434"], and:279switches the provider to Ollama when the URL contains:11434orollama;commands/benchmark.py:316defaults the embedding model tosettings.ai.model, the chat model.
The fallback appears at 17 sites in src, and the same URL is defined three times (config/constants.py:538 CONST_URL_OLLAMA_LOCALHOST, ai/models/ollama.py:31 DEFAULT_OLLAMA_BASE_URL, config/defaults.py:385 DEFAULT_OLLAMA_HOST):
ai/benchmark/runner.py:202andai/benchmark/embedding_runner.py:250ai/rag/embeddings.py:489;ai/rag/indexer.py:581-582ai/client/ollama.py:182;ai/client/unified.py:282-284ai/review/pipeline.py:218,230;ai/review/runner.py:149,161,171ai/providers/ollama.py:55
Acceptance criteria
- One resolver gives every AI caller its endpoint from the configured provider:
- with the gateway configured, that is the gateway URL and its model aliases;
- with Ollama configured, the configured Ollama URLs.
- No caller falls back to
localhost:11434, or to any URL the configuration does not name. With no usable configuration, a caller stops with an error naming the setting to fix. - One constant names Ollama's default port, used only where a person or the config wizard picks Ollama explicitly. The three duplicate URL constants are gone.
- The provider is chosen by configuration, never by a substring of the URL (
embedding_runner.py:279; library-first: feat(ci): hand-rolled URL and address parsing failsdevops ci, AGENTS.md makes the library the rule, and reviews stop discarding the findings #1107). - The embedding benchmark defaults to the configured embedding model (the gateway's embedding alias), not
ai.model. A run where every request failed exits non-zero and is not saved as a run. This overlaps feat(ai): embeddings through the llm gateway, with embedding model evaluation #481, whichever lands first. - Tests: with a gateway-only config, a fake transport sees every benchmark, RAG, review and client call go to the gateway URL, and a socket guard proves nothing tries
localhost:11434. Tests run offline, each under 1 s. - The same rule holds for the other services. Hard-coded fallbacks found on 2026-10-04 are
http://localhost:6333(Qdrant, 5 sites) andhttp://localhost:16686(Jaeger, 6 sites), fromrg -n '"https?://(localhost|127\.0\.0\.1)' src. URLs built from a port-forward the CLI opened itself (http://localhost:{ports[...]}) and a server's own bind address stay. -
config.example.yamlholds the suggested URL for each service, and no code default repeats it. A test checks that every service URL setting has an example value and no code default. -
devops k8s deploy-stacksets each service URL it deployed (gateway, Qdrant, observability) in the configuration when that setting is empty. It never overwrites a set value, and it reports what it set. Its--dry-runlists these config writes and makes no request (feat(cli): reachable--dry-runpreviews for delegated commands #412). - With nothing configured,
devops ai test,devops ai benchmark --type embedding,devops rag queryanddevops review patheach exit non-zero with an error naming the setting. Test: an empty config, and a socket guard proving no connection was tried. - A guard keeps it that way: an ast-grep rule, in the style of feat(ci): hand-rolled URL and address parsing fails
devops ci, AGENTS.md makes the library the rule, and reviews stop discarding the findings #1107's enforcement, rejects a string literalhttp(s)://localhostor127.0.0.1used as a fallback value insrc, with an allowlist for the port-forward and bind cases.
Notes
- In-cluster Service URLs for the Ollama tiers (
config/defaults.py:103) and tier operations such asdevops ai prewarmaddress Ollama on purpose, and stay. - Related: feat(ai): embeddings through the llm gateway, with embedding model evaluation #481 (embeddings through the gateway), chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 (the same cleanup for the removed vLLM deployments), fix(ai): review calls through the gateway no longer stall for about 190 s on ollama, with the cause measured first #1069.
Update 2026-10-08: refinement
The search also finds the gateway, Portkey, vLLM, OTLP, Loki and Pyroscope defaults (config/defaults.py:89-93, :220-222), used as field defaults (config/settings.py:472, :475), and get_ollama_urls' fallback (:521-532). #992 and #1000 now leave these to this item; whichever lands first removes the fallback, and the others do not bring it back.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]fix(ai): ai callers take their endpoint from the configured provider and never fall back to localhost:11434[/-][+]fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default[/+]fix(review): the review pipeline reports the eight failures it now sw…
fix(review): drop the fixed gateway URL of the review dry run (#5399)
fix(config): disable Valkey cache tier when valkey.url is unset (#7547)