Skip to content

Commit ecfef1d

Browse files
author
jinye.djy
committed
docs: add PR3212 CLI reproduction and verification evidence
1 parent 5c97b8e commit ecfef1d

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
127 KB
Loading
273 KB
Loading

docs/users/support/troubleshooting.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,74 @@ The Qwen Code uses specific exit codes to indicate the reason for termination. T
121121
## Existing GitHub Issues similar to yours or creating new Issues
122122

123123
If you encounter an issue that was not covered here in this _Troubleshooting guide_, consider searching the Qwen Code [Issue tracker on GitHub](https://github.com/QwenLM/qwen-code/issues). If you can't find an issue similar to yours, consider creating a new GitHub Issue with a detailed description. Pull requests are also welcome!
124+
125+
## PR #3212: Gemini `baseUrl` fix verification (CLI reproduction)
126+
127+
This section documents a full CLI-level reproduction and validation for [PR #3212](https://github.com/QwenLM/qwen-code/pull/3212), which fixes Gemini `baseUrl` forwarding via `httpOptions`.
128+
129+
### What was broken
130+
131+
- Old behavior (`dddb56d88`): even when `modelProviders.gemini[].baseUrl` was configured, requests still went to Google's default endpoint (`generativelanguage.googleapis.com`).
132+
- New behavior (`5c97b8e8c`): the configured `baseUrl` is forwarded and used for Gemini requests.
133+
134+
### Reproduction environment
135+
136+
- Old version commit: `dddb56d8859274fd86a304e9b13b8b7d61009dd7`
137+
- New version commit: `5c97b8e8c21451df2d13ae274afd51deed008f9e`
138+
- Common settings (`~/.qwen/settings.json`):
139+
140+
```json
141+
{
142+
"security": { "auth": { "selectedType": "gemini" } },
143+
"model": { "name": "gemini-2.0-flash" },
144+
"env": { "GEMINI_API_KEY": "INVALID_KEY_FOR_REPRO" },
145+
"modelProviders": {
146+
"gemini": [
147+
{
148+
"id": "gemini-2.0-flash",
149+
"envKey": "GEMINI_API_KEY",
150+
"baseUrl": "http://127.0.0.1:8787"
151+
}
152+
]
153+
},
154+
"$version": 3
155+
}
156+
```
157+
158+
### CLI command used
159+
160+
```bash
161+
DEBUG=1 npm start -- --yolo -p "ping" --output-format text
162+
```
163+
164+
### Mock server used for verification
165+
166+
- Local mock Gemini server: `127.0.0.1:8787`
167+
- For stream endpoint, the server returns SSE payload (`data: {...}\n\n`) for:
168+
- `POST /v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse`
169+
170+
### Result A: old version reproduces failure
171+
172+
- CLI output includes:
173+
- `API key not valid. Please pass a valid API key.`
174+
- `generativelanguage.googleapis.com`
175+
- Mock server log shows no incoming request, proving old version did not use configured `baseUrl`.
176+
177+
![PR3212 old version CLI error reproduction](./images/pr-3212/old-cli-error.png)
178+
179+
### Result B: new version verifies fix
180+
181+
- CLI output returns mocked text:
182+
- `MOCK_OK_FROM_CUSTOM_BASEURL`
183+
- Mock server log captures:
184+
- `POST /v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse`
185+
- This confirms new version sends Gemini traffic to configured `baseUrl`.
186+
187+
![PR3212 new version CLI success verification](./images/pr-3212/new-cli-success.png)
188+
189+
### Conclusion
190+
191+
PR #3212 is validated at CLI runtime level:
192+
193+
- old commit reproduces the bug
194+
- new commit resolves it

0 commit comments

Comments
 (0)