Skip to content

feat(provider): add oracle provider#170

Merged
SantiagoDePolonia merged 5 commits intomainfrom
feature/provider-oracle
Mar 25, 2026
Merged

feat(provider): add oracle provider#170
SantiagoDePolonia merged 5 commits intomainfrom
feature/provider-oracle

Conversation

@SantiagoDePolonia
Copy link
Copy Markdown
Contributor

@SantiagoDePolonia SantiagoDePolonia commented Mar 23, 2026

Summary

  • add a first-class Oracle provider built on Oracle's OpenAI-compatible API surface
  • require ORACLE_API_KEY and ORACLE_BASE_URL, and support configured models: as a fallback inventory when /models is unavailable
  • wire Oracle into startup/config discovery, recorder tooling, Helm/docs, and provider tests

Scope

  • supports chat completions, streaming chat, responses, and streaming responses
  • intentionally does not expose embeddings, files, native batches, or passthrough in this first slice

Verification

  • go test ./cmd/... ./internal/providers/... ./config/...
  • repository pre-commit checks passed during commit

Summary by CodeRabbit

  • New Features

    • Added Oracle as a supported OpenAI-compatible provider (requires ORACLE_API_KEY + ORACLE_BASE_URL).
  • Behavior

    • Oracle supports chat/responses, disables embeddings, and uses configurable model-list fallback when upstream listing is unavailable. Some tools seed an example Oracle model when none specified. Azure env var renamed from AZURE_API_BASE → AZURE_BASE_URL.
  • Documentation

    • Docs, guides, README, quickstart, Docker/Helm examples, and config references updated for Oracle and Azure base-URL guidance.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1d80ba21-7b75-4192-a2c2-1497b89aae9b

📥 Commits

Reviewing files that changed from the base of the PR and between 23ff14d and 75c278b.

📒 Files selected for processing (2)
  • internal/providers/oracle/oracle.go
  • internal/providers/oracle/oracle_test.go

📝 Walkthrough

Walkthrough

Adds Oracle as a new OpenAI‑compatible provider across code, configuration, docs, Helm, CLI, provider discovery/factory plumbing, and tests; renames Azure env var AZURE_API_BASEAZURE_BASE_URL; propagates configured models into provider constructors and implements Oracle-specific model-fallback and embeddings rejection.

Changes

