ZCode UI 'Delete Provider' operation is incomplete — provider definitions remain in v2/config.json after deletion, causing model selection to fail
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
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.jsonsays "only Infron is active"v2/config.jsonstill 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 fromproviderOrder
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 upv2/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 registrysession.model_selection.persist_failed: FOREIGN KEY constraint failed- Multiple
model.sdk.stream.failedevents (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 withenabled: false) - Extension level: The zcode-provider merge logic should consider
providerOrderwhen determining which providers to merge — if a provider is not inproviderOrder, it should not be considered "active" - Consistency check: Add a validation that
providerOrderkeys are a subset ofv2/config.jsonprovider 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the delete-provider flow from the desktop UI through v2/provider_config.json, v2/config.json, and the zcode-provider merge into cli/config.json. Confirm how providerOrder and provider definitions are read, then add coverage for deleting a provider and attempting to select it. Done means deleted providers are unavailable and the configuration files remain consistent.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100