@qwen-code/qwen-code 0.18.0-preview.2 → 0.18.0
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/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/settings.md +3 -5
- package/bundled/qc-helper/docs/features/approval-mode.md +10 -14
- package/bundled/qc-helper/docs/features/commands.md +33 -11
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/sub-agents.md +32 -11
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
- package/bundled/qc-helper/docs/qwen-serve.md +234 -24
- package/chunks/{agent-QB7TZ4HW.js → agent-LOTJK6AH.js} +23 -23
- package/chunks/{agent-headless-APVHH7QM.js → agent-headless-TU3EPMYU.js} +23 -23
- package/chunks/{anthropicContentGenerator-M45EVVRM.js → anthropicContentGenerator-2HBRNQ3B.js} +7 -7
- package/chunks/{askUserQuestion-WM2KHM3K.js → askUserQuestion-OGCMIBQM.js} +45 -3
- package/chunks/{chunk-MVIVIPCU.js → chunk-2Y5SYSD3.js} +361 -583
- package/chunks/chunk-3DHXZ6EV.js +241 -0
- package/chunks/{chunk-JVQOQ3OU.js → chunk-3HTIVKZE.js} +1 -1
- package/chunks/{chunk-BNESGOSJ.js → chunk-55ZMG67I.js} +1 -1
- package/chunks/{chunk-ZK4AMNIU.js → chunk-6YIUGZTC.js} +1041 -210
- package/chunks/{chunk-C6WMLUNB.js → chunk-72LDN5PP.js} +1 -1
- package/chunks/{chunk-AVW55ZCO.js → chunk-7BCMOPIM.js} +11 -9
- package/chunks/{chunk-JUGRPQAB.js → chunk-A7B4ISQP.js} +1 -1
- package/chunks/{chunk-UAMOBVVW.js → chunk-B7HXHOHU.js} +1 -1
- package/chunks/{chunk-CNSMKPK6.js → chunk-BIVG75CP.js} +1 -1
- package/chunks/{chunk-LR62TEET.js → chunk-EYENRK4D.js} +1 -1
- package/chunks/{chunk-SZOEIL6S.js → chunk-H6BD2ELD.js} +1 -0
- package/chunks/{chunk-PAEBHDIO.js → chunk-HLPLOD42.js} +1 -1
- package/chunks/{chunk-JXAZUMDW.js → chunk-HR7SV7AY.js} +1 -2
- package/chunks/{chunk-P4J26VDS.js → chunk-IDX6COTE.js} +2 -2
- package/chunks/{chunk-QCG6KPNM.js → chunk-IWAYOW5Q.js} +14760 -10735
- package/chunks/{chunk-HGJPQK33.js → chunk-J5MDQKJL.js} +518 -519
- package/chunks/{chunk-USE2VQ5P.js → chunk-JTQAQBTV.js} +21 -0
- package/chunks/{chunk-HXJE7VOG.js → chunk-LBP46COL.js} +1001 -139
- package/chunks/{chunk-NW5QBUYO.js → chunk-LEJ42GNY.js} +14 -14
- package/chunks/{chunk-Y7R6H6FT.js → chunk-M6VTDSVR.js} +1 -1
- package/chunks/{chunk-CNHFPN7T.js → chunk-MFBBBTNY.js} +1 -1
- package/chunks/{chunk-ICOI4E4S.js → chunk-OHEGWO4L.js} +101 -23
- package/chunks/{chunk-7YKXFA3D.js → chunk-PL3MVCWD.js} +5 -5
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/{chunk-HV3ZZ7G4.js → chunk-R7ODSGTK.js} +2 -2
- package/chunks/{chunk-GX7VH5JQ.js → chunk-SEGYWKIH.js} +1 -1
- package/chunks/{chunk-KC6ZMJ5X.js → chunk-SNGELLWX.js} +1 -1
- package/chunks/chunk-XBY7E2FX.js +605 -0
- package/chunks/{chunk-2ZTWI7KH.js → chunk-XV4HCEVI.js} +22 -1
- package/chunks/{chunk-WFVXF3OM.js → chunk-Z2Z3GUXZ.js} +1 -0
- package/chunks/{chunk-CWV3SJZS.js → chunk-ZTZ4DDQE.js} +2 -2
- package/chunks/{computer-use-B7VIUI7F.js → computer-use-3RH2DOM6.js} +23 -23
- package/chunks/contextCommand-K347QT6O.js +52 -0
- package/chunks/{cron-create-FI5LJVUS.js → cron-create-YJL3KFWI.js} +3 -3
- package/chunks/{cron-delete-ZGUXWBTG.js → cron-delete-WKWSJZQA.js} +3 -3
- package/chunks/{cron-list-QNNZGMN3.js → cron-list-B52XEXAZ.js} +3 -3
- package/chunks/{devtools-IXE4UP72.js → devtools-FM6GJPYG.js} +1 -1
- package/chunks/{dist-R2SXPG74.js → dist-4LXD6L6X.js} +2 -2
- package/chunks/{dist-TE5QKMGR.js → dist-H6ONXVLG.js} +1 -1
- package/chunks/{dist-ZMQ4TXD5.js → dist-KAZ3SEBX.js} +2 -2
- package/chunks/{dist-BXDUQ2QY.js → dist-PK7DFCAW.js} +1 -1
- package/chunks/{edit-6UBTS2J5.js → edit-KU4PJGEX.js} +24 -24
- package/chunks/{en-HSQQNQUB.js → en-DHGYHIHX.js} +4 -0
- package/chunks/{enter-worktree-NN7LIXCM.js → enter-worktree-PPYIDCWI.js} +23 -23
- package/chunks/enterPlanMode-5CZDMCB4.js +158 -0
- package/chunks/{exit-worktree-GGSS5KIE.js → exit-worktree-UY3CGHKC.js} +23 -23
- package/chunks/exitPlanMode-3DN4QNSG.js +703 -0
- package/chunks/{geminiContentGenerator-I4H2NLJG.js → geminiContentGenerator-7A6I2RWB.js} +7 -7
- package/chunks/{getMachineId-bsd-F7GNPTER.js → getMachineId-bsd-4CASPIU4.js} +1 -1
- package/chunks/{getMachineId-darwin-T73DJL27.js → getMachineId-darwin-HPQPEMZR.js} +1 -1
- package/chunks/{getMachineId-linux-MKQTFPQM.js → getMachineId-linux-AUARKYHL.js} +1 -1
- package/chunks/{getMachineId-unsupported-MUR5KOQE.js → getMachineId-unsupported-S32ZDA2T.js} +1 -1
- package/chunks/{getMachineId-win-CDYFC6ZM.js → getMachineId-win-4EFLHYIJ.js} +1 -1
- package/chunks/{glob-OLCX57MD.js → glob-OFNQSS52.js} +23 -23
- package/chunks/{grep-7HXIMDOW.js → grep-6J2MSUM5.js} +26 -23
- package/chunks/{keychain-token-storage-LB46DAEK.js → keychain-token-storage-6IU6ORQN.js} +3 -3
- package/chunks/{ls-6PEZUK6O.js → ls-V3O6A5PT.js} +4 -4
- package/chunks/{lsp-JZSJOVT7.js → lsp-G2OCIFUA.js} +3 -3
- package/chunks/{monitor-SQO7MVAV.js → monitor-FKLHV423.js} +23 -23
- package/chunks/{notebook-edit-72L3EBAL.js → notebook-edit-KTBYFKWG.js} +24 -24
- package/chunks/{openaiContentGenerator-FTR7CDWF.js → openaiContentGenerator-L5KSWQY7.js} +15 -15
- package/chunks/{qwenContentGenerator-U5UFQ566.js → qwenContentGenerator-PYOXLMBW.js} +25 -25
- package/chunks/{qwenOAuth2-EFSECGHF.js → qwenOAuth2-2KCKWDCF.js} +6 -5
- package/chunks/{read-file-UA64EEQC.js → read-file-JQVRK4NU.js} +11 -11
- package/chunks/{ripGrep-WSYCWZVK.js → ripGrep-2L4LPNAJ.js} +23 -23
- package/chunks/{scheduler-VBASHOCA.js → scheduler-FGNXY4JQ.js} +23 -23
- package/chunks/{send-message-OYJZ5TPG.js → send-message-SZFWNOCL.js} +3 -3
- package/chunks/{serve-A7E2OJDR.js → serve-N2IBLA3G.js} +13581 -4977
- package/chunks/{shell-3NFOT6F5.js → shell-PTEG6UX4.js} +23 -23
- package/chunks/{skill-RA5YUREY.js → skill-X4NTK4NH.js} +64 -113
- package/chunks/{src-NFCMARMT.js → src-GLLQ3R5W.js} +154 -38
- package/chunks/{syntheticOutput-DETQ2YM6.js → syntheticOutput-IKAY5F6X.js} +4 -4
- package/chunks/{task-create-Y3ZKTJIG.js → task-create-MQICOJFV.js} +7 -7
- package/chunks/{task-list-ONXJ3I3A.js → task-list-RIHJCH32.js} +6 -6
- package/chunks/{task-stop-UHDC4N5B.js → task-stop-FWZRFANS.js} +3 -3
- package/chunks/{task-update-TCNOU3P5.js → task-update-2LHPXOYM.js} +20 -9
- package/chunks/{team-create-6SR4OVRG.js → team-create-2E4PF4KN.js} +26 -25
- package/chunks/{team-delete-EJ4U4DDP.js → team-delete-DAUDQS4J.js} +8 -6
- package/chunks/{todoWrite-TEYDRS5L.js → todoWrite-HTUACZES.js} +5 -5
- package/chunks/{tool-search-OD435A3X.js → tool-search-KTVULRES.js} +11 -11
- package/chunks/{web-fetch-6W67H5PO.js → web-fetch-CZ7LLKPE.js} +5 -5
- package/chunks/{workflow-62DHH4EO.js → workflow-L2ZUUDT2.js} +268 -16
- package/chunks/{write-file-475L5OPP.js → write-file-ZEB2JDYH.js} +24 -24
- package/chunks/{zh-VCLWO26Y.js → zh-7H5OQC4I.js} +5 -1
- package/chunks/{zh-TW-G3HFHVVT.js → zh-TW-P4IDHD3M.js} +5 -1
- package/cli.js +5955 -3128
- package/examples/starter/QWEN.md +30 -0
- package/examples/starter/README.md +59 -0
- package/examples/starter/agents/diary.md +86 -0
- package/examples/starter/commands/writing/polish.md +13 -0
- package/examples/starter/example.ts +64 -0
- package/examples/starter/package.json +18 -0
- package/examples/starter/qwen-extension.json +12 -0
- package/examples/starter/skills/synonyms/SKILL.md +48 -0
- package/examples/starter/tsconfig.json +13 -0
- package/fzfWorker.js +1083 -0
- package/locales/en.js +6 -0
- package/locales/zh-TW.js +5 -0
- package/locales/zh.js +5 -0
- package/package.json +3 -2
- package/chunks/chunk-AJIR24J2.js +0 -59
- package/chunks/chunk-XBFVXFB2.js +0 -216
- package/chunks/contextCommand-63RZ3O5R.js +0 -52
- package/chunks/exitPlanMode-H323NHB2.js +0 -235
|
@@ -15,6 +15,7 @@ export default {
|
|
|
15
15
|
'integration-jetbrains': 'JetBrains IDEs',
|
|
16
16
|
'integration-github-action': 'GitHub Actions',
|
|
17
17
|
'qwen-serve': 'Daemon mode (qwen serve)',
|
|
18
|
+
'qwen-serve-deploy-local': 'Daemon mode — local launch templates',
|
|
18
19
|
'Code with Qwen Code': {
|
|
19
20
|
type: 'separator',
|
|
20
21
|
title: 'Code with Qwen Code', // Title is optional
|
|
@@ -108,18 +108,16 @@ Settings are organized into categories. Most settings should be placed within th
|
|
|
108
108
|
| `ui.customBannerTitle` | string | Replace the default `>_ Qwen Code` title in the banner info panel. The `(vX.Y.Z)` version suffix is always appended; auth, model, and path lines are not affected. Sanitized; capped at 80 characters. | `""` |
|
|
109
109
|
| `ui.customBannerSubtitle` | string | Optional subtitle line rendered between the banner title and the auth/model line, in place of the blank spacer row. Sanitized; capped at 160 characters. Empty (default) keeps the original blank spacer. | `""` |
|
|
110
110
|
| `ui.customAsciiArt` | string \| object | Replace the QWEN ASCII logo in the banner. Accepts an inline string (used for both width tiers), `{ "path": "./brand.txt" }` (relative paths resolve against the owning settings file's directory; read once at startup with `O_NOFOLLOW` on POSIX, capped at 64 KB), or `{ "small": ..., "large": ... }` for width-aware selection. Sanitized; capped at 200 lines × 200 columns per tier. | `undefined` |
|
|
111
|
-
| `ui.hideFooter` | boolean | Hide the footer from the UI. | `false` |
|
|
112
|
-
| `ui.showMemoryUsage` | boolean | Display memory usage information in the UI. | `false` |
|
|
113
111
|
| `ui.showLineNumbers` | boolean | Show line numbers in code blocks in the CLI output. | `true` |
|
|
114
112
|
| `ui.renderMode` | string | Default Markdown display mode. Use `"render"` for rich visual previews or `"raw"` to show source-oriented Markdown by default. Toggle during a session with `Alt/Option+M`; on macOS the terminal must send Option as Meta. See [Markdown Rendering](../features/markdown-rendering). | `"render"` |
|
|
115
|
-
| `ui.showCitations` | boolean | Show citations for generated text in the chat. | `
|
|
113
|
+
| `ui.showCitations` | boolean | Show citations for generated text in the chat. | `false` |
|
|
116
114
|
| `ui.compactMode` | boolean | Hide tool output and thinking for a cleaner view. Toggle with `Ctrl+O` during a session or via the Settings dialog. Tool approval prompts are never hidden, even in compact mode. The setting persists across sessions. | `false` |
|
|
117
115
|
| `ui.shellOutputMaxLines` | number | Max number of shell output lines shown inline. Set to `0` to disable the cap and show full output. Hidden lines are surfaced via the `+N lines` indicator. Errors, `!`-prefix user-initiated commands, confirming tools, and focused embedded shells always show full output. | `5` |
|
|
118
|
-
| `enableWelcomeBack`
|
|
116
|
+
| `ui.enableWelcomeBack` | boolean | Show welcome back dialog when returning to a project with conversation history. When enabled, Qwen Code will automatically detect if you're returning to a project with a previously generated project summary (`.qwen/PROJECT_SUMMARY.md`) and show a dialog allowing you to continue your previous conversation or start fresh. If you choose **Start new chat session**, that choice is remembered for the current project until the project summary changes. This feature integrates with the `/summary` command and quit confirmation dialog. | `true` |
|
|
119
117
|
| `ui.accessibility.enableLoadingPhrases` | boolean | Enable loading phrases (disable for accessibility). | `true` |
|
|
120
118
|
| `ui.accessibility.screenReader` | boolean | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | `false` |
|
|
121
119
|
| `ui.customWittyPhrases` | array of strings | A list of custom phrases to display during loading states. When provided, the CLI will cycle through these phrases instead of the default ones. | `[]` |
|
|
122
|
-
| `ui.enableFollowupSuggestions` | boolean | Enable [followup suggestions](../features/followup-suggestions) that predict what you want to type next after the model responds. Suggestions appear as ghost text and can be accepted with Tab, Enter, or Right Arrow. | `
|
|
120
|
+
| `ui.enableFollowupSuggestions` | boolean | Enable [followup suggestions](../features/followup-suggestions) that predict what you want to type next after the model responds. Suggestions appear as ghost text and can be accepted with Tab, Enter, or Right Arrow. | `false` |
|
|
123
121
|
| `ui.enableCacheSharing` | boolean | Use cache-aware forked queries for suggestion generation. Reduces cost on providers that support prefix caching (experimental). | `true` |
|
|
124
122
|
| `ui.enableSpeculation` | boolean | Speculatively execute accepted suggestions before submission. Results appear instantly when you accept (experimental). | `false` |
|
|
125
123
|
| `experimental.emitToolUseSummaries` | boolean | Generate short LLM-based labels summarizing each tool-call batch. See [Tool-Use Summaries](../features/tool-use-summaries). Requires `fastModel` to be configured; silently skipped otherwise. Can be overridden per-session with `QWEN_CODE_EMIT_TOOL_USE_SUMMARIES=0` or `=1`. | `true` |
|
|
@@ -94,8 +94,8 @@ How should we handle database migration?
|
|
|
94
94
|
```json
|
|
95
95
|
// .qwen/settings.json
|
|
96
96
|
{
|
|
97
|
-
"
|
|
98
|
-
"
|
|
97
|
+
"tools": {
|
|
98
|
+
"approvalMode": "plan"
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
```
|
|
@@ -157,8 +157,8 @@ You can review each proposed change and approve or reject it individually.
|
|
|
157
157
|
```bash
|
|
158
158
|
// .qwen/settings.json
|
|
159
159
|
{
|
|
160
|
-
"
|
|
161
|
-
"
|
|
160
|
+
"tools": {
|
|
161
|
+
"approvalMode": "default"
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
```
|
|
@@ -340,10 +340,8 @@ YOLO Mode grants Qwen Code the highest permissions, automatically approving all
|
|
|
340
340
|
```bash
|
|
341
341
|
// .qwen/settings.json
|
|
342
342
|
{
|
|
343
|
-
"
|
|
344
|
-
"
|
|
345
|
-
"confirmShellCommands": false,
|
|
346
|
-
"confirmFileEdits": false
|
|
343
|
+
"tools": {
|
|
344
|
+
"approvalMode": "yolo"
|
|
347
345
|
}
|
|
348
346
|
}
|
|
349
347
|
```
|
|
@@ -364,10 +362,10 @@ qwen --prompt "Run the test suite, fix all failing tests, then commit changes"
|
|
|
364
362
|
|
|
365
363
|
### Keyboard Shortcut Switching
|
|
366
364
|
|
|
367
|
-
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the
|
|
365
|
+
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the five modes:
|
|
368
366
|
|
|
369
367
|
```
|
|
370
|
-
Ask Permissions Mode → Auto-Edit Mode →
|
|
368
|
+
Plan Mode → Ask Permissions Mode → Auto-Edit Mode → Auto Mode → YOLO Mode → Plan Mode
|
|
371
369
|
```
|
|
372
370
|
|
|
373
371
|
### Persistent Configuration
|
|
@@ -376,10 +374,8 @@ Ask Permissions Mode → Auto-Edit Mode → YOLO Mode → Plan Mode → Ask Perm
|
|
|
376
374
|
// Project-level: ./.qwen/settings.json
|
|
377
375
|
// User-level: ~/.qwen/settings.json
|
|
378
376
|
{
|
|
379
|
-
"
|
|
380
|
-
"
|
|
381
|
-
"confirmShellCommands": true,
|
|
382
|
-
"confirmFileEdits": true
|
|
377
|
+
"tools": {
|
|
378
|
+
"approvalMode": "auto-edit" // or "plan", "default", "auto", "yolo"
|
|
383
379
|
}
|
|
384
380
|
}
|
|
385
381
|
```
|
|
@@ -18,14 +18,21 @@ Slash commands are used to manage Qwen Code sessions, interface, and basic behav
|
|
|
18
18
|
|
|
19
19
|
These commands help you save, restore, and summarize work progress.
|
|
20
20
|
|
|
21
|
-
| Command
|
|
22
|
-
|
|
|
23
|
-
| `/init`
|
|
24
|
-
| `/summary`
|
|
25
|
-
| `/compress`
|
|
26
|
-
| `/
|
|
27
|
-
| `/
|
|
28
|
-
| `/
|
|
21
|
+
| Command | Description | Usage Examples |
|
|
22
|
+
| ---------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------- |
|
|
23
|
+
| `/init` | Analyze current directory and create initial context file | `/init` |
|
|
24
|
+
| `/summary` | Generate project summary based on conversation history | `/summary` |
|
|
25
|
+
| `/compress` | Replace chat history with summary to save Tokens | `/compress` |
|
|
26
|
+
| `/compress-fast` | Fast compression without AI — strips old tool outputs and thinking parts | `/compress-fast` |
|
|
27
|
+
| `/resume` | Resume a previous conversation session | `/resume` |
|
|
28
|
+
| `/recap` | Generate a one-line session recap now | `/recap` |
|
|
29
|
+
| `/restore` | Revert project files to the checkpoint before a tool call ran | `/restore` (list) or `/restore <ID>` |
|
|
30
|
+
| `/delete` | Delete a previous session | `/delete` |
|
|
31
|
+
| `/branch` | Fork the current conversation into a new session | `/branch` |
|
|
32
|
+
| `/fork` | Spawn a background agent that inherits the full conversation | `/fork <directive>` |
|
|
33
|
+
| `/rewind` | Rewind conversation to a previous turn | `/rewind` or `/rollback` |
|
|
34
|
+
| `/export` | Export session history to file | `/export html`, `/export md`, `/export json`, `/export jsonl` |
|
|
35
|
+
| `/rename` | Rename or tag the current session | `/rename My Feature` or `/tag` |
|
|
29
36
|
|
|
30
37
|
### 1.2 Interface and Workspace Control
|
|
31
38
|
|
|
@@ -43,6 +50,7 @@ Commands for adjusting interface appearance and work environment.
|
|
|
43
50
|
| `/editor` | Open dialog to select supported editor | `/editor` |
|
|
44
51
|
| `/statusline` | Open interactive [status line](./status-line.md) preset dialog | `/statusline` |
|
|
45
52
|
| `/statusline <text>` | Generate a command-mode [status line](./status-line.md) via agent | `/statusline show model and git branch` |
|
|
53
|
+
| `/terminal-setup` | Configure terminal keybindings for multiline input | `/terminal-setup` |
|
|
46
54
|
|
|
47
55
|
### 1.3 Language Settings
|
|
48
56
|
|
|
@@ -71,6 +79,7 @@ Commands for managing AI tools and models.
|
|
|
71
79
|
| →`plan` | Analysis only, no execution | Secure review |
|
|
72
80
|
| →`default` | Require approval for edits | Daily use |
|
|
73
81
|
| →`auto-edit` | Automatically approve edits | Trusted environment |
|
|
82
|
+
| →`auto` | Classifier-evaluated approval | Autonomous sessions with safety guardrails |
|
|
74
83
|
| →`yolo` | Automatically approve all | Quick prototyping |
|
|
75
84
|
| `/model` | Switch model used in current session | `/model` |
|
|
76
85
|
| `/model --fast` | Set a lighter model for prompt suggestions | `/model --fast qwen3-coder-flash` |
|
|
@@ -79,6 +88,14 @@ Commands for managing AI tools and models.
|
|
|
79
88
|
| `/remember` | Save a durable memory | `/remember Prefer terse responses` |
|
|
80
89
|
| `/forget` | Remove matching entries from auto-memory | `/forget <query>` |
|
|
81
90
|
| `/dream` | Manually run auto-memory consolidation | `/dream` |
|
|
91
|
+
| `/hooks` | Manage Qwen Code hooks | `/hooks`, `/hooks list` |
|
|
92
|
+
| `/permissions` | Manage permission rules | `/permissions` |
|
|
93
|
+
| `/agents` | Manage subagents | `/agents manage`, `/agents create` |
|
|
94
|
+
| `/arena` | Manage Arena sessions | `/arena start`, `/arena status` |
|
|
95
|
+
| `/goal` | Set a goal — keep working until condition met | `/goal <condition>`, `/goal clear` |
|
|
96
|
+
| `/tasks` | List background tasks | `/tasks` |
|
|
97
|
+
| `/lsp` | Show LSP server status | `/lsp` |
|
|
98
|
+
| `/trust` | Manage folder trust settings | `/trust` |
|
|
82
99
|
|
|
83
100
|
### 1.5 Built-in Skills
|
|
84
101
|
|
|
@@ -192,7 +209,7 @@ progress; otherwise it waits for the current turn to finish and then fires).
|
|
|
192
209
|
Unlike the manual command, the auto-trigger is fully silent on failure: if
|
|
193
210
|
generation errors or there is nothing to summarize, no message is added to
|
|
194
211
|
the history. Controlled by the `general.showSessionRecap` setting
|
|
195
|
-
(default: `
|
|
212
|
+
(default: `false`); the manual `/recap` command always works regardless of
|
|
196
213
|
this setting.
|
|
197
214
|
|
|
198
215
|
**Example:**
|
|
@@ -209,8 +226,8 @@ this setting.
|
|
|
209
226
|
>
|
|
210
227
|
> Configure a fast model via `/model --fast <model>` (e.g.
|
|
211
228
|
> `qwen3-coder-flash`) to make `/recap` fast and cheap. Set
|
|
212
|
-
> `general.showSessionRecap` to `
|
|
213
|
-
>
|
|
229
|
+
> `general.showSessionRecap` to `true` to enable the auto-trigger; the
|
|
230
|
+
> manual `/recap` command always works regardless of this setting.
|
|
214
231
|
|
|
215
232
|
### 1.8 Diff Viewer (`/diff`)
|
|
216
233
|
|
|
@@ -278,6 +295,11 @@ Commands for obtaining information and performing system settings.
|
|
|
278
295
|
| `/stats tools` | Show per-tool call counts | `/stats tools` |
|
|
279
296
|
| `/settings` | Open settings editor | `/settings` |
|
|
280
297
|
| `/auth` | Change authentication method | `/auth` |
|
|
298
|
+
| `/doctor` | Run installation and environment diagnostics | `/doctor`, `/doctor memory` |
|
|
299
|
+
| `/docs` | Open full Qwen Code documentation in browser | `/docs` |
|
|
300
|
+
| `/ide` | Manage IDE integration | `/ide status`, `/ide install` |
|
|
301
|
+
| `/insight` | Generate programming insights from chat history | `/insight` |
|
|
302
|
+
| `/setup-github` | Set up GitHub Actions | `/setup-github` |
|
|
281
303
|
| `/bug` | Submit issue about Qwen Code | `/bug Button click unresponsive` |
|
|
282
304
|
| `/copy` | Copy AI output to clipboard (`/copy N` = Nth-last AI message) | `/copy` or `/copy 2` |
|
|
283
305
|
| `/quit` | Exit Qwen Code immediately | `/quit` or `/exit` |
|
|
@@ -32,7 +32,7 @@ Suggestions are generated when all of the following conditions are met:
|
|
|
32
32
|
- There are no errors in the most recent response
|
|
33
33
|
- No confirmation dialogs are pending (e.g., shell confirmation, permissions)
|
|
34
34
|
- The approval mode is not set to `plan`
|
|
35
|
-
- The feature is enabled in settings (
|
|
35
|
+
- The feature is enabled in settings (disabled by default — set `ui.enableFollowupSuggestions` to `true` to turn it on)
|
|
36
36
|
|
|
37
37
|
Suggestions will not appear in non-interactive mode (e.g., headless/SDK mode).
|
|
38
38
|
|
|
@@ -72,7 +72,7 @@ These settings can be configured in `settings.json`:
|
|
|
72
72
|
|
|
73
73
|
| Setting | Type | Default | Description |
|
|
74
74
|
| ------------------------------ | ------- | ------- | ------------------------------------------------------------------ |
|
|
75
|
-
| `ui.enableFollowupSuggestions` | boolean | `
|
|
75
|
+
| `ui.enableFollowupSuggestions` | boolean | `false` | Enable or disable followup suggestions |
|
|
76
76
|
| `ui.enableCacheSharing` | boolean | `true` | Use cache-aware forked queries to reduce cost (experimental) |
|
|
77
77
|
| `ui.enableSpeculation` | boolean | `false` | Speculatively execute suggestions before submission (experimental) |
|
|
78
78
|
| `fastModel` | string | `""` | Model for prompt suggestions and speculative execution |
|
|
@@ -282,13 +282,15 @@ can drop a CC agent file into `.qwen/agents/` and have the supported fields
|
|
|
282
282
|
parse identically. Optional fields with invalid values are silently dropped
|
|
283
283
|
at parse time rather than rejected — the same lenient posture CC uses.
|
|
284
284
|
|
|
285
|
-
| Field | Type | Notes
|
|
286
|
-
| ---------------- | ---------------- |
|
|
287
|
-
| `permissionMode` | enum string | `acceptEdits`, `auto`, `bypassPermissions`, `default`, `dontAsk`, `plan`. Mapped to `approvalMode` at parse time; when both are set, the explicit `approvalMode` wins.
|
|
288
|
-
| `maxTurns` | positive integer | Caps the agent's turn budget. Wired into `runConfig.max_turns` at runtime; when both are set, the top-level field wins.
|
|
289
|
-
| `color` | enum string | Display color. Allowlist: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan` (mirrors CC's `_Y`). The legacy qwen sentinel `auto` is
|
|
285
|
+
| Field | Type | Notes |
|
|
286
|
+
| ---------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
287
|
+
| `permissionMode` | enum string | `acceptEdits`, `auto`, `bypassPermissions`, `default`, `dontAsk`, `plan`. Mapped to `approvalMode` at parse time; when both are set, the explicit `approvalMode` wins. |
|
|
288
|
+
| `maxTurns` | positive integer | Caps the agent's turn budget. Wired into `runConfig.max_turns` at runtime; when both are set, the top-level field wins. The legacy nested value is pruned from the on-disk file on save to avoid two sources of truth. |
|
|
289
|
+
| `color` | enum string | Display color. Allowlist: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan` (mirrors CC's `_Y`). The legacy qwen sentinel `auto` is preserved for backward compatibility. Other values are silently dropped on parse. |
|
|
290
|
+
| `mcpServers` | record of specs | Per-agent MCP server overrides. Merged with the session-level MCP server set when the agent spawns; on key collision the agent's spec wins (matching CC's `scope: 'agent'` semantics). Malformed entries are dropped per-key with a warning rather than failing the whole agent. |
|
|
291
|
+
| `hooks` | record of arrays | Per-agent hooks. Keys are CC hook event names (`PreToolUse`, `PostToolUse`, `UserPromptSubmit`, …); values are arrays of `{ matcher?, hooks: [...] }` definitions in the same shape as `settings.json`'s `hooks` field. Registered while the agent runs, removed when it stops. |
|
|
290
292
|
|
|
291
|
-
Example:
|
|
293
|
+
Example with all of the above:
|
|
292
294
|
|
|
293
295
|
```
|
|
294
296
|
---
|
|
@@ -301,6 +303,17 @@ tools:
|
|
|
301
303
|
- read_file
|
|
302
304
|
- grep_search
|
|
303
305
|
- glob
|
|
306
|
+
mcpServers:
|
|
307
|
+
filesystem:
|
|
308
|
+
type: stdio
|
|
309
|
+
command: node
|
|
310
|
+
args: [/usr/local/lib/mcp-fs/server.js]
|
|
311
|
+
hooks:
|
|
312
|
+
PreToolUse:
|
|
313
|
+
- matcher: Bash
|
|
314
|
+
hooks:
|
|
315
|
+
- type: command
|
|
316
|
+
command: echo "review-agent about to run a shell command"
|
|
304
317
|
---
|
|
305
318
|
|
|
306
319
|
You are a code reviewer. Analyze the code thoroughly and report findings
|
|
@@ -308,11 +321,19 @@ ordered by severity.
|
|
|
308
321
|
```
|
|
309
322
|
|
|
310
323
|
The remaining CC frontmatter fields — `effort`, `skills`, `initialPrompt`,
|
|
311
|
-
`memory`, `isolation
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
324
|
+
`memory`, `isolation` — are documented in the declarative-agent design doc
|
|
325
|
+
and land in follow-up PRs once the prerequisite infrastructure exists
|
|
326
|
+
(`effort` needs a model-layer parameter; `memory` needs a scoped memory
|
|
327
|
+
subsystem; `--agent` CLI flag enables `initialPrompt`; etc.).
|
|
328
|
+
|
|
329
|
+
> **`hooks` v1 limitation.** While a subagent declaring `hooks` is running,
|
|
330
|
+
> its hook entries fire for every matching event in the session, not only
|
|
331
|
+
> for that subagent's own tool calls. If two subagents with different
|
|
332
|
+
> per-agent hook sets run concurrently, both sets fire for both agents.
|
|
333
|
+
> Per-agent scope filtering at hook-firing time is left to a follow-up;
|
|
334
|
+
> for v1, prefer per-agent hooks that are safe to fire globally for the
|
|
335
|
+
> duration of the agent's run (e.g. logging) over hooks that mutate
|
|
336
|
+
> behavior.
|
|
316
337
|
|
|
317
338
|
#### Example Usage
|
|
318
339
|
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Local launch templates for `qwen serve` (v0.16-alpha)
|
|
2
|
+
|
|
3
|
+
Reference templates for running `qwen serve` as a long-lived background process on a developer workstation. Pairs with the [v0.16-alpha known limits](./qwen-serve.md#v016-alpha-known-limits) — local-only, single-user, BYO bearer token. Containerized / multi-host / TLS-fronted deployments defer to v0.16.x.
|
|
4
|
+
|
|
5
|
+
> **Audience**: dogfooding developers who want the daemon up across reboots, with logs going somewhere durable, and a clean `restart-on-failure` story. If you only need the daemon for the duration of a single shell session, plain `qwen serve` (foreground, Ctrl-C to stop) is fine.
|
|
6
|
+
|
|
7
|
+
## Generate a bearer token (once)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
openssl rand -hex 32 > ~/.qwen-serve-token # user-managed, NOT a built-in path
|
|
11
|
+
chmod 600 ~/.qwen-serve-token
|
|
12
|
+
export QWEN_SERVER_TOKEN="$(cat ~/.qwen-serve-token)"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The path / filename is yours to choose; v0.16-alpha does not auto-generate or auto-locate a token file (deferred to v0.16.x). See the [Authentication](./qwen-serve.md#authentication) section of the user guide for the canonical BYO setup.
|
|
16
|
+
|
|
17
|
+
> **Scope this `export` to the current shell session only.** Don't add it to `~/.bashrc` / `~/.zshrc` — a profile-level export exposes the bearer token to every process spawned from that shell (IDE subprocesses, browser debuggers, `npm` scripts from unrelated projects). For long-running setups, use the systemd `EnvironmentFile=` / launchd `EnvironmentVariables` mechanisms below — both scope the token to just the daemon process.
|
|
18
|
+
|
|
19
|
+
The daemon reads the bearer token from either `--token <value>` on the CLI or the `QWEN_SERVER_TOKEN` env var (whitespace stripped from both). The TypeScript SDK's `DaemonClient` constructor falls back to `QWEN_SERVER_TOKEN` when no `token` option is passed (PR 27 fallback — clients with the env var set never need to thread the value through their script).
|
|
20
|
+
|
|
21
|
+
One shell-level `export` covers both server boot and SDK client construction (just keep it scoped to the session, per the note above).
|
|
22
|
+
|
|
23
|
+
## Linux: systemd user unit
|
|
24
|
+
|
|
25
|
+
> **Find your `qwen` binary first.** The unit file's `ExecStart=` must hold an **absolute path** — service managers don't read your shell's `PATH`. Run `which qwen` to discover it. Common locations: `/usr/local/bin/qwen` (Linuxbrew, manual installs), `~/.nvm/versions/node/vX.Y.Z/bin/qwen` (nvm), `~/.fnm/aliases/default/bin/qwen` (fnm), `~/.volta/bin/qwen` (Volta). Substitute the actual path everywhere the templates below show `/PATH/TO/qwen`.
|
|
26
|
+
|
|
27
|
+
`~/.config/systemd/user/qwen-serve.service`:
|
|
28
|
+
|
|
29
|
+
```ini
|
|
30
|
+
[Unit]
|
|
31
|
+
Description=Qwen Code daemon (loopback HTTP + SSE)
|
|
32
|
+
After=network.target
|
|
33
|
+
|
|
34
|
+
[Service]
|
|
35
|
+
Type=simple
|
|
36
|
+
# Replace with your project; %h expands to $HOME under user units.
|
|
37
|
+
WorkingDirectory=%h/your-project
|
|
38
|
+
# Run `which qwen` to find the absolute path. systemd does NOT read $PATH.
|
|
39
|
+
ExecStart=/PATH/TO/qwen serve --hostname 127.0.0.1 --port 4170
|
|
40
|
+
# Read the bearer token from a chmod 600 file rather than inlining it
|
|
41
|
+
# in the unit. `Environment=` would expose the token in the unit file
|
|
42
|
+
# (typically 644 = world-readable). EnvironmentFile keeps the token in
|
|
43
|
+
# the user-owned secret file you already created with `chmod 600`.
|
|
44
|
+
EnvironmentFile=%h/.qwen-serve-token-env
|
|
45
|
+
Restart=on-failure
|
|
46
|
+
RestartSec=5
|
|
47
|
+
StandardOutput=journal
|
|
48
|
+
StandardError=journal
|
|
49
|
+
|
|
50
|
+
[Install]
|
|
51
|
+
WantedBy=default.target
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Build the env file once (the token file from the setup step holds the raw value; this wraps it in `KEY=value` form so systemd reads it as an env assignment):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
echo "QWEN_SERVER_TOKEN=$(cat ~/.qwen-serve-token)" > ~/.qwen-serve-token-env
|
|
58
|
+
chmod 600 ~/.qwen-serve-token-env
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Manage:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
systemctl --user daemon-reload
|
|
65
|
+
systemctl --user enable --now qwen-serve.service
|
|
66
|
+
loginctl enable-linger "$(whoami)" # keep the user manager running after logout / across reboot
|
|
67
|
+
journalctl --user -u qwen-serve -f # tail logs
|
|
68
|
+
systemctl --user restart qwen-serve.service # after token rotation
|
|
69
|
+
systemctl --user disable --now qwen-serve.service
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Without `loginctl enable-linger`, the user-level systemd instance shuts down when the user logs out and only restarts on next login — on a headless dev box the daemon would not survive an SSH session ending. `enable-linger` is what makes "across reboots" actually work.
|
|
73
|
+
|
|
74
|
+
**System-wide alternative** (shared dev hosts, less common): drop the unit at `/etc/systemd/system/qwen-serve@.service` with `User=%i`, manage via `sudo systemctl enable --now qwen-serve@<username>.service`. Same `[Service]` body otherwise — but world-readable `Environment=` exposure is even more problematic at this level, so always use `EnvironmentFile=` pointing at the user's `chmod 600` file. Pick user-level + linger for single-user workstations.
|
|
75
|
+
|
|
76
|
+
## macOS: launchd user agent
|
|
77
|
+
|
|
78
|
+
> **Find your `qwen` binary first.** Same constraint as systemd — `ProgramArguments` must hold an **absolute path**. Run `which qwen` to discover it. Common locations on macOS: `/opt/homebrew/bin/qwen` (Homebrew on Apple Silicon), `/usr/local/bin/qwen` (Homebrew on Intel, manual installs), `~/.nvm/versions/node/vX.Y.Z/bin/qwen` (nvm), `~/.volta/bin/qwen` (Volta). Substitute below where the template shows `/PATH/TO/qwen`.
|
|
79
|
+
|
|
80
|
+
`~/Library/LaunchAgents/com.qwenlm.qwen-serve.plist`:
|
|
81
|
+
|
|
82
|
+
```xml
|
|
83
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
84
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
85
|
+
<plist version="1.0">
|
|
86
|
+
<dict>
|
|
87
|
+
<key>Label</key>
|
|
88
|
+
<string>com.qwenlm.qwen-serve</string>
|
|
89
|
+
<key>ProgramArguments</key>
|
|
90
|
+
<array>
|
|
91
|
+
<!-- Run `which qwen` to find the absolute path; launchd does NOT read $PATH. -->
|
|
92
|
+
<string>/PATH/TO/qwen</string>
|
|
93
|
+
<string>serve</string>
|
|
94
|
+
<string>--hostname</string>
|
|
95
|
+
<string>127.0.0.1</string>
|
|
96
|
+
<string>--port</string>
|
|
97
|
+
<string>4170</string>
|
|
98
|
+
</array>
|
|
99
|
+
<!-- launchd does NOT expand `~` or `$HOME` — use absolute paths. -->
|
|
100
|
+
<key>WorkingDirectory</key>
|
|
101
|
+
<string>/Users/YOUR-USERNAME/your-project</string>
|
|
102
|
+
<key>EnvironmentVariables</key>
|
|
103
|
+
<dict>
|
|
104
|
+
<!-- DO NOT COMMIT this file with a real token. Also chmod 600 the
|
|
105
|
+
plist itself so the inlined token is not world-readable. -->
|
|
106
|
+
<key>QWEN_SERVER_TOKEN</key>
|
|
107
|
+
<string>PASTE-YOUR-TOKEN-HERE</string>
|
|
108
|
+
</dict>
|
|
109
|
+
<key>RunAtLoad</key>
|
|
110
|
+
<true/>
|
|
111
|
+
<!-- Restart only on non-zero exits (matches systemd Restart=on-failure).
|
|
112
|
+
A bare `<true/>` would respawn even after a clean SIGTERM, making
|
|
113
|
+
`kill <pid>` impossible to use as a stop signal — operator would
|
|
114
|
+
have to `launchctl unload`. SuccessfulExit=false fixes that. -->
|
|
115
|
+
<key>KeepAlive</key>
|
|
116
|
+
<dict>
|
|
117
|
+
<key>SuccessfulExit</key>
|
|
118
|
+
<false/>
|
|
119
|
+
</dict>
|
|
120
|
+
<!-- Throttle restart storms on persistent failures (mirrors systemd
|
|
121
|
+
RestartSec=5; launchd's default would respawn every <1s). -->
|
|
122
|
+
<key>ThrottleInterval</key>
|
|
123
|
+
<integer>10</integer>
|
|
124
|
+
<!-- Log into the user's Library, not /tmp. /tmp is world-writable
|
|
125
|
+
(symlink-attack risk on shared workstations) and gets cleaned by
|
|
126
|
+
periodic-daily after 3 days; `~/Library/Logs/qwen-serve/` is
|
|
127
|
+
user-scoped and survives. launchd truncates these on every
|
|
128
|
+
`load`, so the unload→load token-rotation cycle wipes prior
|
|
129
|
+
diagnostic logs — back them up if you need post-incident
|
|
130
|
+
inspection. -->
|
|
131
|
+
<key>StandardOutPath</key>
|
|
132
|
+
<string>/Users/YOUR-USERNAME/Library/Logs/qwen-serve/out.log</string>
|
|
133
|
+
<key>StandardErrorPath</key>
|
|
134
|
+
<string>/Users/YOUR-USERNAME/Library/Logs/qwen-serve/err.log</string>
|
|
135
|
+
</dict>
|
|
136
|
+
</plist>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Manage:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
mkdir -p ~/Library/Logs/qwen-serve # first time only
|
|
143
|
+
chmod 600 ~/Library/LaunchAgents/com.qwenlm.qwen-serve.plist # plist holds the inline token
|
|
144
|
+
launchctl load ~/Library/LaunchAgents/com.qwenlm.qwen-serve.plist
|
|
145
|
+
launchctl unload ~/Library/LaunchAgents/com.qwenlm.qwen-serve.plist # to stop
|
|
146
|
+
tail -f ~/Library/Logs/qwen-serve/out.log ~/Library/Logs/qwen-serve/err.log
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
After editing the plist (e.g., rotating the token) you must `unload` then `load` again — `launchctl` does not auto-reload on plist changes the way `systemd daemon-reload` does. Note: each `load` truncates the log files, so save them off if you're investigating an incident before rotating.
|
|
150
|
+
|
|
151
|
+
## tmux session (interactive supervision)
|
|
152
|
+
|
|
153
|
+
Assumes `QWEN_SERVER_TOKEN` is already exported in your shell (see the setup section above):
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
tmux new -d -s qwen-serve "cd ~/your-project && qwen serve --hostname 127.0.0.1"
|
|
157
|
+
tmux attach -t qwen-serve # see live logs; Ctrl-b d to detach
|
|
158
|
+
tmux kill-session -t qwen-serve
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`tmux new -d` inherits the parent shell's environment, so `QWEN_SERVER_TOKEN` flows through automatically. Best when you want to occasionally watch the daemon's stdout (auth warnings, MCP discovery progress, slow-client warnings) without committing to a service unit. Survives terminal close but not host reboot.
|
|
162
|
+
|
|
163
|
+
## nohup one-liner (quick + dirty)
|
|
164
|
+
|
|
165
|
+
Assumes `QWEN_SERVER_TOKEN` is already exported in your shell:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
nohup bash -c 'cd ~/your-project && qwen serve --hostname 127.0.0.1' > qwen-serve.log 2>&1 &
|
|
169
|
+
echo $! # daemon PID; capture if you want to `kill` cleanly later
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The wrapping `bash -c '...'` ensures the daemon binds to `~/your-project` rather than wherever you happened to run the command. Without that `cd`, `qwen serve` defaults to `process.cwd()` and a `POST /session` from a client expecting your project workspace returns `400 workspace_mismatch` — silent foot-gun.
|
|
173
|
+
|
|
174
|
+
OK for one-off "let me run this in the background while I poke at the API" workflows. **Not recommended** for anything beyond a single session — no restart-on-crash, log file grows unbounded, no clean way to find the daemon if you forget the PID. Prefer tmux for interactive supervision or systemd / launchd for anything you want to outlast a reboot.
|
|
175
|
+
|
|
176
|
+
## Verifying the daemon is up
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
curl http://127.0.0.1:4170/health # → {"status":"ok"}
|
|
180
|
+
curl -H "Authorization: Bearer $QWEN_SERVER_TOKEN" \
|
|
181
|
+
http://127.0.0.1:4170/capabilities | jq .protocolVersions # daemon's feature set
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
When auth is configured (i.e., the daemon was started with `--token` / `QWEN_SERVER_TOKEN` set, OR `--require-auth=true`), every route except `/health` on loopback binds requires `Authorization: Bearer <token>`. If you started the daemon without a token on the loopback default (the `qwen serve` zero-config path), neither call requires a header. The templates above all configure a token, so the `Authorization` header is needed in practice. If `/capabilities` returns `401`, the unit / plist token doesn't match the env-exported token your `curl` is using.
|
|
185
|
+
|
|
186
|
+
## Token rotation
|
|
187
|
+
|
|
188
|
+
1. Generate a new token + write the env file the unit references:
|
|
189
|
+
```bash
|
|
190
|
+
openssl rand -hex 32 > ~/.qwen-serve-token
|
|
191
|
+
chmod 600 ~/.qwen-serve-token
|
|
192
|
+
echo "QWEN_SERVER_TOKEN=$(cat ~/.qwen-serve-token)" > ~/.qwen-serve-token-env
|
|
193
|
+
chmod 600 ~/.qwen-serve-token-env
|
|
194
|
+
```
|
|
195
|
+
(For the launchd / nohup / tmux templates: edit the plist's `<string>` value or re-`export QWEN_SERVER_TOKEN`. Don't forget `chmod 600` on the plist if you regenerate it.)
|
|
196
|
+
2. Restart the daemon:
|
|
197
|
+
- **systemd**: `systemctl --user restart qwen-serve.service`
|
|
198
|
+
- **launchd**: `launchctl unload ~/Library/LaunchAgents/com.qwenlm.qwen-serve.plist && launchctl load ~/Library/LaunchAgents/com.qwenlm.qwen-serve.plist`
|
|
199
|
+
- **tmux / nohup**: `kill <pid>` then re-run with the new token in env
|
|
200
|
+
3. Update any client SDKs / scripts. The TypeScript SDK's `DaemonClient` reads `QWEN_SERVER_TOKEN` automatically (PR 27 fallback) — re-`export` the new value in any client shell and reconstruct the client.
|
|
201
|
+
|
|
202
|
+
## Restart and crash behavior
|
|
203
|
+
|
|
204
|
+
Service-manager restart semantics differ across the templates:
|
|
205
|
+
|
|
206
|
+
- **systemd `Restart=on-failure`** — restart only on non-zero exit / signal. A clean SIGTERM (`systemctl stop`) does **not** trigger a restart loop.
|
|
207
|
+
- **launchd `KeepAlive` with `SuccessfulExit=false`** (the template above) — matches systemd behavior. A bare `<true/>` would have respawned even after a clean exit. `ThrottleInterval=10` rate-limits restart storms on persistent failures, mirroring systemd's `RestartSec=5`.
|
|
208
|
+
- **tmux / nohup** — no automatic restart. A daemon crash leaves you with a dead PID until you re-run.
|
|
209
|
+
|
|
210
|
+
Within a **single daemon process lifetime**, client disconnects recover via SSE `Last-Event-ID` resume per the [Durability model](./qwen-serve.md#durability-model) section of the user guide — the replay ring is in-memory.
|
|
211
|
+
|
|
212
|
+
A daemon **restart** drops all in-memory sessions; clients reconnect and start fresh. Cross-restart durability of session content (prompts, tool calls, conversation history) is **NOT** in v0.16-alpha.
|
|
213
|
+
|
|
214
|
+
## Out of scope (defers to v0.16.x or later)
|
|
215
|
+
|
|
216
|
+
- **Containerized deployment** — Dockerfile, docker-compose, Kubernetes manifests, nginx + TLS reverse proxy, multi-instance token isolation. Defers to v0.16.x once an enterprise pilot is committed; the doc would otherwise rot from no-one-validating.
|
|
217
|
+
- **Cross-host federation / multi-daemon coordination on one host** — `1 daemon = 1 workspace × N sessions` is enforced. Instance-path token keying + stale-token cleanup defer to v0.16.x.
|
|
218
|
+
- **Auto-generated daemon tokens** — alpha is BYO-token. Auto-gen + token-store infrastructure defers to v0.16.x.
|
|
219
|
+
- **Windows native service** (`nssm`, Service Control Manager wrapper) — for now use [WSL2](https://learn.microsoft.com/en-us/windows/wsl/) and follow the systemd section above.
|
|
220
|
+
|
|
221
|
+
See the [v0.16-alpha known limits](./qwen-serve.md#v016-alpha-known-limits) callout in the main user guide for the full deferred-features list, and [#4175](https://github.com/QwenLM/qwen-code/issues/4175) for the v0.16-alpha rollout tracking issue.
|