Cohort / File(s) Summary
Env & Examples
\.env.template, config/config.example.yaml
Renamed Azure base env to AZURE_BASE_URL; added ORACLE_API_KEY and ORACLE_BASE_URL placeholders and a commented providers.oracle example with models.
Docs & Guides
README.md, CLAUDE.md, GETTING_STARTED.md, docs/adr/.../0001-explicit-provider-registration.md, docs/advanced/configuration.mdx, docs/guides/oracle.mdx, docs/docs.json, docs/getting-started/quickstart.mdx, helm/README.md
Documented Oracle across README/guides/quickstart/ADR; added Oracle config examples, gotchas (require base URL, model-fallback), and navigation/Helm docs entries.
CLI / Binaries
cmd/gomodel/main.go, cmd/recordapi/main.go
Registered Oracle in server startup; recordapi reads ORACLE_BASE_URL/ORACLE_API_KEY, enforces base-URL presence for providers that require it, treats Oracle as /v1/responses capable, and defaults model to openai.gpt-oss-120b when none supplied for Oracle.
Provider Auto-discovery & Config
internal/providers/config.go, internal/providers/config_test.go, config/config_test.go, internal/providers/init.go
Reworked discovery to use configurable DiscoveryConfig map passed into resolveProviders; env var names derived from provider type (e.g., *_API_KEY, *_BASE_URL); added Oracle discovery behavior and updated tests.
Provider Factory & Resolved Config
internal/providers/factory.go, internal/providers/factory_test.go, internal/providers/resolved_config.go
Added Models []string to ProviderOptions; changed ProviderConstructor to accept ProviderConfig; added DiscoveryConfig metadata and snapshot API; added ResolveBaseURL/ResolveAPIVersion helpers; updated tests to new constructor and model propagation.
Provider Implementations (constructors updated)
internal/providers/.../{openai,openrouter,azure,gemini,groq,ollama,xai,anthropic}/*.go
Switched provider New signatures to accept providers.ProviderConfig, use providerCfg.APIKey, and resolve base URLs via helpers; added Discovery metadata to registrations.
Oracle Provider Impl & Tests
internal/providers/oracle/oracle.go, internal/providers/oracle/oracle_test.go
New oracle provider registration and implementation: OpenAI‑compatible wrapper with auth header, delegates chat/responses, ListModels supports configured‑model fallback/merge, embeddings explicitly rejected, normalization logic, and unit tests covering behaviors.
Helm Chart & Schema
helm/templates/NOTES.txt, helm/values.schema.json, helm/values.yaml
Added providers.oracle values/schema (enabled, apiKey, baseUrl) with conditional validation requiring baseUrl when enabled or when apiKey set; NOTES updated to include Oracle in enabled‑provider detection.
Tests & Integration
tests/integration/setup_test.go, internal/providers/*_test.go, config/config_test.go
Updated many tests to pass ProviderConfig to constructors, cleared/renamed env vars in tests (AZURE_BASE_URL), added Oracle unit tests and discovery‑related test updates.
Minor CLI/docs examples
README.md Docker example, GETTING_STARTED.md examples
Replaced AZURE_API_BASE usages with AZURE_BASE_URL and added Oracle env examples (ORACLE_API_KEY, ORACLE_BASE_URL).

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI / Server
    participant Factory as ProviderFactory
    participant OracleProv as Oracle Provider
    participant Upstream as Oracle/OpenAI-Compatible API

    CLI->>Factory: Create provider (type: "oracle", cfg{APIKey, BaseURL, Models})
    Factory->>OracleProv: New(providerCfg, opts{Models, Hooks, Resilience})
    CLI->>OracleProv: Request ListModels / Chat / Responses
    OracleProv->>Upstream: GET /v1/models or POST /v1/responses (BaseURL + Authorization)
    alt Upstream returns models
        Upstream-->>OracleProv: models list
        OracleProv-->>CLI: filtered/merged models or responses
    else Upstream fails or models unusable
        OracleProv-->>CLI: return configured models (if present) or error (suggest configure providers.<name>.models)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 I hopped in with a key and a Base_URL bright,
wrapped an OpenAI-ish endpoint and set headers right.
When /models hide, my configured list will sing,
embeddings? kindly — "not supported" is the thing.
Docs, Helm, and tests now cheer — Oracle takes flight. 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.34% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding an Oracle provider. It is specific, directly related to the changeset, and avoids vague or generic terms.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/provider-oracle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CLAUDE.md`:
- Line 7: Update the provider environment variables section in CLAUDE.md to
include Oracle by adding ORACLE_API_KEY and ORACLE_BASE_URL to the listed
provider env vars so the docs match the new "Oracle" mention on line 7; ensure
the new entries follow the same formatting/style as the other provider variables
in that section and include a short note describing their purpose (API key and
base URL) for consistency.

In `@cmd/recordapi/main.go`:
- Around line 204-208: The code sets a provider-specific default model string
("openai.gpt-oss-120b") when *model is empty and *provider == "oracle" (see the
model/provider handling that populates reqBody["model"]); make this behavior
explicit by either (a) exposing the Oracle default as a configurable
flag/constant (e.g., oracleDefaultModel) and using that when building reqBody,
or (b) at minimum add a concise comment above the conditional explaining why
Oracle uses "openai.gpt-oss-120b" (and how it differs from the gpt-4o-mini
default for other providers) so callers understand the implicit choice. Ensure
the change references the same model/provider check that populates
reqBody["model"] in main.go.

In `@docs/adr/0001-explicit-provider-registration.md`:
- Line 5: Update the stale ADR note in
docs/adr/0001-explicit-provider-registration.md: in the "Negative consequences"
section replace the phrase "6 explicit Register calls" (or any occurrence of the
number 6 referring to provider count) with the correct count reflecting Oracle's
addition (e.g., "7 explicit Register calls") and ensure any surrounding text
still reads correctly after the numeric update.

In `@helm/README.md`:
- Line 62: Update the Helm README to document the required Oracle base URL
configuration: add an entry alongside `providers.oracle.enabled` that documents
`providers.oracle.baseUrl` and the corresponding secret/ENV name
`ORACLE_BASE_URL`, explain it's required when `providers.oracle.enabled` is
true, and show an example value and how to set it in the secrets/values
(matching existing `ORACLE_API_KEY` usage). Also add the same documentation in
the duplicate section referenced (line ~85) so both spots include
`providers.oracle.baseUrl`/`ORACLE_BASE_URL`.

In `@helm/templates/NOTES.txt`:
- Line 42: The Helm NOTES condition currently treats Oracle as enabled if
.Values.providers.oracle.enabled or .Values.providers.oracle.apiKey are set but
doesn't ensure .Values.providers.oracle.baseUrl is present; update the
if-expression that appends to $enabledProviders so it also requires a non-empty
.Values.providers.oracle.baseUrl (e.g., wrap the existing or (...) check inside
an and (...) with .Values.providers.oracle.baseUrl or a non-empty check),
ensuring $enabledProviders only gets "oracle" when baseUrl is provided.

In `@helm/values.schema.json`:
- Around line 182-189: The schema adds properties.providers.oracle but misses an
anyOf rule ensuring at least one provider is configured; add an anyOf entry for
"oracle" in the same anyOf array that validates properties.providers.oracle:
require either an object with properties.apiKey with minLength:1 (for
consistency) or, preferably, a combined check that both properties.apiKey and
properties.baseUrl have minLength:1 if Oracle must supply both—update the anyOf
array to include that new oracle validation entry referencing
properties.providers.oracle.apiKey and properties.providers.oracle.baseUrl.

In `@internal/providers/oracle/oracle_test.go`:
- Around line 147-160: Add a new unit test for normalizeConfiguredModels that
covers the all-empty/whitespace input edge case: create a test named
TestNormalizeConfiguredModels_AllEmpty which calls
normalizeConfiguredModels([]string{"", "   ", ""}) and asserts the result is nil
(e.g., if got != nil then t.Fatalf). This ensures the function returns nil when
all entries are empty or whitespace.

In `@internal/providers/oracle/oracle.go`:
- Around line 61-101: In Provider.ListModels, when p.configuredModels is
non-empty and the upstream call fails (err != nil after calling
p.compat.ListModels), the error is currently ignored; update the function to
emit a debug/warn log containing the upstream error and context (e.g., indicate
fallback to configuredModels) before proceeding with the fallback. Locate
references to configuredModels, resp, err, and byID inside ListModels and add a
single log statement using the provider's logger (for example p.logger or p.log)
to include err and a concise message like "upstream ListModels failed, using
configuredModels fallback". Ensure the log is non-fatal and only recorded when
err != nil and configuredModels is non-empty.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 12bb2ac6-892e-4be5-9a68-a30881940283

📥 Commits

Reviewing files that changed from the base of the PR and between a0a1d06 and b6372bd.

📒 Files selected for processing (20)
  • .env.template
  • CLAUDE.md
  • GETTING_STARTED.md
  • README.md
  • cmd/gomodel/main.go
  • cmd/recordapi/main.go
  • config/config.example.yaml
  • config/config_test.go
  • docs/adr/0001-explicit-provider-registration.md
  • docs/advanced/configuration.mdx
  • helm/README.md
  • helm/templates/NOTES.txt
  • helm/values.schema.json
  • helm/values.yaml
  • internal/providers/config.go
  • internal/providers/config_test.go
  • internal/providers/factory.go
  • internal/providers/factory_test.go
  • internal/providers/oracle/oracle.go
  • internal/providers/oracle/oracle_test.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/recordapi/main.go`:
- Around line 202-211: The code currently aliases eConfig.requestBody into
reqBody and mutates reqBody["model"], which can mutate shared fixtures
(endpointConfigs); instead, create a shallow copy of the map before modifying it
(e.g., allocate a new map and copy key/value pairs from eConfig.requestBody) so
changes to reqBody do not affect the original; update the block that handles
eConfig.requestBody (where reqBody is assigned and model is overridden) to use
the copied map when writing reqBody["model"] and ensure subsequent use reads
from the copied map.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 662ee72a-8e81-4187-894d-75f855550cf9

📥 Commits

Reviewing files that changed from the base of the PR and between b6372bd and dffd8b6.

📒 Files selected for processing (8)
  • CLAUDE.md
  • cmd/recordapi/main.go
  • docs/adr/0001-explicit-provider-registration.md
  • helm/README.md
  • helm/templates/NOTES.txt
  • helm/values.schema.json
  • internal/providers/oracle/oracle.go
  • internal/providers/oracle/oracle_test.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/providers/oracle/oracle.go`:
- Around line 63-72: The error returned from Provider.ListModels when
p.compat.ListModels fails must be converted to a core.GatewayError; update the
error path in ListModels (the block that checks len(p.configuredModels) == 0 and
err != nil) to return a core.GatewayError with category "provider_error" (or the
appropriate provider error constant) and include the original err as the
cause/message so clients receive a typed GatewayError instead of fmt.Errorf;
locate this logic in Provider.ListModels referencing p.compat.ListModels and
p.configuredModels and replace the plain fmt.Errorf return with construction of
the core.GatewayError.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 732e5c93-f8c4-42c8-90d4-51e46489390d

📥 Commits

Reviewing files that changed from the base of the PR and between dffd8b6 and 0b3973a.

📒 Files selected for processing (5)
  • docs/advanced/configuration.mdx
  • docs/docs.json
  • docs/guides/oracle.mdx
  • internal/providers/oracle/oracle.go
  • internal/providers/oracle/oracle_test.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
internal/providers/oracle/oracle.go (1)

67-76: ⚠️ Potential issue | 🟡 Minor

Return core.GatewayError for client-facing consistency.

Per coding guidelines, all errors returned to clients must be instances of core.GatewayError. The ListModels method is called by client-facing endpoints, so this error should use core.NewProviderError instead of fmt.Errorf.

🛠️ Suggested fix
 func (p *Provider) ListModels(ctx context.Context) (*core.ModelsResponse, error) {
 	resp, err := p.compat.ListModels(ctx)
 	if len(p.configuredModels) == 0 {
 		if err != nil {
-			return nil, fmt.Errorf(
-				"oracle ListModels failed: %w; configure providers.<name>.models to use Oracle when upstream /models is unavailable",
-				err,
+			return nil, core.NewProviderError(
+				"oracle",
+				http.StatusBadGateway,
+				"ListModels failed; configure providers.<name>.models to use Oracle when upstream /models is unavailable",
+				err,
 			)
 		}
 		return resp, nil
 	}

As per coding guidelines: "All errors returned to clients must be instances of core.GatewayError" and "Use typed client-facing error categories: provider_error..."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/providers/oracle/oracle.go` around lines 67 - 76, Replace the raw
fmt.Errorf error in Provider.ListModels with a core.GatewayError using
core.NewProviderError so clients receive a typed provider_error; specifically,
in the ListModels method on type Provider (the block that currently does `if err
!= nil { return nil, fmt.Errorf(...) }`) construct and return
core.NewProviderError("oracle", fmt.Errorf(...)) or equivalent per project
helpers, keeping the original error message text/context and wrapping the
underlying err so the returned error implements core.GatewayError.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/providers/resolved_config.go`:
- Around line 6-11: ResolveBaseURL trims baseURL to check for emptiness but
returns the original untrimmed baseURL; change the function to return the
trimmed value (use strings.TrimSpace(baseURL)) when non-empty so callers get a
normalized URL instead of one with leading/trailing whitespace, keeping fallback
behavior unchanged.
- Around line 14-19: ResolveAPIVersion currently checks for empty apiVersion
using TrimSpace but returns the original apiVersion which may contain
surrounding whitespace; update ResolveAPIVersion to trim apiVersion once (e.g.,
trimmed := strings.TrimSpace(apiVersion)) and if trimmed == "" return fallback
else return trimmed so callers consistently receive a cleaned API version string
(refer to function ResolveAPIVersion and its parameters apiVersion and
fallback).

---

Duplicate comments:
In `@internal/providers/oracle/oracle.go`:
- Around line 67-76: Replace the raw fmt.Errorf error in Provider.ListModels
with a core.GatewayError using core.NewProviderError so clients receive a typed
provider_error; specifically, in the ListModels method on type Provider (the
block that currently does `if err != nil { return nil, fmt.Errorf(...) }`)
construct and return core.NewProviderError("oracle", fmt.Errorf(...)) or
equivalent per project helpers, keeping the original error message text/context
and wrapping the underlying err so the returned error implements
core.GatewayError.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: be2d0289-23e6-4e84-8cdf-27afca2ed16f

📥 Commits

Reviewing files that changed from the base of the PR and between 0b3973a and 23ff14d.

📒 Files selected for processing (31)
  • .env.template
  • GETTING_STARTED.md
  • README.md
  • config/config.example.yaml
  • config/config_test.go
  • docs/adr/0001-explicit-provider-registration.md
  • docs/advanced/configuration.mdx
  • docs/getting-started/quickstart.mdx
  • internal/providers/anthropic/anthropic.go
  • internal/providers/anthropic/anthropic_test.go
  • internal/providers/azure/azure.go
  • internal/providers/config.go
  • internal/providers/config_test.go
  • internal/providers/factory.go
  • internal/providers/factory_test.go
  • internal/providers/gemini/gemini.go
  • internal/providers/gemini/gemini_test.go
  • internal/providers/groq/groq.go
  • internal/providers/groq/groq_test.go
  • internal/providers/init.go
  • internal/providers/ollama/ollama.go
  • internal/providers/ollama/ollama_test.go
  • internal/providers/openai/compatible_provider.go
  • internal/providers/openai/openai.go
  • internal/providers/openai/openai_test.go
  • internal/providers/openrouter/openrouter.go
  • internal/providers/oracle/oracle.go
  • internal/providers/resolved_config.go
  • internal/providers/xai/xai.go
  • internal/providers/xai/xai_test.go
  • tests/integration/setup_test.go

Comment on lines +6 to +11
func ResolveBaseURL(baseURL, fallback string) string {
if strings.TrimSpace(baseURL) == "" {
return fallback
}
return baseURL
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider returning the trimmed value for consistency.

ResolveBaseURL trims the input to check for emptiness but returns the original untrimmed value. If the input contains leading/trailing whitespace (e.g., " https://api.example.com "), the returned URL will include that whitespace, which could cause issues with HTTP clients.

♻️ Suggested fix to return trimmed value
 func ResolveBaseURL(baseURL, fallback string) string {
-	if strings.TrimSpace(baseURL) == "" {
+	trimmed := strings.TrimSpace(baseURL)
+	if trimmed == "" {
 		return fallback
 	}
-	return baseURL
+	return trimmed
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func ResolveBaseURL(baseURL, fallback string) string {
if strings.TrimSpace(baseURL) == "" {
return fallback
}
return baseURL
}
func ResolveBaseURL(baseURL, fallback string) string {
trimmed := strings.TrimSpace(baseURL)
if trimmed == "" {
return fallback
}
return trimmed
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/providers/resolved_config.go` around lines 6 - 11, ResolveBaseURL
trims baseURL to check for emptiness but returns the original untrimmed baseURL;
change the function to return the trimmed value (use strings.TrimSpace(baseURL))
when non-empty so callers get a normalized URL instead of one with
leading/trailing whitespace, keeping fallback behavior unchanged.

Comment on lines +14 to +19
func ResolveAPIVersion(apiVersion, fallback string) string {
if strings.TrimSpace(apiVersion) == "" {
return fallback
}
return apiVersion
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Same consideration applies to ResolveAPIVersion.

For consistency and robustness, consider returning the trimmed value here as well.

♻️ Suggested fix
 func ResolveAPIVersion(apiVersion, fallback string) string {
-	if strings.TrimSpace(apiVersion) == "" {
+	trimmed := strings.TrimSpace(apiVersion)
+	if trimmed == "" {
 		return fallback
 	}
-	return apiVersion
+	return trimmed
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func ResolveAPIVersion(apiVersion, fallback string) string {
if strings.TrimSpace(apiVersion) == "" {
return fallback
}
return apiVersion
}
func ResolveAPIVersion(apiVersion, fallback string) string {
trimmed := strings.TrimSpace(apiVersion)
if trimmed == "" {
return fallback
}
return trimmed
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/providers/resolved_config.go` around lines 14 - 19,
ResolveAPIVersion currently checks for empty apiVersion using TrimSpace but
returns the original apiVersion which may contain surrounding whitespace; update
ResolveAPIVersion to trim apiVersion once (e.g., trimmed :=
strings.TrimSpace(apiVersion)) and if trimmed == "" return fallback else return
trimmed so callers consistently receive a cleaned API version string (refer to
function ResolveAPIVersion and its parameters apiVersion and fallback).

@SantiagoDePolonia SantiagoDePolonia merged commit a617ba1 into main Mar 25, 2026
16 checks passed
@SantiagoDePolonia SantiagoDePolonia deleted the feature/provider-oracle branch April 4, 2026 11:36
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.

1 participant