Configuring Bailian Token Plan via custom provider silently breaks: schema rejection, missing developer compat, and unintuitive models replacement semantics
#3495
Replies: 2 comments
|
I checked this across the tagged rc.7 and rc.8 sources. There is an important release boundary that changes the safest answer. For rc.7, llm-pi-ai:
providers:
qwen-token-plan-cn:
displayName: Bailian Token Plan CN
apiKeyEnv: AIBABA_API_KEYOmitting rc.8 expands the configurable compat schema and does include I published a version-aware runbook with the exact failure classification, minimal route, replacement/override rules, custom-model workflow, rollback, and acceptance gates: That distinction should keep rc.7 users from applying an rc.8-compatible field and then chasing the downstream registration/auth symptom. |
|
这帖的主要配置缺口在 rc.8/rc.2 已变化:当前 schema 已支持更多 compat 字段。另需注意 |
Uh oh!
There was an error while loading. Please reload this page.
Environment
https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1(Bailian Token Plan CN)Summary
When a user manually configures the Bailian Token Plan endpoint as a custom provider (instead of using the built-in
qwen-token-plan-cncatalog route), they encounter three cascading failures that are extremely difficult to diagnose:developerrole 400 error from the Bailian APIcompat.supportsDeveloperRole: falseat the route levelAll three stem from configuration-layer UX issues in
dsh-llm-pi-ai, not from the Bailian API itself. The built-inqwen-token-plan-cncatalog route handles all of these correctly, but there is no GUI guidance to use it.Detailed Reproduction
Step 1: User adds Bailian as a custom provider
This is the natural first approach — the GUI offers "Add Custom Provider" but does not surface the built-in
qwen-token-plan-cncatalog route:Result: No reasoning effort selector appears for any model. The models work for basic chat, but reasoning capability is invisible.
Root cause: Hand-declared models have no reasoning metadata. The settings-models UI deliberately does not expose
reasoningEffortsediting (source comment: "There is deliberately no reasoning-effort control, here or on the editor"). WithoutreasoningEfforts,resolveModelReasoningreturns{reasoning: false}→reasoningInfo()returns{}→ UI hides the selector.Step 2: User encounters
developerrole 400 errorAfter extended multi-turn usage, requests fail with:
Root cause:
detectCompat()inopenai-completions.jsdefaultssupportsDeveloperRole: truefor the Bailian URL (it's not in theisNonStandardlist). The built-in catalog explicitly setssupportsDeveloperRole: falsefor every Bailian model, but hand-declared routes lose this metadata. Whenmodel.reasoning && compat.supportsDeveloperRoleevaluates to true, DSH sendsrole: "developer"which Bailian rejects.Step 3: User tries to fix it and makes things worse
Attempting to add
compat.supportsDeveloperRole: falseat the route level:Result: The entire
llm-pi-aiprovider section fails schema validation silently. The route is never registered. Subsequent requests fail with "API key is invalid" or "no adapter registered for provider qwen-token-plan-cn" — neither of which points to the actual cause (schema rejection).Root cause:
compatProfileonly acceptsthinkingFormatandsupportsReasoningEffort. Writing any other field causesassertServiceable→resolveProfilesto throw. TheonChangehandler catches this and logs "keeping the previously registered routes after a refused update", but the user sees only the downstream symptom ("API key is invalid"), not the validation failure.What Works (But Is Undiscoverable)
The built-in
qwen-token-plan-cncatalog route handles everything correctly with just:No
api,baseURL,models, orcompatneeded. All ~15 text models inherit correct reasoning metadata,supportsDeveloperRole: false, and DeepSeek'srequiresReasoningContentOnAssistantMessages: true.But there is no way for a user to discover this without reading source code.
Structural Limitation:
modelsReplacement SemanticsWriting a
modelslist on a catalog route completely replaces the built-in catalog (line 1139 ofdsh-llm-pi-ai/lib/index.js):This means users cannot supplement the built-in catalog with additional models (e.g., image/audio models not in the catalog). They must choose between:
There is no merge mode.
Suggested Improvements
1. Surface built-in catalog providers in the GUI
Add a "Use Built-in Provider" option in the Models settings page that lists available catalog routes (
qwen-token-plan-cn,deepseek, etc.) alongside the manual "Add Custom Provider" flow. This would prevent users from ever needing to hand-configure endpoints that already have full catalog support.2. Provide explicit errors on schema validation failure
When
assertServiceable/resolveProfilesthrows duringonChange, the error should be surfaced to the user (toast notification, settings page banner, or at minimum a prominent log entry) rather than silently falling back to previous routes. The current behavior — logging "keeping the previously registered routes after a refused update" to the error log while the user sees an unrelated "API key is invalid" — makes diagnosis nearly impossible.Specifically, when
compatProfilerejects an unknown field likesupportsDeveloperRole, the error message should name the invalid field and suggest valid alternatives.3. Consider a
modelsmerge mode for catalog routesAllow catalog routes to declare additional models without replacing the entire catalog. For example:
Or alternatively, allow per-model compat overrides on catalog routes so users can fix individual fields without losing the rest of the catalog metadata.
4. Document the
compatProfileschema boundaryThe fact that only
thinkingFormatandsupportsReasoningEffortare user-configurable compat fields is not documented anywhere visible to users. The other dozen+ compat fields (supportsDeveloperRole,requiresReasoningContentOnAssistantMessages,supportsStore, etc.) are internal-only but look like reasonable configuration options. A docs page or inline schema description listing allowed fields would prevent silent misconfiguration.Impact
These issues affect any user who configures a provider endpoint that happens to have built-in catalog support but doesn't know to use the catalog route name. The Bailian Token Plan case is particularly painful because:
developerrole error only manifests after multi-turn usage (not on first request)supportsDeveloperRole) triggers a completely different failure modeI've written a detailed troubleshooting guide based on my debugging experience that I'd be happy to contribute as documentation if helpful.
All reactions