Skip to content

feat(dashboard): show only the credential fields each provider type uses - #591

Merged
SantiagoDePolonia merged 3 commits into
mainfrom
feat/providers-options
Jul 25, 2026
Merged

feat(dashboard): show only the credential fields each provider type uses#591
SantiagoDePolonia merged 3 commits into
mainfrom
feat/providers-options

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What

The provider add/edit modal showed every field the wire format has, whatever the type: an OpenAI provider asked for Vertex project, GCP scope and service-account JSON. The only feedback on a bad save was a single banner at the top of the form.

Provider registrations already know which fields they read, so the form is now built from that knowledge instead of duplicating it.

Type Form now asks for
openai API Keys (required); Base URL, Models under Advanced
azure API Keys, Base URL (both required), API Version
ollama / vllm optional key, Base URL up front — with no key to fill in, the endpoint is the configuration
bedrock region/endpoint only — it authenticates through the AWS SDK chain, never a key
vertex no API key field at all: Auth Type, project, location, service account
gemini optional key + Backend, with the Google auth fields folded into Advanced

How

  • providers.DiscoveryConfig gains CredentialFields. Most types derive their form from the flags already there (AllowAPIKeyless, RequireBaseURL, SupportsAPIVersion); only the four that do not fit the "API key against one endpoint" shape declare one. Deriving from the same struct that drives env/YAML resolution means the form and the resolver cannot disagree about what a type needs.
  • GET /admin/provider-credentials/types now returns those forms alongside each type. Admin API shape change: []string[{type, default_base_url, fields[{name, required, advanced, options}]}]. The dashboard is the only consumer; the S196 e2e assertion and swagger are updated.
  • field.name is the same string in the schema, the PUT payload, and an error's param — that is what lets a server-side rejection land on the input that caused it.

Error handling

Validation now runs before anything is persisted. Previously an unusable credential was written to the store and then reported as provider "x" was saved but not applied, leaving a broken row behind. It is now rejected with a 400 whose error.param names the field, and nothing is stored:

PUT {"name":"x","type":"openai"}
400 {"error":{"message":"at least one API key is required for provider type \"openai\"",
              "param":"api_keys","type":"invalid_request_error"}}

The dashboard attaches the message to that input, opens the Advanced section if the field lives there, and focuses it. The client validates only what the schema can decide (required fields, blank key rows, duplicate/slashed names, malformed service-account JSON, a scheme-less base URL); cross-field provider rules — project-or-base-URL, service-account-when-gcp_service_account, api_key not authenticating against Vertex — stay server-side so provider knowledge is not duplicated in JS.

Not a whitelist

options are the values a form should offer, not the values the API accepts. Providers accept further spellings of each (openai_compatible, compat, adc, service_account) and the docs and config.example.yaml use them, so rejecting those would make the admin API stricter than the config.yaml and env vars it exists to replace. Two consequences, both covered by tests:

  • a stored value outside the list joins the select instead of rendering blank — otherwise saving an untouched row would silently clear it;
  • a stored value the form does not render at all is sent back untouched, so a field missing from a schema by mistake cannot quietly destroy a working setting.

That last rule caught a real one in review: Vertex honours api_mode (via the Gemini adapter it delegates translation to — VERTEX_API_MODE is documented), and the first draft of its form omitted it.

Verified

go test ./..., golangci-lint, 354 dashboard tests, svelte-check, and the full pre-commit suite (race, dist-sync, perf guard) are green. Also driven against a running gateway: each type renders its own fields, a blank required key and a scheme-less base URL are caught locally, a Vertex-backed Gemini without a project comes back from the server onto vertex_project, openai_compatible/adc round-trip untouched, and create/list/edit works end to end.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Provider credential forms now adapt dynamically to each provider’s supported fields, options, and default connection details.
    • The admin provider type listing now returns credential form metadata (field requirements, advanced fields, and base URL), and the dashboard adds MCP_ENABLED.
  • Bug Fixes

    • Invalid credential submissions now return field-specific error.param errors and prevent invalid data from being saved.
    • Improved handling of redacted placeholder credential values so users can safely resubmit.
  • Documentation

    • Updated admin documentation and API spec for the enhanced provider types endpoint.

