Skip to content

chore: Fix provider configuration state#1664

Open
fengju0213 wants to merge 1 commit into
mainfrom
codex/fix-provider-config-state
Open

chore: Fix provider configuration state#1664
fengju0213 wants to merge 1 commit into
mainfrom
codex/fix-provider-config-state

Conversation

@fengju0213

@fengju0213 fengju0213 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the provider configuration flow so a successfully validated BYOK/custom provider is saved, refreshed, and marked configured correctly.

Fixes #1665

Root Cause

The frontend sent is_valid, while the server model uses the existing is_vaild field. The server update allowlist also omitted endpoint_url, model_type, and encrypted_config, so updates could appear successful while leaving the stored provider unchanged. New providers could also fail to become the default immediately because the frontend read provider_id from stale React state.

Changes

  • Send and read the provider validity state using the server-compatible is_vaild field, while still accepting is_valid for compatibility.
  • Allow provider updates to persist endpoint_url, model_type, and encrypted_config.
  • Use the freshly loaded provider id when setting a newly saved provider as default.
  • Add server coverage for the is_valid compatibility input.

Impact

This affects all custom/BYOK providers, including AWS Bedrock and AWS Bedrock Converse. Direct AWS Bedrock users should still use the Bedrock Converse provider; the plain Bedrock provider remains for OpenAI-compatible Bedrock gateways.

Validation

  • npm run type-check
  • npx eslint src/pages/Agents/Models.tsx --no-warn-ignored --quiet
  • uv run --extra dev pytest tests/test_provider_model.py
  • uv run ruff check app/model/provider/provider.py app/domains/model_provider/service/provider_service.py tests/test_provider_model.py

@fengju0213 fengju0213 changed the title [codex] Fix provider configuration state chore: Fix provider configuration state Jun 8, 2026
@fengju0213 fengju0213 marked this pull request as ready for review June 8, 2026 08:17
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.

BYOK provider stays unconfigured after successful validation

1 participant