@qwen-code/qwen-code 0.14.0-preview.0 → 0.14.0-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +19 -9
  2. package/bundled/qc-helper/SKILL.md +151 -0
  3. package/bundled/qc-helper/docs/_meta.ts +30 -0
  4. package/bundled/qc-helper/docs/common-workflow.md +571 -0
  5. package/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
  6. package/bundled/qc-helper/docs/configuration/auth.md +366 -0
  7. package/bundled/qc-helper/docs/configuration/memory.md +0 -0
  8. package/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
  9. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
  10. package/bundled/qc-helper/docs/configuration/settings.md +655 -0
  11. package/bundled/qc-helper/docs/configuration/themes.md +160 -0
  12. package/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
  13. package/bundled/qc-helper/docs/extension/_meta.ts +9 -0
  14. package/bundled/qc-helper/docs/extension/extension-releasing.md +121 -0
  15. package/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
  16. package/bundled/qc-helper/docs/extension/introduction.md +310 -0
  17. package/bundled/qc-helper/docs/features/_meta.ts +18 -0
  18. package/bundled/qc-helper/docs/features/approval-mode.md +263 -0
  19. package/bundled/qc-helper/docs/features/arena.md +218 -0
  20. package/bundled/qc-helper/docs/features/channels/_meta.ts +7 -0
  21. package/bundled/qc-helper/docs/features/channels/dingtalk.md +134 -0
  22. package/bundled/qc-helper/docs/features/channels/overview.md +336 -0
  23. package/bundled/qc-helper/docs/features/channels/plugins.md +87 -0
  24. package/bundled/qc-helper/docs/features/channels/telegram.md +120 -0
  25. package/bundled/qc-helper/docs/features/channels/weixin.md +106 -0
  26. package/bundled/qc-helper/docs/features/checkpointing.md +77 -0
  27. package/bundled/qc-helper/docs/features/commands.md +312 -0
  28. package/bundled/qc-helper/docs/features/headless.md +318 -0
  29. package/bundled/qc-helper/docs/features/hooks.md +715 -0
  30. package/bundled/qc-helper/docs/features/language.md +139 -0
  31. package/bundled/qc-helper/docs/features/lsp.md +417 -0
  32. package/bundled/qc-helper/docs/features/mcp.md +281 -0
  33. package/bundled/qc-helper/docs/features/sandbox.md +241 -0
  34. package/bundled/qc-helper/docs/features/skills.md +289 -0
  35. package/bundled/qc-helper/docs/features/sub-agents.md +511 -0
  36. package/bundled/qc-helper/docs/features/token-caching.md +29 -0
  37. package/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
  38. package/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
  39. package/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
  40. package/bundled/qc-helper/docs/integration-github-action.md +241 -0
  41. package/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
  42. package/bundled/qc-helper/docs/integration-vscode.md +39 -0
  43. package/bundled/qc-helper/docs/integration-zed.md +72 -0
  44. package/bundled/qc-helper/docs/overview.md +64 -0
  45. package/bundled/qc-helper/docs/quickstart.md +273 -0
  46. package/bundled/qc-helper/docs/reference/_meta.ts +3 -0
  47. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
  48. package/bundled/qc-helper/docs/support/Uninstall.md +42 -0
  49. package/bundled/qc-helper/docs/support/_meta.ts +6 -0
  50. package/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
  51. package/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
  52. package/cli.js +55261 -35814
  53. package/locales/de.js +121 -5
  54. package/locales/en.js +118 -5
  55. package/locales/ja.js +117 -5
  56. package/locales/pt.js +120 -5
  57. package/locales/ru.js +119 -5
  58. package/locales/zh.js +111 -4
  59. package/package.json +2 -2