The provider add/edit modal offered every field the wire format has, so an
OpenAI provider asked for Vertex project and service-account JSON, and the
only feedback on a bad save was one banner at the top of the form.

Provider registrations already know what they read, so the form is now built
from that. `DiscoveryConfig` gains `CredentialFields`; most types derive their
form from the existing discovery flags, and only the four that do not fit the
"API key against one endpoint" shape declare one. `GET
/admin/provider-credentials/types` returns those forms alongside each type
(`[]string` -> `[{type, default_base_url, fields[]}]`), and the dashboard
renders exactly them: Vertex shows no API key field, Azure marks the base URL
required, Ollama leads with the endpoint, enumerated fields become selects.

Upserts are validated against the same forms before anything is persisted.
Previously an unusable credential was written to the store and then reported
as "saved but not applied", leaving a broken row behind; it is now rejected
with a 400 whose `error.param` names the offending field, and the dashboard
attaches the message to that input, opening the advanced section and focusing
it when needed.

A field's `options` are the values a form should offer, not a whitelist: the
providers accept further spellings of each (`openai_compatible`, `compat`,
`adc`) and the docs use them, so the admin API must not be stricter than the
config.yaml and env vars it replaces. A stored value outside the list joins the
select rather than rendering blank, and a stored value the form does not render
at all is sent back untouched, so no schema gap can silently clear a working
setting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 18:16

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@SantiagoDePolonia, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4c1ba1bb-4040-4d6a-b9fe-cfbbb249fd8b

📥 Commits

Reviewing files that changed from the base of the PR and between 8863f18 and 20a3139.

📒 Files selected for processing (2)
  • internal/providers/credential_validate.go
  • internal/providers/credential_validate_test.go
📝 Walkthrough

Walkthrough

Provider discovery now exposes credential schemas used by backend validation, structured admin API responses, and schema-driven dashboard forms. Upserts return field-specific errors before persistence, while provider registrations describe provider-specific fields and authentication options.

Changes

Provider credential schema flow

