CLI flags --provider and --model are silently ignored by the server
Nobody has claimed this yet.
- 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 zaiis listed as a valid value in--provider's possible valuesglm-5-turbois listed byjcode 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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