Skip to content

Try to use the model specified in --model even with OpenAI#25

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-552-fix-use_model_openai
Open

Try to use the model specified in --model even with OpenAI#25
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-552-fix-use_model_openai

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

TLDR

When specifying an openai-base-url and an openai-api-key via CLI args, the CLI silently falls back to the default model, regardless of what model is specified using --model. This is fixed here, by using --model.

Dive Deeper

Appearently, it is possible to specify all OpenAI API parameters using Environment variables, but this is undocumented. --help shows that --openai-api-key and --openai-base-url are supported as CLI parameters. Thus it would seem natural that the model is specified via --model. It turns out that it is entirely impossible to specify the model used when specifying openai-api-key etc and instead the code tries to infer the model from environment variables (OPENAI_MODEL) or falls back to the default model.

Another way to fix this would be to not provide a path through the CLI arguments to control OpenAI API usage but only through environment variables, and to adequately document this option.

Reviewer Test Plan

Check that the following command works after the change

qwen --openai-api-key <openrouter key> --openai-base-url https://openrouter.ai/api/v1  --openai-model qwen/qwen3-coder-30b-a3b-instruct --openai-logging true -p "Write a hello world python program"

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@BingqingLyu

BingqingLyu commented May 7, 2026

Copy link
Copy Markdown
Owner Author

Conflict Group 1

This PR shares modified functions with 2 other PR(s): #10, #30.

These PRs should be reviewed as a batch — merging one may affect the others.

Function File Also modified by
getSeedSource contentGenerator.ts #30
setSource contentGenerator.ts #10, #30
graph LR
    PR25["PR #25"]
    FgetSeedSource_5386["getSeedSource<br>contentGenerator.ts"]
    PR25 -->|modifies| FgetSeedSource_5386
    PR30["PR #30"]
    PR30 -->|modifies| FgetSeedSource_5386
    FsetSource_5386["setSource<br>contentGenerator.ts"]
    PR25 -->|modifies| FsetSource_5386
    PR10["PR #10"]
    PR10 -->|modifies| FsetSource_5386
    PR30 -->|modifies| FsetSource_5386
Loading

Posted by codegraph-ai conflict detection.

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

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants