Bug Report: ZCode UI "Delete Provider" Operation Causes Model Selection Failure
Title: ZCode UI "Delete Provider" is incomplete — provider definitions remain in v2/config.json after deletion, causing model selection to fail
- Type: Bug
- Priority: P2
- Status: Needs triage
Environment
- OS: Windows 10 (win32 10.0.26200 x64)
- ZCode Version: Not confirmed (desktop app)
- Model channel: Mixed (Infron/motif-3, Agnes, kilo, NVIDIA, AMD, etc.)
- Workspace: C:\Users\木\Desktop\talk
Problem
When using the ZCode desktop UI to delete providers (leaving only Infron/motif-3), the operation only updates v2/provider_config.json (the providerOrder array) but does NOT remove the corresponding provider definitions from v2/config.json. This causes an internal state inconsistency where:
v2/provider_config.json says "only Infron is active"
v2/config.json still contains all 12 provider definitions (Agnes, NVIDIA, kilo, VyceAI, OpenCode, AMD, plus 6 built-in)
- The zcode-provider extension merges these into the app-server settings file (
cli/config.json)
- When a user tries to re-select a "deleted" provider, the UI allows it (because the definition still exists in
v2/config.json), but the selection fails because the provider is absent from providerOrder
Steps to Reproduce
- Open ZCode desktop application
- Go to Settings → Model Management
- Select and delete all providers except Infron (motif/motif-3)
- Attempt to re-select one of the "deleted" providers (e.g., Agnes, kilo, NVIDIA)
- Observe that the model selection does not take effect
Expected vs Actual Behavior
- Expected: After deleting a provider, it should not appear in the model selector, and attempting to re-select it should either work correctly or be clearly unavailable
- Actual: The provider can still be selected (because its definition persists in
v2/config.json), but the selection fails silently. Switching between any providers produces the same failure
Root Cause Analysis
- Incomplete deletion: UI "delete provider" only modifies
v2/provider_config.json (providerOrder) but does not clean up v2/config.json
- State inconsistency: Two files that should always agree now disagree — one has order-only info, the other has full provider definitions
- Merge behavior: The zcode-provider extension merges enabled providers from v2/config.json into cli/config.json (app-server settings), but does not account for providerOrder when determining which providers are "active"
Logs (for reference)
- Log file:
C:\Users\木\.zcode\cli\log\zcode-2026-09-17.jsonl
- Key errors observed:
v4 createSession config apply failed: provider "601113d1" is not in the workspace model registry
session.model_selection.persist_failed: FOREIGN KEY constraint failed
- Multiple
model.sdk.stream.failed events (network/TLS disconnections)
Suggested Fix
- UI level: When the user deletes a provider, also remove the corresponding entry from
v2/config.json (or mark it with enabled: false)
- Extension level: The zcode-provider merge logic should consider
providerOrder when determining which providers to merge — if a provider is not in providerOrder, it should not be considered "active"
- Consistency check: Add a validation that
providerOrder keys are a subset of v2/config.json provider keys
Additional Notes
This issue appears to be part of a larger problem with the current configuration state:
- 4 ghost sessions exist in the database with no corresponding session rows (causing FOREIGN KEY constraint failures)
- Clash Verge proxy is causing TLS disconnections for some providers
- Self-hosted Qwen3.8 does not accept
reasoning effort: high (only xhigh/medium/low)
These may be separate issues but contribute to the overall "model selection fails" symptom.
Logs & Attachments
- Log archive:
C:\Users\木\.zcode\cli\log\zcode-2026-09-17.jsonl (available on request)
- Configuration files:
v2/config.json, v2/provider_config.json, cli/config.json
Bug Report: ZCode UI "Delete Provider" Operation Causes Model Selection Failure
Title: ZCode UI "Delete Provider" is incomplete — provider definitions remain in v2/config.json after deletion, causing model selection to fail
Environment
Problem
When using the ZCode desktop UI to delete providers (leaving only Infron/motif-3), the operation only updates
v2/provider_config.json(theproviderOrderarray) but does NOT remove the corresponding provider definitions fromv2/config.json. This causes an internal state inconsistency where:v2/provider_config.jsonsays "only Infron is active"v2/config.jsonstill contains all 12 provider definitions (Agnes, NVIDIA, kilo, VyceAI, OpenCode, AMD, plus 6 built-in)cli/config.json)v2/config.json), but the selection fails because the provider is absent fromproviderOrderSteps to Reproduce
Expected vs Actual Behavior
v2/config.json), but the selection fails silently. Switching between any providers produces the same failureRoot Cause Analysis
v2/provider_config.json(providerOrder) but does not clean upv2/config.jsonLogs (for reference)
C:\Users\木\.zcode\cli\log\zcode-2026-09-17.jsonlv4 createSession config apply failed: provider "601113d1" is not in the workspace model registrysession.model_selection.persist_failed: FOREIGN KEY constraint failedmodel.sdk.stream.failedevents (network/TLS disconnections)Suggested Fix
v2/config.json(or mark it withenabled: false)providerOrderwhen determining which providers to merge — if a provider is not inproviderOrder, it should not be considered "active"providerOrderkeys are a subset ofv2/config.jsonprovider keysAdditional Notes
This issue appears to be part of a larger problem with the current configuration state:
reasoning effort: high(only xhigh/medium/low)These may be separate issues but contribute to the overall "model selection fails" symptom.
Logs & Attachments
C:\Users\木\.zcode\cli\log\zcode-2026-09-17.jsonl(available on request)v2/config.json,v2/provider_config.json,cli/config.json