@@ -0,0 +1,218 @@
1
+ # Agent Arena
2
+
3
+ > Dispatch multiple AI models simultaneously to execute the same task, compare their solutions side-by-side, and select the best result to apply to your workspace.
4
+
5
+ > [!warning]
6
+ > Agent Arena is experimental. It has [known limitations](#limitations) around display modes and session management.
7
+
8
+ Agent Arena lets you pit multiple AI models against each other on the same task. Each model runs as a fully independent agent in its own isolated Git worktree, so file operations never interfere. When all agents finish, you compare results and select a winner to merge back into your main workspace.
9
+
10
+ Unlike [subagents](/users/features/sub-agents), which delegate focused subtasks within a single session, Arena agents are complete, top-level agent instances — each with its own model, context window, and full tool access.
11
+
12
+ This page covers:
13
+
14
+ - [When to use Agent Arena](#when-to-use-agent-arena)
15
+ - [Starting an arena session](#start-an-arena-session)
16
+ - [Interacting with agents](#interact-with-agents), including display modes and navigation
17
+ - [Comparing results and selecting a winner](#compare-results-and-select-a-winner)
18
+ - [Best practices](#best-practices)
19
+
20
+ ## When to use Agent Arena
21
+
22
+ Agent Arena is most effective when you want to **evaluate or compare** how different models tackle the same problem. The strongest use cases are:
23
+
24
+ - **Model benchmarking**: Evaluate different models' capabilities on real tasks in your actual codebase, not synthetic benchmarks
25
+ - **Best-of-N selection**: Get multiple independent solutions and pick the best implementation
26
+ - **Exploring approaches**: See how different models reason about and solve the same problem — useful for learning and insight
27
+ - **Risk reduction**: For critical changes, validate that multiple models converge on a similar approach before committing
28
+
29
+ Agent Arena uses significantly more tokens than a single session (each agent has its own context window and model calls). It works best when the value of comparison justifies the cost. For routine tasks where you trust your default model, a single session is more efficient.
30
+
31
+ ## Start an arena session
32
+
33
+ Use the `/arena` slash command to launch a session. Specify the models you want to compete and the task:
34
+
35
+ ```
36
+ /arena --models qwen3.5-plus,glm-5,kimi-k2.5 "Refactor the authentication module to use JWT tokens"
37
+ ```
38
+
39
+ If you omit `--models`, an interactive model selection dialog appears, letting you pick from your configured providers.
40
+
41
+ ### What happens when you start
42
+
43
+ 1. **Worktree setup**: Qwen Code creates isolated Git worktrees for each agent at `~/.qwen/arena/<session-id>/worktrees/<model-name>/`. Each worktree mirrors your current working directory state exactly — including staged changes, unstaged changes, and untracked files.
44
+ 2. **Agent spawning**: Each agent starts in its own worktree with full tool access and its configured model. Agents are launched sequentially but execute in parallel.
45
+ 3. **Execution**: All agents work on the task independently with no shared state or communication. You can monitor their progress and interact with any of them.
46
+ 4. **Completion**: When all agents finish (or fail), you enter the result comparison phase.
47
+
48
+ ## Interact with agents
49
+
50
+ ### Display modes
51
+
52
+ Agent Arena currently supports **in-process mode**, where all agents run asynchronously within the same terminal process. A tab bar at the bottom of the terminal lets you switch between agents.
53
+
54
+ > [!note]
55
+ > **Split-pane display modes are planned for the future.** We intend to support tmux-based and iTerm2-based split-pane layouts, where each agent gets its own terminal pane for true side-by-side viewing. Currently, only in-process tab switching is available.
56
+
57
+ ### Navigate between agents
58
+
59
+ In in-process mode, use keyboard shortcuts to switch between agent views:
60
+
61
+ | Shortcut | Action |
62
+ | :------- | :-------------------------------- |
63
+ | `Right` | Switch to the next agent tab |
64
+ | `Left` | Switch to the previous agent tab |
65
+ | `Up` | Switch focus to the input box |
66
+ | `Down` | Switch focus to the agent tab bar |
67
+
68
+ The tab bar shows each agent's current status:
69
+
70
+ | Indicator | Meaning |
71
+ | :-------- | :--------------------- |
72
+ | `●` | Running or idle |
73
+ | `✓` | Completed successfully |
74
+ | `✗` | Failed |
75
+ | `○` | Cancelled |
76
+
77
+ ### Interact with individual agents
78
+
79
+ When viewing an agent's tab, you can:
80
+
81
+ - **Send messages** — type in the input area to give the agent additional instructions
82
+ - **Approve tool calls** — if an agent requests tool approval, the confirmation dialog appears in its tab
83
+ - **View full history** — scroll through the agent's complete conversation, including model output, tool calls, and results
84
+
85
+ Each agent is a full, independent session. Anything you can do with the main agent, you can do with an arena agent.
86
+
87
+ ## Compare results and select a winner
88
+
89
+ When all agents complete, the Arena enters the result comparison phase. You'll see:
90
+
91
+ - **Status summary**: Which agents succeeded, failed, or were cancelled
92
+ - **Execution metrics**: Duration, rounds of reasoning, token usage, and tool call counts for each agent
93
+
94
+ A selection dialog presents the successful agents. Choose one to apply its changes to your main workspace, or discard all results.
95
+
96
+ ### What happens when you select a winner
97
+
98
+ 1. The winning agent's changes are extracted as a diff against the baseline
99
+ 2. The diff is applied to your main working directory
100
+ 3. All worktrees and temporary branches are cleaned up automatically
101
+
102
+ If you want to inspect results before deciding, each agent's full conversation history is available via the tab bar while the selection dialog is active.
103
+
104
+ ## Configuration
105
+
106
+ Arena behavior can be customized in [settings.json](/users/configuration/settings):
107
+
108
+ ```json
109
+ {
110
+ "arena": {
111
+ "worktreeBaseDir": "~/.qwen/arena",
112
+ "maxRoundsPerAgent": 50,
113
+ "timeoutSeconds": 600
114
+ }
115
+ }
116
+ ```
117
+
118
+ | Setting | Description | Default |
119
+ | :------------------------ | :--------------------------------- | :-------------- |
120
+ | `arena.worktreeBaseDir` | Base directory for arena worktrees | `~/.qwen/arena` |
121
+ | `arena.maxRoundsPerAgent` | Maximum reasoning rounds per agent | `50` |
122
+ | `arena.timeoutSeconds` | Timeout for each agent in seconds | `600` |
123
+
124
+ ## Best practices
125
+
126
+ ### Choose models that complement each other
127
+
128
+ Arena is most valuable when you compare models with meaningfully different strengths. For example:
129
+
130
+ ```
131
+ /arena --models qwen3.5-plus,glm-5,kimi-k2.5 "Optimize the database query layer"
132
+ ```
133
+
134
+ Comparing three versions of the same model family yields less insight than comparing across providers.
135
+
136
+ ### Keep tasks self-contained
137
+
138
+ Arena agents work independently with no communication. Tasks should be fully describable in the prompt without requiring back-and-forth:
139
+
140
+ **Good**: "Refactor the payment module to use the strategy pattern. Update all tests."
141
+
142
+ **Less effective**: "Let's discuss how to improve the payment module" — this benefits from conversation, which is better suited to a single session.
143
+
144
+ ### Limit the number of agents
145
+
146
+ Up to 5 agents can run simultaneously. In practice, 2-3 agents provide the best balance of comparison value to resource cost. More agents means:
147
+
148
+ - Higher token costs (each agent has its own context window)
149
+ - Longer total execution time
150
+ - More results to compare
151
+
152
+ Start with 2-3 and scale up only when the comparison value justifies it.
153
+
154
+ ### Use Arena for high-impact decisions
155
+
156
+ Arena shines when the stakes justify running multiple models:
157
+
158
+ - Choosing an architecture for a new module
159
+ - Selecting an approach for a complex refactor
160
+ - Validating a critical bug fix from multiple angles
161
+
162
+ For routine changes like renaming a variable or updating a config file, a single session is faster and cheaper.
163
+
164
+ ## Troubleshooting
165
+
166
+ ### Agents failing to start
167
+
168
+ - Verify that each model in `--models` is properly configured with valid API credentials
169
+ - Check that your working directory is a Git repository (worktrees require Git)
170
+ - Ensure you have write access to the worktree base directory (`~/.qwen/arena/` by default)
171
+
172
+ ### Worktree creation fails
173
+
174
+ - Run `git worktree list` to check for stale worktrees from previous sessions
175
+ - Clean up stale worktrees with `git worktree prune`
176
+ - Ensure your Git version supports worktrees (`git --version`, requires Git 2.5+)
177
+
178
+ ### Agent takes too long
179
+
180
+ - Increase the timeout: set `arena.timeoutSeconds` in settings
181
+ - Reduce task complexity — Arena tasks should be focused and well-defined
182
+ - Lower `arena.maxRoundsPerAgent` if agents are spending too many rounds
183
+
184
+ ### Applying winner fails
185
+
186
+ - Check for uncommitted changes in your main working directory that might conflict
187
+ - The diff is applied as a patch — merge conflicts are possible if your working directory changed during the session
188
+
189
+ ## Limitations
190
+
191
+ Agent Arena is experimental. Current limitations:
192
+
193
+ - **In-process mode only**: Split-pane display via tmux or iTerm2 is not yet available. All agents run within a single terminal window with tab switching.
194
+ - **No diff preview before selection**: You can view each agent's conversation history, but there is no unified diff viewer to compare solutions side-by-side before picking a winner.
195
+ - **No worktree retention**: Worktrees are always cleaned up after selection. There is no option to preserve them for further inspection.
196
+ - **No session resumption**: Arena sessions cannot be resumed after exiting. If you close the terminal mid-session, worktrees remain on disk and must be cleaned up manually via `git worktree prune`.
197
+ - **Maximum 5 agents**: The hard limit of 5 concurrent agents cannot be changed.
198
+ - **Git repository required**: Arena requires a Git repository for worktree isolation. It cannot be used in non-Git directories.
199
+
200
+ ## Comparison with other multi-agent modes
201
+
202
+ Agent Arena is one of several planned multi-agent modes in Qwen Code. **Agent Team** and **Agent Swarm** are not yet implemented — the table below describes their intended design for reference.
203
+
204
+ | | **Agent Arena** | **Agent Team** (planned) | **Agent Swarm** (planned) |
205
+ | :---------------- | :----------------------------------------------------- | :------------------------------------------------- | :------------------------------------------------------- |
206
+ | **Goal** | Competitive: Find the best solution to the _same_ task | Collaborative: Tackle _different_ aspects together | Batch parallel: Dynamically spawn workers for bulk tasks |
207
+ | **Agents** | Pre-configured models compete independently | Teammates collaborate with assigned roles | Workers spawned on-the-fly, destroyed on completion |
208
+ | **Communication** | No inter-agent communication | Direct peer-to-peer messaging | One-way: results aggregated by parent |
209
+ | **Isolation** | Full: separate Git worktrees | Independent sessions with shared task list | Lightweight ephemeral context per worker |
210
+ | **Output** | One selected solution applied to workspace | Synthesized results from multiple perspectives | Aggregated results from parallel processing |
211
+ | **Best for** | Benchmarking, choosing between model approaches | Research, complex collaboration, cross-layer work | Batch operations, data processing, map-reduce tasks |
212
+
213
+ ## Next steps
214
+
215
+ Explore related approaches for parallel and delegated work:
216
+
217
+ - **Lightweight delegation**: [Subagents](/users/features/sub-agents) handle focused subtasks within your session — better when you don't need model comparison
218
+ - **Manual parallel sessions**: Run multiple Qwen Code sessions yourself in separate terminals with [Git worktrees](https://git-scm.com/docs/git-worktree) for full manual control
@@ -0,0 +1,7 @@
1
+ export default {
2
+ overview: 'Overview',
3
+ telegram: 'Telegram',
4
+ weixin: 'WeChat',
5
+ dingtalk: 'DingTalk',
6
+ plugins: 'Plugins',
7
+ };
@@ -0,0 +1,134 @@
1
+ # DingTalk (Dingtalk)
2
+
3
+ This guide covers setting up a Qwen Code channel on DingTalk (钉钉).
4
+
5
+ ## Prerequisites
6
+
7
+ - A DingTalk organization account
8
+ - A DingTalk bot application with AppKey and AppSecret (see below)
9
+
10
+ ## Creating a Bot
11
+
12
+ 1. Go to the [DingTalk Developer Portal](https://open-dev.dingtalk.com)
13
+ 2. Create a new application (or use an existing one)
14
+ 3. Under the application, enable the **Robot** capability
15
+ 4. In Robot settings, enable **Stream Mode** (机器人协议 → Stream 模式)
16
+ 5. Note the **AppKey** (Client ID) and **AppSecret** (Client Secret) from the application credentials page
17
+
18
+ ### Stream Mode
19
+
20
+ DingTalk Stream mode uses an outbound WebSocket connection — no public URL or server is needed. The bot connects to DingTalk's servers, which push messages through the WebSocket. This is the simplest deployment model.
21
+
22
+ ## Configuration
23
+
24
+ Add the channel to `~/.qwen/settings.json`:
25
+
26
+ ```json
27
+ {
28
+ "channels": {
29
+ "my-dingtalk": {
30
+ "type": "dingtalk",
31
+ "clientId": "$DINGTALK_CLIENT_ID",
32
+ "clientSecret": "$DINGTALK_CLIENT_SECRET",
33
+ "senderPolicy": "open",
34
+ "sessionScope": "user",
35
+ "cwd": "/path/to/your/project",
36
+ "instructions": "You are a concise coding assistant responding via DingTalk.",
37
+ "groupPolicy": "open",
38
+ "groups": {
39
+ "*": { "requireMention": true }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ Set the credentials as environment variables:
47
+
48
+ ```bash
49
+ export DINGTALK_CLIENT_ID=<your-app-key>
50
+ export DINGTALK_CLIENT_SECRET=<your-app-secret>
51
+ ```
52
+
53
+ Or define them in the `env` section of `settings.json`:
54
+
55
+ ```json
56
+ {
57
+ "env": {
58
+ "DINGTALK_CLIENT_ID": "your-app-key",
59
+ "DINGTALK_CLIENT_SECRET": "your-app-secret"
60
+ }
61
+ }
62
+ ```
63
+
64
+ ## Running
65
+
66
+ ```bash
67
+ # Start only the DingTalk channel
68
+ qwen channel start my-dingtalk
69
+
70
+ # Or start all configured channels together
71
+ qwen channel start
72
+ ```
73
+
74
+ Open DingTalk and send a message to the bot. You should see a 👀 emoji reaction appear while the agent processes, followed by the response.
75
+
76
+ ## Group Chats
77
+
78
+ DingTalk bots work in both DM and group conversations. To enable group support:
79
+
80
+ 1. Set `groupPolicy` to `"allowlist"` or `"open"` in your channel config
81
+ 2. Add the bot to a DingTalk group
82
+ 3. @mention the bot in the group to trigger a response
83
+
84
+ By default, the bot requires an @mention in group chats (`requireMention: true`). Set `"requireMention": false` for a specific group to make it respond to all messages. See [Group Chats](./overview#group-chats) for full details.
85
+
86
+ ### Finding a Group's Conversation ID
87
+
88
+ DingTalk uses `conversationId` to identify groups. You can find it in the channel service logs when someone sends a message in the group — look for the `conversationId` field in the log output.
89
+
90
+ ## Images and Files
91
+
92
+ You can send photos and documents to the bot, not just text.
93
+
94
+ **Photos:** Send an image (screenshot, diagram, etc.) and the agent will analyze it using its vision capabilities. This requires a multimodal model — add `"model": "qwen3.5-plus"` (or another vision-capable model) to your channel config. DingTalk supports sending images directly or as part of rich text messages (mixed text + images).
95
+
96
+ **Files:** Send a PDF, code file, or any document. The bot downloads it from DingTalk's servers and saves it locally so the agent can read it with its file tools. Audio and video files are also supported. This works with any model.
97
+
98
+ ## Key Differences from Telegram
99
+
100
+ - **Authentication:** AppKey + AppSecret instead of a static bot token. The SDK manages access token refresh automatically.
101
+ - **Connection:** WebSocket stream instead of polling — no public IP or webhook URL needed.
102
+ - **Formatting:** Responses use DingTalk's markdown dialect (a limited subset). Tables are automatically converted to plain text since DingTalk doesn't render them. Long messages are split into chunks at ~3800 characters.
103
+ - **Working indicator:** A 👀 emoji reaction is added to the user's message while processing, then removed when the response is sent.
104
+ - **Media download:** Two-step process — a `downloadCode` from the message is exchanged for a temporary download URL via DingTalk's API.
105
+ - **Groups:** DingTalk uses `isInAtList` for @mention detection instead of parsing message entities.
106
+
107
+ ## Tips
108
+
109
+ - **Use DingTalk markdown-aware instructions** — DingTalk supports a limited markdown subset (headers, bold, links, code blocks, but not tables). Adding instructions like "Use DingTalk markdown. Avoid tables." helps the agent format responses correctly.
110
+ - **Restrict access** — In an organization context, `senderPolicy: "open"` may be acceptable. For tighter control, use `"allowlist"` or `"pairing"`. See [DM Pairing](./overview#dm-pairing) for details.
111
+ - **Referenced messages** — Quoting (replying to) a user message includes the quoted text as context for the agent. Quoting bot responses is not yet supported.
112
+
113
+ ## Troubleshooting
114
+
115
+ ### Bot doesn't connect
116
+
117
+ - Verify your AppKey and AppSecret are correct
118
+ - Check that the environment variables are set before running `qwen channel start`
119
+ - Make sure **Stream Mode** is enabled in the bot's settings on the DingTalk Developer Portal
120
+ - Check the terminal output for connection errors
121
+
122
+ ### Bot doesn't respond in groups
123
+
124
+ - Check that `groupPolicy` is set to `"allowlist"` or `"open"` (default is `"disabled"`)
125
+ - Make sure you @mention the bot in the group message
126
+ - Verify the bot has been added to the group
127
+
128
+ ### "No sessionWebhook in message"
129
+
130
+ This means DingTalk didn't include a reply endpoint in the message callback. This can happen if the bot's permissions are misconfigured. Check the bot's settings in the Developer Portal.
131
+
132
+ ### "Sorry, something went wrong processing your message"
133
+
134
+ This usually means the agent encountered an error. Check the terminal output for details.