Qwen Code
Qwen Code is a command-line AI coding assistant released by Alibaba Cloud, developed on the Gemini CLI architecture and integrated with the Qwen series of large language models. Targeting developers, it supports programming assistance tasks including code generation, completion, debugging, and codebase comprehension. It features large context window handling and enables interactive dialogue with codebases directly from a terminal environment.
Core Facts
Timeline (last 90 days)
Setting maxRetries to 0 in generationConfig removes SDK-layer retries, so an endpoint that keeps returning 503 receives only 7 requests (about 74 seconds) before ending with [API Error: 503 upstream busy] and exit code 1.
Running qwen -p "Say hi" non-interactively sends two requests: the first is the answer request (the system prompt is about 30,553 characters, plus a skills and memory paths block of about 10,963 characters and six tool definitions); the second is the managed memory extraction subagent request, used to update the memory files under ~/.qwen/.
Managed auto memory can be turned off by setting "memory": {"enableManagedAutoMemory": false, "enableManagedAutoDream": false} in the configuration, after which qwen -p "Say hi" sends only one request.
When the server keeps returning 503, Qwen Code's default retry behavior is: the OpenAI SDK retries three times per attempt (backoff of about 0.4, 0.9, and 1.8 seconds), and Qwen Code's own retry loop repeats these groups at intervals of about 2, 3, 7, 14, 30, and 30 seconds, so seven groups totaling 28 requests take about 107 seconds, after which the CLI prints Retrying in 60s (attempt 1/10) and starts a new round.
Qwen Code is a terminal coding agent launched by the Tongyi team, originally forked from Gemini CLI and switched to the OpenAI Chat Completions protocol.
Using the three environment variables OPENAI_API_KEY, OPENAI_BASE_URL and OPENAI_MODEL, Qwen Code can be configured to connect to a custom OpenAI-compatible API without a configuration file.
Qwen Code uses the official OpenAI Node SDK and appends /chat/completions after OPENAI_BASE_URL, so the base URL must retain the /v1 path, otherwise most gateways return 404.
When Qwen Code is configured via environment variables, each request carries max_tokens: 32000 by default.
When the API key is wrong, Qwen Code sends only one request, reports [API Error: 401 Invalid API key], and exits with code 1 without retrying.
For daily use, Qwen Code recommends configuring modelProviders in ~/.qwen/settings.json, with key fields including id, name, envKey, baseUrl, and a nested generationConfig (containing timeout, maxRetries, contextWindowSize and samplingParams).
7 more timeline events
All Facts (18)
Qwen Code is a fork of Gemini CLI that replaces the underlying model with Alibaba Cloud's Qwen series.
65%UnverifiedSetting maxRetries to 0 in generationConfig removes SDK-layer retries, so an endpoint that keeps returning 503 receives only 7 requests (about 74 seconds) before ending with [API Error: 503 upstream busy] and exit code 1.
50%UnverifiedRunning qwen -p "Say hi" non-interactively sends two requests: the first is the answer request (the system prompt is about 30,553 characters, plus a skills and memory paths block of about 10,963 characters and six tool definitions); the second is the managed memory extraction subagent request, used to update the memory files under ~/.qwen/.
50%UnverifiedManaged auto memory can be turned off by setting "memory": {"enableManagedAutoMemory": false, "enableManagedAutoDream": false} in the configuration, after which qwen -p "Say hi" sends only one request.
50%UnverifiedWhen the server keeps returning 503, Qwen Code's default retry behavior is: the OpenAI SDK retries three times per attempt (backoff of about 0.4, 0.9, and 1.8 seconds), and Qwen Code's own retry loop repeats these groups at intervals of about 2, 3, 7, 14, 30, and 30 seconds, so seven groups totaling 28 requests take about 107 seconds, after which the CLI prints Retrying in 60s (attempt 1/10) and starts a new round.
50%UnverifiedQwen Code is a terminal coding agent launched by the Tongyi team, originally forked from Gemini CLI and switched to the OpenAI Chat Completions protocol.
50%UnverifiedUsing the three environment variables OPENAI_API_KEY, OPENAI_BASE_URL and OPENAI_MODEL, Qwen Code can be configured to connect to a custom OpenAI-compatible API without a configuration file.
50%UnverifiedQwen Code uses the official OpenAI Node SDK and appends /chat/completions after OPENAI_BASE_URL, so the base URL must retain the /v1 path, otherwise most gateways return 404.
50%UnverifiedWhen Qwen Code is configured via environment variables, each request carries max_tokens: 32000 by default.
50%UnverifiedWhen the API key is wrong, Qwen Code sends only one request, reports [API Error: 401 Invalid API key], and exits with code 1 without retrying.
50%UnverifiedFor daily use, Qwen Code recommends configuring modelProviders in ~/.qwen/settings.json, with key fields including id, name, envKey, baseUrl, and a nested generationConfig (containing timeout, maxRetries, contextWindowSize and samplingParams).
50%UnverifiedKeys under modelProviders must be real protocol names (openai, anthropic, gemini, vertex-ai); self-invented keys are skipped with a warning unless mapped in a top-level providerProtocol block.
50%UnverifiedThe key pointed to by envKey can be placed in a .env file in the project directory or in ~/.qwen/.env; if neither exists, Qwen Code stops before sending the request and indicates that the API key is missing.
50%UnverifiedAfter configuring modelProviders, the request body becomes temperature: 0.2 and max_tokens: 4096, and the default value of 32000 disappears.
50%UnverifiedIn Qwen Code, when a modelProviders entry is selected, its generationConfig replaces the top-level configuration of the same name wholesale, and samplingParams, customHeaders, and extra_body are all replaced as whole objects rather than merged.
50%UnverifiedRuntimes supported by SpaceApp include OpenCode, Codex, Gemini, Qwen Code, Kimi Code, Grok Build, and an experimental DeepSeek CLI; Claude Code has a separate, owner-initiated installation process.
50%UnverifiedGitSpawn affects seven coding agents, including Claude Code, OpenAI Codex, Cursor, Grok Build, Goose, Hermes Agent, and Qwen Code, with eight findings reported in total.
50%UnverifiedQwen Code 分支项目允许在 settings 中设置 tools.approvalMode 为 yolo,依赖文件夹信任机制提供保护,与 Gemini CLI 的保守路线不同。
50%