1jehuang / 1jehuang/jcode

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

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

Nobody has claimed this yet.

bug needs-info triage: unclear
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

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

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

Start with the CLI handling for the --provider and --model flags in the TUI and run entry points, then trace how Forest server auto-detection selects a provider after those flags are parsed. Reproduce with the commands in the issue and compare against /model zai:glm-5-turbo. Done means both launch modes use the requested Z.AI provider and glm-5-turbo instead of the auto-detected model.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.