Skip to content

Silent modelOverride leak via Mod API (cmd.setModel) causes UI desync and unintended high-tier billing #678

Description

@Fletu94

Summary

  • Environment: CLI (v1.26.0)
  • OS: macOS

When an extension uses the Mod API cmd.setModel() to switch models during an automated workflow, the in-memory modelOverride persists across subsequent interactive user turns without resetting to the default session model.

At the same time, the terminal status bar continues to display the default model from config.json (deepseek/deepseek-v4-flash), while all HTTP requests dispatched to the server are actually routed to the overridden higher-cost model (GLM-5.3). Because the UI gives no indication of this change, it silently burns through subscription credits on routine queries.

Expected Behavior

  1. The terminal UI should always dynamically reflect the actual active model being dispatched over the network.
  2. Model overrides initiated by cmd.setModel() in mods should either update the UI state visibly or be cleanly scoped/reset when external mod turns conclude.

Actual Behavior

  1. An extension calls cmd.setModel("zai-org/GLM-5.3") for a temporary turn.
  2. After the extension finishes, the user returns to normal interactive prompting.
  3. The terminal UI / status bar still displays DeepSeek V4 Flash (reading from config.json).
  4. In reality, all subsequent interactive user requests are dispatched to GLM-5.3 on the backend, rapidly draining subscription credits without any visual warning.

Steps to reproduce the issue

  1. Set "model": "deepseek/deepseek-v4-flash" in ~/.commandcode/config.json.
  2. Start Command Code CLI (v1.26.0) on macOS and confirm the status bar displays "DeepSeek V4 Flash".
  3. An extension/mod calls the Mod API cmd.setModel("zai-org/GLM-5.3") during a turn.
  4. The extension workflow finishes and returns control to the user.
  5. Enter a standard interactive prompt in the terminal.
  6. Observe:
    • The terminal UI continues to display "DeepSeek V4 Flash".
    • The actual backend request is dispatched to "zai-org/GLM-5.3" and billed at the higher rate on the server.

Command Code Version

1.26.0

Operating System

macOS

Terminal/IDE

ghostty

Shell

zsh

Session file (optional)

ce24cd7ba5fe9e66bcd56faea840a162
Session ID: ee585ef6-c16f-4960-8e1a-1e5a6e341990
Timeframe: 2026-08-15 between 00:00:56 UTC and 00:48:22 UTC
Impacted turns: 65 consecutive requests routed to zai-org/GLM-5.3
Total volume: ~17.1M input tokens / 49.8k output tokens

Fix prompt (optional)

No response

Additional context

OS: macOS Tahoe 26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions