Skip to content

Bug: /context command missing 'detail' subcommand in autocomplete dropdown #3040

@YuchenLiang00

Description

@YuchenLiang00

What happened?

When typing /context (with a trailing space) in the input field, the command autocomplete dropdown does not show the detail subcommand. Other commands like /stats correctly display their subcommands (model, tools) as suggestions when a trailing space is entered, but /context shows no suggestions.

Image Image

What did you expect to happen?

Typing /context should display a dropdown with detail as a suggestion, along with its description (e.g., "Show per-item context usage breakdown."), similar to how /stats shows model and tools.

Image

Client information

Client Information

Run qwen to enter the interactive CLI, then run the /about command.

$ qwen /about

  │ Status                                                                   

  │ Qwen Code                0.14.1 (c7cfd4c1d)                              
  │ Runtime                  Node.js v22.18.0 / npm 11.8.0                   
  │ OS                       darwin arm64 (25.3.0)                           

  │ Auth                     Qwen OAuth                                      
  │ Model                    coder-model                                     
  │ Fast Model               coder-model                                     
  │ Session ID               f8ecc13e-c697-4645-a790-b0f38f6f262e            
  │ Sandbox                  no sandbox                                      
  │ Proxy                    no proxy                                        
  │ Memory Usage             259.4 MB                                        

Login information

Qwen OAuth

Anything else we need to know?

Steps to reproduce

  1. Start Qwen Code interactive mode (qwen)
  2. Type /context (note the trailing space)
  3. Observe: No dropdown suggestion appears
  4. Compare with /stats — which correctly shows model and tools as suggestions

Root cause

The contextCommand in packages/cli/src/ui/commands/contextCommand.ts is missing the subCommands property. While the command description mentions Use "/context detail" for per-item breakdown., the detail subcommand is not registered as an actual SlashCommand with its own name, description, and action. This means:

  1. The autocomplete system has no subCommands to display when the user types /context
  2. /context detail only works because the main action manually parses the args string, which is inconsistent with how other commands (like /stats) handle subcommands

Proposed fix

Add a subCommands array to contextCommand with a detail entry, matching the pattern used by statsCommand. This enables the autocomplete system toproperly suggest detail as a subcommand.

Metadata

Metadata

Assignees

Labels

status/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions