Skip to content

fix(config): validate all model providers#185

Open
MicroMilo wants to merge 1 commit into
OpenBMB:mainfrom
MicroMilo:codex/fix-unused-provider-validation
Open

fix(config): validate all model providers#185
MicroMilo wants to merge 1 commit into
OpenBMB:mainfrom
MicroMilo:codex/fix-unused-provider-validation

Conversation

@MicroMilo

Copy link
Copy Markdown

Summary

  • validate the base shape of every configured model provider, not only the active agent provider
  • keep active-provider protocol/url requirements on the active path
  • add a focused server-side regression test for an unused provider missing apiKey

Verification

  • npm --workspace ui exec vitest run server/services/pilotdeckConfig.provider-validation.test.js
  • npm exec -- tsc --noEmit -p tsconfig.json

Notes

This is a real config/runtime mismatch: the UI save path previously allowed invalid unused providers, while the runtime parses all providers during reload.

@MicroMilo

Copy link
Copy Markdown
Author

Validation note:

This PR closes a real validation/runtime contract gap.

The runtime model parser processes every configured entry under model.providers, not only the provider referenced by agent.model. Before this change, UI/server validation only enforced full provider requirements on the active provider path, so an invalid unused provider could pass /api/config/validate and then fail later during runtime reload/startup.

The regression test captures the minimal failing case:

  • agent.model points to a valid main/gpt-test provider/model.
  • model.providers.unused is present but has an empty apiKey.
  • Validation now fails with model.providers.unused.apiKey is required.

Validation commands used by this PR:

npm --workspace ui exec vitest run server/services/pilotdeckConfig.provider-validation.test.js
npm exec -- tsc --noEmit -p tsconfig.json

This test is directly tied to the workflow contract:
UI config validation -> validatePilotDeckConfig -> runtime model provider parsing.

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