@mmmbuto/qwen-code-termux 0.12.0-termux → 0.14.0-termux
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.
- package/README.md +188 -55
- package/bundled/loop/SKILL.md +61 -0
- package/bundled/qc-helper/SKILL.md +151 -0
- package/bundled/qc-helper/docs/_meta.ts +30 -0
- package/bundled/qc-helper/docs/common-workflow.md +571 -0
- package/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
- package/bundled/qc-helper/docs/configuration/auth.md +366 -0
- package/bundled/qc-helper/docs/configuration/memory.md +0 -0
- package/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
- package/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
- package/bundled/qc-helper/docs/configuration/settings.md +655 -0
- package/bundled/qc-helper/docs/configuration/themes.md +160 -0
- package/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
- package/bundled/qc-helper/docs/configuration.md +73 -0
- package/bundled/qc-helper/docs/extension/_meta.ts +9 -0
- package/bundled/qc-helper/docs/extension/extension-releasing.md +204 -0
- package/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
- package/bundled/qc-helper/docs/extension/introduction.md +338 -0
- package/bundled/qc-helper/docs/features/_meta.ts +19 -0
- package/bundled/qc-helper/docs/features/approval-mode.md +263 -0
- package/bundled/qc-helper/docs/features/arena.md +218 -0
- package/bundled/qc-helper/docs/features/channels/_meta.ts +7 -0
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +134 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +336 -0
- package/bundled/qc-helper/docs/features/channels/plugins.md +87 -0
- package/bundled/qc-helper/docs/features/channels/telegram.md +120 -0
- package/bundled/qc-helper/docs/features/channels/weixin.md +106 -0
- package/bundled/qc-helper/docs/features/checkpointing.md +77 -0
- package/bundled/qc-helper/docs/features/commands.md +312 -0
- package/bundled/qc-helper/docs/features/headless.md +318 -0
- package/bundled/qc-helper/docs/features/hooks.md +720 -0
- package/bundled/qc-helper/docs/features/language.md +139 -0
- package/bundled/qc-helper/docs/features/lsp.md +417 -0
- package/bundled/qc-helper/docs/features/mcp.md +281 -0
- package/bundled/qc-helper/docs/features/sandbox.md +241 -0
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +139 -0
- package/bundled/qc-helper/docs/features/skills.md +289 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +515 -0
- package/bundled/qc-helper/docs/features/token-caching.md +29 -0
- package/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
- package/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
- package/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
- package/bundled/qc-helper/docs/integration-github-action.md +241 -0
- package/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
- package/bundled/qc-helper/docs/integration-vscode.md +39 -0
- package/bundled/qc-helper/docs/integration-zed.md +72 -0
- package/bundled/qc-helper/docs/overview.md +64 -0
- package/bundled/qc-helper/docs/quickstart.md +273 -0
- package/bundled/qc-helper/docs/reference/_meta.ts +3 -0
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
- package/bundled/qc-helper/docs/support/Uninstall.md +42 -0
- package/bundled/qc-helper/docs/support/_meta.ts +6 -0
- package/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
- package/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
- package/bundled/review/SKILL.md +261 -0
- package/cli.js +298314 -244746
- package/locales/de.js +358 -7
- package/locales/en.js +347 -7
- package/locales/ja.js +347 -7
- package/locales/pt.js +353 -7
- package/locales/ru.js +348 -7
- package/locales/zh.js +333 -7
- package/package.json +12 -7
- package/sandbox-macos-permissive-open.sb +3 -1
- package/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/vendor/tree-sitter/tree-sitter.wasm +0 -0
- package/CHANGELOG.md +0 -77
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
# Approval Mode
|
|
2
|
+
|
|
3
|
+
Qwen Code offers three distinct permission modes that allow you to flexibly control how AI interacts with your code and system based on task complexity and risk level.
|
|
4
|
+
|
|
5
|
+
## Permission Modes Comparison
|
|
6
|
+
|
|
7
|
+
| Mode | File Editing | Shell Commands | Best For | Risk Level |
|
|
8
|
+
| -------------- | --------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------ | ---------- |
|
|
9
|
+
| **Plan** | ❌ Read-only analysis only | ❌ Not executed | • Code exploration <br>• Planning complex changes <br>• Safe code review | Lowest |
|
|
10
|
+
| **Default** | ✅ Manual approval required | ✅ Manual approval required | • New/unfamiliar codebases <br>• Critical systems <br>• Team collaboration <br>• Learning and teaching | Low |
|
|
11
|
+
| **Auto-Edit** | ✅ Auto-approved | ❌ Manual approval required | • Daily development tasks <br>• Refactoring and code improvements <br>• Safe automation | Medium |
|
|
12
|
+
| **YOLO** | ✅ Auto-approved | ✅ Auto-approved | • Trusted personal projects <br>• Automated scripts/CI/CD <br>• Batch processing tasks | Highest |
|
|
13
|
+
|
|
14
|
+
### Quick Reference Guide
|
|
15
|
+
|
|
16
|
+
- **Start in Plan Mode**: Great for understanding before making changes
|
|
17
|
+
- **Work in Default Mode**: The balanced choice for most development work
|
|
18
|
+
- **Switch to Auto-Edit**: When you're making lots of safe code changes
|
|
19
|
+
- **Use YOLO sparingly**: Only for trusted automation in controlled environments
|
|
20
|
+
|
|
21
|
+
> [!tip]
|
|
22
|
+
>
|
|
23
|
+
> You can quickly cycle through modes during a session using **Shift+Tab** (or **Tab** on Windows). The terminal status bar shows your current mode, so you always know what permissions Qwen Code has.
|
|
24
|
+
|
|
25
|
+
## 1. Use Plan Mode for safe code analysis
|
|
26
|
+
|
|
27
|
+
Plan Mode instructs Qwen Code to create a plan by analyzing the codebase with **read-only** operations, perfect for exploring codebases, planning complex changes, or reviewing code safely.
|
|
28
|
+
|
|
29
|
+
### When to use Plan Mode
|
|
30
|
+
|
|
31
|
+
- **Multi-step implementation**: When your feature requires making edits to many files
|
|
32
|
+
- **Code exploration**: When you want to research the codebase thoroughly before changing anything
|
|
33
|
+
- **Interactive development**: When you want to iterate on the direction with Qwen Code
|
|
34
|
+
|
|
35
|
+
### How to use Plan Mode
|
|
36
|
+
|
|
37
|
+
**Turn on Plan Mode during a session**
|
|
38
|
+
|
|
39
|
+
You can switch into Plan Mode during a session using **Shift+Tab** (or **Tab** on Windows) to cycle through permission modes.
|
|
40
|
+
|
|
41
|
+
If you are in Normal Mode, **Shift+Tab** (or **Tab** on Windows) first switches into `auto-edits` Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** (or **Tab** on Windows) will switch into Plan Mode, indicated by `⏸ plan mode`.
|
|
42
|
+
|
|
43
|
+
**Start a new session in Plan Mode**
|
|
44
|
+
|
|
45
|
+
To start a new session in Plan Mode, use the `/approval-mode` then select `plan`
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
/approval-mode
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Run "headless" queries in Plan Mode**
|
|
52
|
+
|
|
53
|
+
You can also run a query in Plan Mode directly with `-p` or `prompt`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
qwen --prompt "What is machine learning?"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Example: Planning a complex refactor
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
/approval-mode plan
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Qwen Code analyzes the current implementation and create a comprehensive plan. Refine with follow-ups:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
What about backward compatibility?
|
|
73
|
+
How should we handle database migration?
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Configure Plan Mode as default
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
// .qwen/settings.json
|
|
80
|
+
{
|
|
81
|
+
"permissions": {
|
|
82
|
+
"defaultMode": "plan"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 2. Use Default Mode for Controlled Interaction
|
|
88
|
+
|
|
89
|
+
Default Mode is the standard way to work with Qwen Code. In this mode, you maintain full control over all potentially risky operations - Qwen Code will ask for your approval before making any file changes or executing shell commands.
|
|
90
|
+
|
|
91
|
+
### When to use Default Mode
|
|
92
|
+
|
|
93
|
+
- **New to a codebase**: When you're exploring an unfamiliar project and want to be extra cautious
|
|
94
|
+
- **Critical systems**: When working on production code, infrastructure, or sensitive data
|
|
95
|
+
- **Learning and teaching**: When you want to understand each step Qwen Code is taking
|
|
96
|
+
- **Team collaboration**: When multiple people are working on the same codebase
|
|
97
|
+
- **Complex operations**: When the changes involve multiple files or complex logic
|
|
98
|
+
|
|
99
|
+
### How to use Default Mode
|
|
100
|
+
|
|
101
|
+
**Turn on Default Mode during a session**
|
|
102
|
+
|
|
103
|
+
You can switch into Default Mode during a session using **Shift+Tab** (or **Tab** on Windows) to cycle through permission modes. If you're in any other mode, pressing **Shift+Tab** (or **Tab** on Windows) will eventually cycle back to Default Mode, indicated by the absence of any mode indicator at the bottom of the terminal.
|
|
104
|
+
|
|
105
|
+
**Start a new session in Default Mode**
|
|
106
|
+
|
|
107
|
+
Default Mode is the initial mode when you start Qwen Code. If you've changed modes and want to return to Default Mode, use:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
/approval-mode default
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Run "headless" queries in Default Mode**
|
|
114
|
+
|
|
115
|
+
When running headless commands, Default Mode is the default behavior. You can explicitly specify it with:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
qwen --prompt "Analyze this code for potential bugs"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Example: Safely implementing a feature
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
/approval-mode default
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
I need to add user profile pictures to our application. The pictures should be stored in an S3 bucket and the URLs saved in the database.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Qwen Code will analyze your codebase and propose a plan. It will then ask for approval before:
|
|
132
|
+
|
|
133
|
+
1. Creating new files (controllers, models, migrations)
|
|
134
|
+
2. Modifying existing files (adding new columns, updating APIs)
|
|
135
|
+
3. Running any shell commands (database migrations, dependency installation)
|
|
136
|
+
|
|
137
|
+
You can review each proposed change and approve or reject it individually.
|
|
138
|
+
|
|
139
|
+
### Configure Default Mode as default
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
// .qwen/settings.json
|
|
143
|
+
{
|
|
144
|
+
"permissions": {
|
|
145
|
+
"defaultMode": "default"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 3. Auto Edits Mode
|
|
151
|
+
|
|
152
|
+
Auto-Edit Mode instructs Qwen Code to automatically approve file edits while requiring manual approval for shell commands, ideal for accelerating development workflows while maintaining system safety.
|
|
153
|
+
|
|
154
|
+
### When to use Auto-Accept Edits Mode
|
|
155
|
+
|
|
156
|
+
- **Daily development**: Ideal for most coding tasks
|
|
157
|
+
- **Safe automation**: Allows AI to modify code while preventing accidental execution of dangerous commands
|
|
158
|
+
- **Team collaboration**: Use in shared projects to avoid unintended impacts on others
|
|
159
|
+
|
|
160
|
+
### How to switch to this mode
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
# Switch via command
|
|
164
|
+
/approval-mode auto-edit
|
|
165
|
+
|
|
166
|
+
# Or use keyboard shortcut
|
|
167
|
+
Shift+Tab (or Tab on Windows) # Switch from other modes
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Workflow Example
|
|
171
|
+
|
|
172
|
+
1. You ask Qwen Code to refactor a function
|
|
173
|
+
2. AI analyzes the code and proposes changes
|
|
174
|
+
3. **Automatically** applies all file changes without confirmation
|
|
175
|
+
4. If tests need to be run, it will **request approval** to execute `npm test`
|
|
176
|
+
|
|
177
|
+
## 4. YOLO Mode - Full Automation
|
|
178
|
+
|
|
179
|
+
YOLO Mode grants Qwen Code the highest permissions, automatically approving all tool calls including file editing and shell commands.
|
|
180
|
+
|
|
181
|
+
### When to use YOLO Mode
|
|
182
|
+
|
|
183
|
+
- **Automated scripts**: Running predefined automated tasks
|
|
184
|
+
- **CI/CD pipelines**: Automated execution in controlled environments
|
|
185
|
+
- **Personal projects**: Rapid iteration in fully trusted environments
|
|
186
|
+
- **Batch processing**: Tasks requiring multi-step command chains
|
|
187
|
+
|
|
188
|
+
> [!warning]
|
|
189
|
+
>
|
|
190
|
+
> **Use YOLO Mode with caution**: AI can execute any command with your terminal permissions. Ensure:
|
|
191
|
+
>
|
|
192
|
+
> 1. You trust the current codebase
|
|
193
|
+
> 2. You understand all actions AI will perform
|
|
194
|
+
> 3. Important files are backed up or committed to version control
|
|
195
|
+
|
|
196
|
+
### How to enable YOLO Mode
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
# Temporarily enable (current session only)
|
|
200
|
+
/approval-mode yolo
|
|
201
|
+
|
|
202
|
+
# Set as project default
|
|
203
|
+
/approval-mode yolo --project
|
|
204
|
+
|
|
205
|
+
# Set as user global default
|
|
206
|
+
/approval-mode yolo --user
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Configuration Example
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
// .qwen/settings.json
|
|
213
|
+
{
|
|
214
|
+
"permissions": {
|
|
215
|
+
"defaultMode": "yolo",
|
|
216
|
+
"confirmShellCommands": false,
|
|
217
|
+
"confirmFileEdits": false
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Automated Workflow Example
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Fully automated refactoring task
|
|
226
|
+
qwen --prompt "Run the test suite, fix all failing tests, then commit changes"
|
|
227
|
+
|
|
228
|
+
# Without human intervention, AI will:
|
|
229
|
+
# 1. Run test commands (auto-approved)
|
|
230
|
+
# 2. Fix failed test cases (auto-edit files)
|
|
231
|
+
# 3. Execute git commit (auto-approved)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Mode Switching & Configuration
|
|
235
|
+
|
|
236
|
+
### Keyboard Shortcut Switching
|
|
237
|
+
|
|
238
|
+
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the three modes:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
Default Mode → Auto-Edit Mode → YOLO Mode → Plan Mode → Default Mode
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Persistent Configuration
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
// Project-level: ./.qwen/settings.json
|
|
248
|
+
// User-level: ~/.qwen/settings.json
|
|
249
|
+
{
|
|
250
|
+
"permissions": {
|
|
251
|
+
"defaultMode": "auto-edit", // or "plan" or "yolo"
|
|
252
|
+
"confirmShellCommands": true,
|
|
253
|
+
"confirmFileEdits": true
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Mode Usage Recommendations
|
|
259
|
+
|
|
260
|
+
1. **New to codebase**: Start with **Plan Mode** for safe exploration
|
|
261
|
+
2. **Daily development tasks**: Use **Auto-Accept Edits** (default mode), efficient and safe
|
|
262
|
+
3. **Automated scripts**: Use **YOLO Mode** in controlled environments for full automation
|
|
263
|
+
4. **Complex refactoring**: Use **Plan Mode** first for detailed planning, then switch to appropriate mode for execution
|
|
@@ -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,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.
|