What happened?
In Qwen Code v0.15.3, when NO_COLOR=1 is set and the interactive CLI is launched in a sufficiently wide terminal, the app crashes while rendering the welcome Header.
Reproduction command:
NO_COLOR=1 qwen --sandbox=false --approval-mode=default
Reproduction conditions:
NO_COLOR=1
- An interactive terminal
- A terminal width large enough to show the ASCII logo, for example 180 columns
Additional observation:
In a narrower terminal, for example 80 columns, the Header does not render the ASCII logo, so this crash path is not triggered.
Actual output
The following output was captured from a tmux session using a 180x40 terminal:
ERROR Invalid number of stops (< 2)
file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:426308:17
- TinyGradient (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:426308:17)
- module2.exports (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:426480:14)
- InitGradient (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:426494:33)
- Gradient (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:507970:51)
- react-stack-bottom-frame (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:323023:20)
- renderWithHooks (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:313859:24)
- updateFunctionComponent (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:316308:21)
- beginWork (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:317293:20)
- runWithFiberInDEV (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:312695:72)
- performUnitOfWork (file:///Users/yiliang/.qwen-code-0.15.3-global/lib/node_modules/@qwen-code/qwen-code/cli.js:320780:82)
Screenshot
A screenshot of the same tmux error can be added here if needed.
What did you expect to happen?
When NO_COLOR=1 is set, the CLI should disable color/gradient output while still starting normally and rendering a plain-text interface.
If the active theme does not provide valid gradient colors, components should fall back to plain <Text> rendering instead of passing an empty array to ink-gradient.
Anything else we need to know?
Initial code investigation:
NoColorTheme sets ui.gradient to [].
Header uses theme.ui.gradient || fallback.
- Empty arrays are truthy in JavaScript, so the fallback is not used.
- As a result,
<Gradient colors={[]}> reaches ink-gradient / gradient-string and throws Invalid number of stops (< 2).
Relevant code paths:
packages/cli/src/ui/themes/no-color.ts
packages/cli/src/ui/components/Header.tsx
packages/cli/src/ui/components/StatsDisplay.tsx has a similar gradient length check and should also be reviewed for length >= 2.
Client information
Client Information
Qwen Code v0.15.3
Model: nvidia/nemotron-3-super-120b-a12b:free
Fast Model: coder-model
Auth: openai
Platform: darwin x64 (24.6.0)
Node.js: v22.20.0
Session: 6e1fb393-6500-43ed-84fb-2118321cb96f
Git commit: dad983203
What happened?
In Qwen Code v0.15.3, when
NO_COLOR=1is set and the interactive CLI is launched in a sufficiently wide terminal, the app crashes while rendering the welcome Header.Reproduction command:
Reproduction conditions:
NO_COLOR=1Additional observation:
In a narrower terminal, for example 80 columns, the Header does not render the ASCII logo, so this crash path is not triggered.
Actual output
The following output was captured from a
tmuxsession using a 180x40 terminal:Screenshot
A screenshot of the same
tmuxerror can be added here if needed.What did you expect to happen?
When
NO_COLOR=1is set, the CLI should disable color/gradient output while still starting normally and rendering a plain-text interface.If the active theme does not provide valid gradient colors, components should fall back to plain
<Text>rendering instead of passing an empty array toink-gradient.Anything else we need to know?
Initial code investigation:
NoColorThemesetsui.gradientto[].Headerusestheme.ui.gradient || fallback.<Gradient colors={[]}>reachesink-gradient/gradient-stringand throwsInvalid number of stops (< 2).Relevant code paths:
packages/cli/src/ui/themes/no-color.tspackages/cli/src/ui/components/Header.tsxpackages/cli/src/ui/components/StatsDisplay.tsxhas a similar gradient length check and should also be reviewed forlength >= 2.Client information
Client Information