feature(agent): add base_url for the detect and analyze chat agents#245
Closed
nghiadaulau wants to merge 1 commit into
Closed
feature(agent): add base_url for the detect and analyze chat agents#245nghiadaulau wants to merge 1 commit into
nghiadaulau wants to merge 1 commit into
Conversation
agent.ai.base_url (env AGENT_AI_BASE_URL) points both chat agents at any OpenAI-compatible endpoint — Ollama / vLLM / LocalAI, an LLM gateway in front of Bedrock, or Gemini's OpenAI-compatible endpoint — so inference can stay inside the operator's own network (a compliance requirement for self-hosted and regulated environments). detect.Options and analyze.Options already accepted a BaseURL (test-only until now); the factory simply never set it from config. This wires the missing link: - AgentAIConfig.BaseURL + per-task overrides on detect/analyze, carried through Resolve() and the clone_config deep-clone (triple-touch). - factory_ai threads the resolved base_url into both Options. - config.yaml, Helm values + configmap, and the detect-mode docs. Empty base_url keeps the OpenAI default, so existing deployments are unchanged. Tests: Resolve carries/overrides base_url; clone preserves it at every level; a factory httptest test asserts the detect agent calls the configured endpoint.
nghiadaulau
added a commit
to nghiadaulau/versus-incident
that referenced
this pull request
Jun 20, 2026
Add agent.ai.provider — "openai" (default) or "gemini" — instead of a raw base_url. ProviderBaseURL maps the provider to its OpenAI-compatible chat endpoint internally (both backends are OpenAI-compatible, so only the base URL changes), so operators pick a short name instead of a long URL. Wired through detect + analyze (per-task agent.ai.analyze.provider override), config.yaml (env AGENT_AI_PROVIDER) and the Helm chart. Empty = openai, so existing deployments are unchanged. Supersedes VersusControl#245 (base_url). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Superseded by #264 — replaced the verbose |
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
Adds
agent.ai.base_url(envAGENT_AI_BASE_URL) so the detect andanalyze chat agents can target any OpenAI-compatible endpoint — Ollama,
vLLM, LocalAI, an LLM gateway in front of AWS Bedrock, or Gemini's
OpenAI-compatible endpoint. Inference can stay inside the operator's own
network, which is a hard requirement for self-hosted and regulated
deployments.
The missing link
detect.Optionsandanalyze.Optionsalready carry aBaseURLfieldand forward it to the Eino chat model — but it was documented test-only and
the factory never set it from config. The embedder path already wires
EmbeddingBaseURL; the chat path was the gap. This PR closes it.Changes
AgentAIConfig.BaseURL+ per-task overridesdetect.base_url/analyze.base_url, carried throughResolve()and theclone_configdeep-clone (the config triple-touch: struct + clone + yaml).
factory_ai.gothreads the resolvedbase_urlinto bothdetect.Optionsand
analyze.Options.config/config.yaml, Helm (agent.ai.baseUrl+agent.ai.analyze.baseUrlvalues + configmap rendering), and the detect-mode docs (replaces the
now-obsolete "chat endpoint is hard-coded" note).
Empty
base_urlkeeps the OpenAI default (api.openai.com/v1), so existingdeployments are unchanged.
Testing
Resolvecarries the sharedbase_urland lets a per-taskvalue override it;
cloneConfigpreservesbase_urlat the shared,detect, and analyze levels (guards the triple-touch landmine).
BuildAIswithcfg.AI.BaseURLset to a localtest server, then a real detect
Run— asserts the agent's chat clienthits the configured endpoint, not
api.openai.com.(
/v1beta/openai/chat/completions) — the request authenticates and theendpoint accepts the OpenAI request shape (a real completion needs quota
enabled on the key).
gofmt,go vet,go build ./...,go test -race ./pkg/config ./pkg/agentgreen;
helm templaterenders thebase_urlkeys (and omits them whenempty).
Checklist
base_url= OpenAI default)feature:prefix, import grouping); docs + CHANGELOG