Repository navigation
fix(agent): refuse spec.config.endpoint for gemini/google Agents - #219
Merged
Merged
Conversation
The pinned gemini client ignores spec.config.endpoint and takes a base-URL override only from GOOGLE_GEMINI_BASE_URL, so an endpoint on an allowlisted origin was accepted and silently ignored. Refuse it with an error that says to set GOOGLE_GEMINI_BASE_URL in the agent-executor process environment (Helm: agentExecutor.env). The refusal comes before the allowlist check. The apply-time webhook warning now says which providers use the field and that google, gemini and nirmata always fail when it is set. Docs correction: the anthropic client does use config.endpoint (its scheme and host, unless ANTHROPIC_BASE_URL is set). The API docs, regenerated CRDs and the custom-endpoint sample said otherwise. BREAKING CHANGE: gemini/google Agents that set config.endpoint with an allowlisted origin (previously a silent no-op) now fail at run time. Where the endpoint was already refused (allowlist unset, origin not listed, or not origin-only), only the error message changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approved
No active review issues remain for the provider endpoint changes, though tests and builds were not run during this review.
No open issues 🎉
What changed in this PR
This PR makes OttoFlow reject spec.config.endpoint at runtime for Gemini/Google Agents instead of silently ignoring it, directing operators to GOOGLE_GEMINI_BASE_URL.
Changes:
- Reject Gemini/Google endpoints before checking the operator allowlist, with regression coverage.
- Update admission warnings while continuing to admit affected Agents.
- Correct Anthropic endpoint documentation and synchronize API references, generated CRDs, and sample comments.
Tests and builds were not run during this review.
| File | Description |
|---|---|
samples/workflows/features/agent-custom-endpoint.yaml |
Corrects provider endpoint behavior in sample comments. |
internal/webhook/agent_validator_test.go |
Checks that endpoint warnings mention Google and Gemini. |
internal/webhook/agent_mcpserver_validators.go |
Clarifies provider-specific endpoint warnings. |
internal/agent/default_executor.go |
Rejects Gemini/Google endpoints before allowlist validation. |
internal/agent/default_executor_test.go |
Tests rejection precedence and adjusts other provider assertions. |
docs/user/reference/api/api-docs.md |
Updates generated endpoint configuration documentation. |
docs/user/reference/api/agent.md |
Documents endpoint support and Gemini/Google migration guidance. |
config/crd/bases/ottoflow.nirmata.io_agents.yaml |
Synchronizes generated Agent CRD descriptions. |
charts/ottoflow/crds/ottoflow.nirmata.io_agents.yaml |
Synchronizes Helm’s generated Agent CRD descriptions. |
api/v1alpha1/agent_types.go |
Corrects source API comments describing endpoint behavior. |
Review effort: Balanced
patelrit
approved these changes
Nov 3, 2026
patelrit
left a comment
There was a problem hiding this comment.
Approved: Copilot 🟢 on head, no open threads, CI green, unit tests, and E2E passed on the head commit (run 41694357706).
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
spec.config.endpointis set; the webhook still admits the Agent with a warning. The pinned gemini client ignores it (it takes a base-URL override only fromGOOGLE_GEMINI_BASE_URL), so an endpoint on an allowlisted origin was accepted and silently ignored. The error says to setGOOGLE_GEMINI_BASE_URLin the agent-executor process environment (Helm:agentExecutor.env). The refusal comes before the allowlist check.config.endpointis reworded. It names the providers that use the field (anthropic, azure-openai) and says google, gemini and nirmata always fail when it is set.config.endpoint(the pinned client uses its scheme and host unlessANTHROPIC_BASE_URLis set). The API docs, CRDs (regenerated) and the custom-endpoint sample said otherwise.Release note
Breaking, but bounded: gemini/google Agents that set
config.endpointwith an allowlisted origin (until now a silent no-op) now fail at run time with an error pointing atGOOGLE_GEMINI_BASE_URL. Where the endpoint was already refused (allowlist unset, origin not listed, or endpoint or allowlist entry not origin-only), only the error message changes. No sample, doc or e2e in the repo uses that combination.Testing
go test ./internal/agent/...,go test ./internal/webhook/..., build, vet, gofmt andottoflow validate --workflow-dir samplespass. Local runs used a go build overlay carrying the one-line fix from fix(controller): use Phase.IsTerminal in legacy binding GC #211, which has since merged, where the controller package is needed.🤖 Generated with Claude Code