zai-org / zai-org/feedback

ZCode UI 'Delete Provider' operation is incomplete — provider definitions remain in v2/config.json after deletion, causing model selection to fail

Open
#692 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
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.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

  1. Open ZCode desktop application
  2. Go to Settings → Model Management
  3. Select and delete all providers except Infron (motif/motif-3)
  4. Attempt to re-select one of the "deleted" providers (e.g., Agnes, kilo, NVIDIA)
  5. 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

  1. Incomplete deletion: UI "delete provider" only modifies v2/provider_config.json (providerOrder) but does not clean up v2/config.json
  2. State inconsistency: Two files that should always agree now disagree — one has order-only info, the other has full provider definitions
  3. 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

  1. UI level: When the user deletes a provider, also remove the corresponding entry from v2/config.json (or mark it with enabled: false)
  2. 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"
  3. 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.