Layer / File(s) Summary
Credential schema and provider discovery
internal/providers/{credential_schema,factory}.go, internal/providers/{bedrock,bedrockmantle,gemini,vertex}/*, internal/providers/*_test.go, run/providers_test.go
Provider registrations define credential fields, schema generation derives defaults and ordering, and tests cover provider-specific forms.
Backend validation and admin integration
internal/providers/{credential_validate,credentials}.go, internal/admin/handler_provider_credentials*
Upserts validate required and provider-specific fields before storage, preserve redacted values, and return errors identifying the invalid field. The admin types endpoint returns structured credential metadata.
Admin API contracts and release scenarios
cmd/gomodel/docs/docs.go, docs/openapi.json, CLAUDE.md, tests/e2e/release-e2e-scenarios.md
OpenAPI documentation and release scenarios describe structured provider forms, runtime configuration metadata, and field-specific validation responses.
Dashboard schema-driven form logic
web/dashboard/src/pages/providers-config/providersConfigLogic.js, web/dashboard/src/pages/providers-config/providersConfig.svelte.js
Dashboard state derives fields from provider schemas, validates per field, builds schema-aware payloads, and routes server errors to focused controls.
Dynamic dashboard rendering and validation feedback
web/dashboard/src/pages/providers-config/*.svelte, web/dashboard/src/styles/dashboard.css, web/dashboard/tests/providers-config.test.js
Credential controls render dynamically with inline accessibility feedback, field-specific styling, and expanded logic tests.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant AdminAPI
  participant CredentialsService
  participant ProviderFactory
  participant CredentialStore
  Dashboard->>AdminAPI: Request provider credential types
  AdminAPI->>CredentialsService: Load credential schemas
  CredentialsService->>ProviderFactory: Read discovery schemas
  ProviderFactory-->>AdminAPI: Return structured provider fields
  Dashboard->>AdminAPI: Submit provider credential
  AdminAPI->>CredentialsService: Validate and upsert credential
  CredentialsService->>CredentialStore: Persist validated row
  CredentialStore-->>Dashboard: Return success or field-specific error
Loading

Possibly related PRs

  • ENTERPILOT/GoModel#302: Adds the Vertex provider and its credential/auth model touched by this schema metadata.
  • ENTERPILOT/GoModel#566: Implements the provider credentials admin subsystem extended here with structured schemas.
  • ENTERPILOT/GoModel#569: Changes provider-credential redacted-value handling used by the updated upsert flow.

Suggested reviewers: copilot

Poem

I’m a rabbit with schemas to share,
Mapping each credential field with care.
Errors now hop to the right little place,
Forms bloom dynamically, neat in their space.
APIs describe every carrot and key—
Validation keeps the burrow bug-free!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.51% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: provider forms now show only the credential fields each provider type uses.
Description check ✅ Passed The description is detailed and on-topic, but it does not follow the repository template headings like "## Description" and "## AI Generated".
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/providers-options

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.

@mintlify

mintlify Bot commented Jul 25, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Jul 25, 2026, 6:17 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@codecov-commenter

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 76.64975% with 46 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/providers/credential_schema.go 58.90% 30 Missing ⚠️
internal/providers/credential_validate.go 87.87% 7 Missing and 1 partial ⚠️
internal/admin/handler_provider_credentials.go 88.57% 3 Missing and 1 partial ⚠️
internal/providers/credentials.go 88.23% 1 Missing and 1 partial ⚠️
internal/providers/gemini/gemini.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/providers/credential_schema_test.go`:
- Around line 31-116: Convert the credential-schema tests, especially
TestCredentialSchemas_DerivesTheFormFromDiscoveryFlags and
TestCredentialSchemas_UsesTheRegistrationsDeclaredForm, into table-driven
coverage. Add cases for default configuration plus Bedrock, Mantle, Gemini, and
Vertex registration field mappings and options, asserting each generated schema
matches the admin contract and declared ordering. Reuse shared field and schema
assertions so registration metadata drift is detected consistently.

In `@web/dashboard/src/pages/providers-config/providersConfig.svelte.js`:
- Around line 174-181: Update selectType to clear values from the previous
provider type that are not rendered by the newly selected type, while preserving
fields needed for edit-mode value retention. Ensure stale values such as
vertex_project are removed before buildProviderCredentialPayload submits the
form, without clearing fields currently present in this.formFields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c8d3379a-e264-4538-a323-be22a6c8b41e

📥 Commits

Reviewing files that changed from the base of the PR and between 8210cda and 034b8b2.

⛔ Files ignored due to path filters (5)
  • internal/admin/dashboard/static/dist/assets/index-BSE-2hNO.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-BgPgxKXk.css is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-jpXFjnTT.css is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-nDWTc8Kq.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (22)
  • CLAUDE.md
  • cmd/gomodel/docs/docs.go
  • docs/openapi.json
  • internal/admin/handler_provider_credentials.go
  • internal/admin/handler_provider_credentials_test.go
  • internal/providers/bedrock/bedrock.go
  • internal/providers/bedrockmantle/bedrock_mantle.go
  • internal/providers/credential_schema.go
  • internal/providers/credential_schema_test.go
  • internal/providers/credential_validate.go
  • internal/providers/credential_validate_test.go
  • internal/providers/credentials.go
  • internal/providers/factory.go
  • internal/providers/gemini/gemini.go
  • internal/providers/vertex/vertex.go
  • tests/e2e/release-e2e-scenarios.md
  • web/dashboard/src/pages/providers-config/ProviderCredentialEditor.svelte
  • web/dashboard/src/pages/providers-config/ProviderCredentialField.svelte
  • web/dashboard/src/pages/providers-config/providersConfig.svelte.js
  • web/dashboard/src/pages/providers-config/providersConfigLogic.js
  • web/dashboard/src/styles/dashboard.css
  • web/dashboard/tests/providers-config.test.js

Comment thread internal/providers/credential_schema_test.go
Comment thread web/dashboard/src/pages/providers-config/providersConfig.svelte.js
@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Confidence Score: 3/5

This PR should not merge until Gemini save-time validation matches its runtime backend and authentication requirements.

Gemini credentials can pass the new pre-persistence validation even though the provider later rejects them, leaving operators with a successfully saved but unusable provider.

Files Needing Attention: internal/providers/credential_validate.go, internal/providers/gemini/gemini.go

T-Rex T-Rex Logs

What T-Rex did

  • Reproduced Gemini backend validation divergence by running the real CredentialsService save path with the backend omitted and API-key authentication, confirming that the upsert persisted the enabled credential while Gemini reported a rejection and a later ListModels check showed a Vertex-auth requirement.
  • Compared the provider credential editor before and after changes, confirming OpenAI now requires API Keys with Base URL and Models in Advanced, and that inline validation highlights missing keys.

View all artifacts

T-Rex Ran code and verified through T-Rex

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  R[Provider registration] --> S[Credential schema]
  S --> A[Admin types endpoint]
  A --> D[Dashboard form]
  D --> P[Credential PUT]
  P --> V[Save-time validation]
  V --> B[Provider construction]
  B --> T[Credential persistence]
  T --> G[Live registry]
Loading

Reviews (1): Last reviewed commit: "feat(dashboard): show only the credentia..." | Re-trigger Greptile

Comment on lines +34 to +36
if raw := cred.toRawProviderConfig(); isVertexProviderConfig(raw) {
return validateGoogleCredential(cred)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Gemini backend validation diverges

When a Gemini credential omits backend, this check treats it as non-Vertex and the optional schema key passes validation, while runtime normalization defaults to AI Studio or infers Vertex from project fields. This allows configurations that later fail because AI Studio has no API key or Vertex is configured with API-key authentication.

Artifacts

Repro: narrow Go test exercising credential save, persistence, registration, and Gemini runtime readiness

  • Evidence file captured while the check ran.

Repro: verbose test output showing successful persistence followed by inferred-Vertex authentication failure

  • The full command output behind this check.

View artifacts

T-Rex Ran code and verified through T-Rex

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in 20a3139. The divergence is real: normalizeGeminiBackend infers Vertex from vertex_project/vertex_location alone, while isVertexProviderConfig (resolution) only recognizes an explicit backend.

One correction to the finding: such a row was not persisted. CredentialsService.Upsert builds the adapter before writing, so it was already rejected — but resolution blamed api_keys, telling an operator who deliberately configured Vertex to supply a key they do not have.

Validation now names the field that actually resolves the ambiguity:

PUT {"name":"g1","type":"gemini","vertex_project":"p","vertex_location":"us-central1"}
400 param: backend
    set backend to "vertex" to authenticate with the Vertex project and location, or provide an API key

Adding "backend":"vertex" is accepted (200) and hands the row to the Google rules, which it satisfies. A row that carries an API key is left alone: it resolves and runs, and the adapter's own inference takes it from there.

The check keys off the schema (backend offered with a vertex option) rather than the type name, so it does not fire for the vertex type, which has no backend to choose. Covered by TestValidateCredential_VertexFieldsNeedAnExplicitBackend.

I deliberately did not change isVertexProviderConfig to mirror the adapter's inference: that predicate is shared with startup resolution for config.yaml/env providers, so widening it would change which declarative providers register — out of scope here and worth its own change.

The payload echoes back values the form does not render, so that editing a
stored row cannot silently clear a setting its type's form has no field for.
In the create form that same rule leaked: a value typed under one type — say a
Vertex project entered while gemini was selected — stayed in the form after
switching to openai and was submitted with it, invisible to the operator. If
the gateway rejected it, `error.param` named a field that is not on screen and
the message had nowhere to land.

Changing type now resets every value the new type's form does not render.
Only creating clears: an existing provider's type is immutable, so the echo
still protects stored values there.

Also pin the shipped registrations' credential forms in a table-driven test.
It fails if a registration stops declaring a field its adapter reads — the
regression that removed Vertex's api_mode from the form in the first place.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 18:32

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

A Gemini adapter infers the Vertex backend from vertex_project/vertex_location
alone, but credential resolution only recognizes an explicit `backend` and so
still demands an API key. A row with the Vertex fields filled in and no
backend was therefore rejected for a missing key — asking the operator to
produce a credential they deliberately were not using.

Validation now names `backend` for that shape: set it to vertex, or provide a
key. A row that carries a key is left alone, since it resolves and runs with
the adapter's own inference.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 18:36

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@run/providers_test.go`:
- Around line 106-111: Update the required-field assertions in the schema test
loop around schema.Field(name) to validate both directions: ensure fields listed
in tt.required are required and ensure fields not listed are not required.
Mirror the symmetric per-field checks used by
TestCredentialSchemas_DerivesTheFormFromDiscoveryFlags, including cases such as
openai base_url.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 39630332-b789-4d18-a25b-01a7c2b0f03b

📥 Commits

Reviewing files that changed from the base of the PR and between 034b8b2 and 8863f18.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-BMU0Aq5G.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (5)
  • internal/providers/credential_schema_test.go
  • run/providers_test.go
  • web/dashboard/src/pages/providers-config/providersConfig.svelte.js
  • web/dashboard/src/pages/providers-config/providersConfigLogic.js
  • web/dashboard/tests/providers-config.test.js

Comment thread run/providers_test.go
Comment on lines +106 to +111
for _, name := range tt.required {
field, found := schema.Field(name)
if !found || !field.Required {
t.Errorf("%s.Required = %v (present=%v), want true", name, field.Required, found)
}
}

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.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Required check only verifies the positive case — add the negative assertion.

This only fails if a listed field is not required; it won't catch a field incorrectly becoming required (e.g. base_url on openai). The sibling test in credential_schema_test.go (TestCredentialSchemas_DerivesTheFormFromDiscoveryFlags) already checks both directions for every field — mirror that here for symmetric coverage.

♻️ Proposed fix
-			for _, name := range tt.required {
-				field, found := schema.Field(name)
-				if !found || !field.Required {
-					t.Errorf("%s.Required = %v (present=%v), want true", name, field.Required, found)
-				}
-			}
+			for _, field := range schema.Fields {
+				want := slices.Contains(tt.required, field.Name)
+				if field.Required != want {
+					t.Errorf("%s.Required = %v, want %v", field.Name, field.Required, want)
+				}
+			}
📝 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
for _, name := range tt.required {
field, found := schema.Field(name)
if !found || !field.Required {
t.Errorf("%s.Required = %v (present=%v), want true", name, field.Required, found)
}
}
for _, field := range schema.Fields {
want := slices.Contains(tt.required, field.Name)
if field.Required != want {
t.Errorf("%s.Required = %v, want %v", field.Name, field.Required, want)
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@run/providers_test.go` around lines 106 - 111, Update the required-field
assertions in the schema test loop around schema.Field(name) to validate both
directions: ensure fields listed in tt.required are required and ensure fields
not listed are not required. Mirror the symmetric per-field checks used by
TestCredentialSchemas_DerivesTheFormFromDiscoveryFlags, including cases such as
openai base_url.

@SantiagoDePolonia
SantiagoDePolonia merged commit ec6c279 into main Jul 25, 2026
18 checks passed
@mintlify

mintlify Bot commented Jul 25, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟡 Building Jul 25, 2026, 6:16 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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.

3 participants