Skip to content

feat(model-declaration): support per-field help on model provider credentials#774

Open
dparkmit24 wants to merge 1 commit into
langgenius:mainfrom
dparkmit24:model-provider-credential-help-field
Open

feat(model-declaration): support per-field help on model provider credentials#774
dparkmit24 wants to merge 1 commit into
langgenius:mainfrom
dparkmit24:model-provider-credential-help-field

Conversation

@dparkmit24

Copy link
Copy Markdown

Description

Model-provider credential form fields don't carry per-field help, so a plugin manifest's help on such a field is silently dropped during unmarshal and never reaches the provider declaration returned by the management API. Tool credential fields already model this — ProviderConfig (pkg/entities/plugin_entities/config.go) has Help and URL — which is why tool credential help renders in the Dify UI while model-provider credential help does not.

This brings model-provider credentials to parity by adding Help (and URL, matching ProviderConfig) to ModelProviderCredentialFormSchema (pkg/entities/plugin_entities/model_declaration.go). The type Alias unmarshalers handle the new fields automatically. The change is additive and optional — no behavior change for existing plugins.

For example, models/bedrock sets help on bedrock_endpoint_url / bedrock_proxy_url and models/openai on api_protocol; today those never reach the client. (Full trace: manifest → daemon struct → management-API JSON confirms the field is dropped at this struct.)

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

This is the first of three coordinated changes needed for a plugin's per-field help to reach the model-provider credential form in the Dify UI: (1) this daemon change so the declaration carries help; (2) the graphon CredentialFormSchema needs the field (it currently drops unknown keys via pydantic extra="ignore"); (3) the Dify frontend needs to map helptooltip for model-provider credentials (tools/agents already do). Flagging so it's clear this is intentionally scoped to the daemon and is safe/inert on its own.

Note: URL is included for exact parity with ProviderConfig; happy to drop it to Help-only if you'd prefer the minimal change. Similarly, json omitempty was left off help to match ProviderConfig — glad to add it on both if you'd rather.

Drafted with AI assistance (Claude) and reviewed by me before submitting.

…dentials

Model-provider credential form fields (ModelProviderCredentialFormSchema)
did not model a per-field help, so a plugin manifest's help on such a
field was silently dropped during unmarshal and never reached the
management-API declaration. Tool credential fields (ProviderConfig)
already carry Help and URL, so tool credential help renders while model
provider help does not.

Add Help and URL to ModelProviderCredentialFormSchema, matching the
ProviderConfig fields, to bring model-provider credentials to parity.
Additive and optional; no behavior change for existing plugins. Add a
round-trip test asserting help survives unmarshal and marshal.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request go Pull requests that update go code plugin-daemon labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code plugin-daemon size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant