Skip to content

CLI flags --provider and --model are silently ignored by the server #809

Description

@1am2syman

Bug

--provider and --model CLI flags are silently ignored when launching jcode (TUI) and jcode run. The server-side auto-detection overrides whatever the client requests, so the flags have no effect.

Expected behavior

jcode --provider zai --model glm-5-turbo

Should start a session on Z.AI / glm-5-turbo.

Actual behavior

The session starts on whatever provider the server auto-detects (e.g., Command Code / Claude Opus 5), completely ignoring --provider zai --model glm-5-turbo.

The TUI footer shows:

api-key:command code · Claude 5 Opus

instead of the requested Z.AI / glm-5-turbo.

Workaround

Use the /model slash command inside the TUI after launch:

/model zai:glm-5-turbo

This works correctly and switches to the requested provider/model.

Reproduction

# TUI mode — flags are ignored, defaults to auto-detected provider
jcode --provider zai --model glm-5-turbo

# run mode — same issue, picks a random provider instead
jcode run --provider zai --model glm-5-turbo "hello"
# → responds as "Claude Sonnet 4 via Anthropic API" instead of glm-5-turbo

# Both tested with multiple provider/model combos — always ignored

Environment

  • jcode version: v0.64.3-dev (d6c7c36, dirty)
  • Server: Forest v0.64.3-dev
  • OS: Linux (x86_64)
  • Providers configured: OpenAI (oauth), Gemini (oauth), Z.AI (api key), Command Code (api key), DeepSeek (api key)
  • Auto-detected default: Command Code

Notes

  • --provider zai is listed as a valid value in --provider's possible values
  • glm-5-turbo is listed by jcode model list --provider zai
  • The flags are accepted without error — they just have no effect
  • The issue appears to be that the Forest server's provider auto-detection runs after client flags are parsed and overrides them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions