Skip to content

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

Description

@1234fsdc

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions