Skip to content

fix: correct PUT /api/v1/provider silently dropping model_type, endpoint_url, encrypted_config (#1627)#1673

Open
carlosjarenom wants to merge 2 commits into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1627-provider-update-fields
Open

fix: correct PUT /api/v1/provider silently dropping model_type, endpoint_url, encrypted_config (#1627)#1673
carlosjarenom wants to merge 2 commits into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1627-provider-update-fields

Conversation

@carlosjarenom

Copy link
Copy Markdown

Problem

ProviderService.update() uses a field whitelist that doesn't match the actual Provider ORM model fields:

Whitelist entry Actual model field Result
api_base doesn't exist (real: endpoint_url) dead code
extra_config doesn't exist (real: encrypted_config) dead code
(missing) model_type silently rejected
(missing) endpoint_url silently rejected
(missing) encrypted_config silently rejected

PUT /api/v1/provider/{id} returns 200 OK but silently drops updates to model_type, endpoint_url, and encrypted_config.

Fix

Replace the incorrect whitelist entries with the actual Provider field names:

# Before
_UPDATABLE_FIELDS = {"provider_name", "api_key", "api_base", "extra_config", "prefer", "is_vaild"}

# After
_UPDATABLE_FIELDS = {"provider_name", "model_type", "api_key", "endpoint_url", "encrypted_config", "prefer", "is_vaild"}
  • api_baseendpoint_url
  • extra_configencrypted_config
  • Added model_type (was missing)

Note: is_vaild typo is project-wide and kept as-is (out of scope).

Reproduction

  1. Settings → Agent → Models → BYOK → create provider with claude-opus-4-6
  2. Edit same provider, change model_type to gpt-4o, click Save → success toast
  3. Run task → still uses Claude (DB unchanged)

Closes #1627

…ver READMEs (eigent-ai#1579)

The READMEs recommended Python 3.10, but pyproject.toml and Dockerfile
require Python 3.12. This caused confusion for users trying to set
up the server locally.

Closes eigent-ai#1579
…int_url, encrypted_config (eigent-ai#1627)

The _UPDATABLE_FIELDS whitelist used obsolete field names (api_base,
extra_config) that no longer exist in the ModelProvider model. When
updating a provider via PUT, the actual fields model_type,
endpoint_url and encrypted_config were silently ignored.

Updated the whitelist to use the correct field names matching the
ModelProvider model definition.

Closes eigent-ai#1627
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.

[BUG] PUT /api/v1/provider silently drops model_type, endpoint_url, encrypted_config

1 participant