@qwen-code/qwen-code 0.14.4 → 0.14.5-nightly.20260417.12b24e2d2

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.
@@ -0,0 +1,166 @@
1
+ # Memory
2
+
3
+ Every Qwen Code session starts with a fresh context window. Two mechanisms carry knowledge across sessions so you don't have to re-explain yourself every time:
4
+
5
+ - **QWEN.md** — instructions *you* write once and Qwen reads every session
6
+ - **Auto-memory** — notes Qwen writes itself based on what it learns from you
7
+
8
+ ---
9
+
10
+ ## QWEN.md: your instructions to Qwen
11
+
12
+ QWEN.md is a plain text file where you write things Qwen should always know about your project or your preferences. Think of it as a permanent briefing that loads at the start of every conversation.
13
+
14
+ ### What to put in QWEN.md
15
+
16
+ Add things you'd otherwise have to repeat every session:
17
+
18
+ - Build and test commands (`npm run test`, `make build`)
19
+ - Coding conventions your team follows ("all new files must have JSDoc comments")
20
+ - Architectural decisions ("we use the repository pattern, never call the database directly from controllers")
21
+ - Personal preferences ("always use pnpm, not npm")
22
+
23
+ Don't include things Qwen can figure out by reading your code. QWEN.md works best when it's short and specific — the longer it gets, the less reliably Qwen follows it.
24
+
25
+ ### Where to create QWEN.md
26
+
27
+ | File | Who it applies to |
28
+ |---|---|
29
+ | `~/.qwen/QWEN.md` | You, across all your projects |
30
+ | `QWEN.md` in the project root | Your whole team (commit it to source control) |
31
+
32
+ You can have both. Qwen loads all QWEN.md files it finds when you start a session — your personal one plus any in the project.
33
+
34
+ If your repository already has an `AGENTS.md` file for other AI tools, Qwen reads that too. No need to duplicate instructions.
35
+
36
+ ### Generate one automatically with `/init`
37
+
38
+ Run `/init` and Qwen will analyze your codebase to create a starter QWEN.md with build commands, test instructions, and conventions it finds. If one already exists, it suggests additions instead of overwriting.
39
+
40
+ ### Reference other files
41
+
42
+ You can point QWEN.md at other files so Qwen reads them too:
43
+
44
+ ```markdown
45
+ See @README.md for project overview.
46
+
47
+ # Conventions
48
+ - Git workflow: @docs/git-workflow.md
49
+ ```
50
+
51
+ Use `@path/to/file` anywhere in QWEN.md. Relative paths resolve from the QWEN.md file itself.
52
+
53
+ ---
54
+
55
+ ## Auto-memory: what Qwen learns about you
56
+
57
+ Auto-memory runs in the background. After each of your conversations, Qwen quietly saves useful things it learned — your preferences, feedback you gave, project context — so it can use them in future sessions without you repeating yourself.
58
+
59
+ This is different from QWEN.md: you don't write it, Qwen does.
60
+
61
+ ### What Qwen saves
62
+
63
+ Qwen looks for four kinds of things worth remembering:
64
+
65
+ | What | Examples |
66
+ |---|---|
67
+ | **About you** | Your role, background, how you like to work |
68
+ | **Your feedback** | Corrections you made, approaches you confirmed |
69
+ | **Project context** | Ongoing work, decisions, goals not obvious from the code |
70
+ | **External references** | Dashboards, ticket trackers, docs links you mentioned |
71
+
72
+ Qwen doesn't save everything — only things that would actually be useful next time.
73
+
74
+ ### Where it's stored
75
+
76
+ Auto-memory files live at `~/.qwen/projects/<project>/memory/`. All branches and worktrees of the same repository share the same memory folder, so what Qwen learns in one branch is available in others.
77
+
78
+ Everything saved is plain markdown — you can open, edit, or delete any file at any time.
79
+
80
+ ### Periodic cleanup
81
+
82
+ Qwen periodically goes through its saved memories to remove duplicates and clean up outdated entries. This runs automatically in the background once a day after enough sessions have accumulated. You can trigger it manually with `/dream` if you want it to run now.
83
+
84
+ While cleanup is running, **✦ dreaming** appears in the corner of the screen. Your session continues normally.
85
+
86
+ ### Turning it on or off
87
+
88
+ Auto-memory is on by default. To toggle it, open `/memory` and use the switches at the top. You can turn off just the automatic saving, just the periodic cleanup, or both.
89
+
90
+ You can also set them in `~/.qwen/settings.json` (applies to all projects) or `.qwen/settings.json` (this project only):
91
+
92
+ ```json
93
+ {
94
+ "memory": {
95
+ "enableManagedAutoMemory": true,
96
+ "enableManagedAutoDream": true
97
+ }
98
+ }
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Commands
104
+
105
+ ### `/memory`
106
+
107
+ Opens the Memory panel. From here you can:
108
+
109
+ - Turn auto-memory saving on or off
110
+ - Turn periodic cleanup (dream) on or off
111
+ - Open your personal QWEN.md (`~/.qwen/QWEN.md`)
112
+ - Open the project QWEN.md
113
+ - Browse the auto-memory folder
114
+
115
+ ### `/init`
116
+
117
+ Generates a starter QWEN.md for your project. Qwen reads your codebase and fills in build commands, test instructions, and conventions it discovers.
118
+
119
+ ### `/remember <text>`
120
+
121
+ Immediately saves something to auto-memory without waiting for Qwen to pick it up automatically:
122
+
123
+ ```
124
+ /remember always use snake_case for Python variable names
125
+ /remember the staging environment is at staging.example.com
126
+ ```
127
+
128
+ ### `/forget <text>`
129
+
130
+ Removes auto-memory entries that match your description:
131
+
132
+ ```
133
+ /forget old workaround for the login bug
134
+ ```
135
+
136
+ ### `/dream`
137
+
138
+ Runs the memory cleanup now instead of waiting for the automatic schedule:
139
+
140
+ ```
141
+ /dream
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Troubleshooting
147
+
148
+ ### Qwen isn't following my QWEN.md
149
+
150
+ Open `/memory` to see which files are loaded. If your file isn't listed, Qwen can't see it — make sure it's in the project root or `~/.qwen/`.
151
+
152
+ Instructions work better when they're specific:
153
+ - ✓ `Use 2-space indentation for TypeScript files`
154
+ - ✗ `Format code nicely`
155
+
156
+ If you have multiple QWEN.md files with conflicting instructions, Qwen may behave inconsistently. Review them and remove any contradictions.
157
+
158
+ ### I want to see what Qwen has saved
159
+
160
+ Run `/memory` and select **Open auto-memory folder**. All saved memories are readable markdown files you can browse, edit, or delete.
161
+
162
+ ### Qwen keeps forgetting things
163
+
164
+ If auto-memory is on but Qwen doesn't seem to remember things across sessions, try running `/dream` to force a cleanup pass. Also check `/memory` to confirm both toggles are enabled.
165
+
166
+ For things you always want Qwen to remember, add them to QWEN.md instead — auto-memory is best-effort, QWEN.md is guaranteed.
@@ -12,10 +12,46 @@ Subagents are independent AI assistants that:
12
12
  - **Work autonomously** - Once given a task, they work independently until completion or failure
13
13
  - **Provide detailed feedback** - You can see their progress, tool usage, and execution statistics in real-time
14
14
 
15
+ ## Fork Subagent (Implicit Fork)
16
+
17
+ In addition to named subagents, Qwen Code supports **implicit forking** — when the AI omits the `subagent_type` parameter, it triggers a fork that inherits the parent's full conversation context.
18
+
19
+ ### How Fork Differs from Named Subagents
20
+
21
+ | | Named Subagent | Fork Subagent |
22
+ | ------------- | --------------------------------- | ----------------------------------------------------- |
23
+ | Context | Starts fresh, no parent history | Inherits parent's full conversation history |
24
+ | System prompt | Uses its own configured prompt | Uses parent's exact system prompt (for cache sharing) |
25
+ | Execution | Blocks the parent until done | Runs in background, parent continues immediately |
26
+ | Use case | Specialized tasks (testing, docs) | Parallel tasks that need the current context |
27
+
28
+ ### When Fork is Used
29
+
30
+ The AI automatically uses fork when it needs to:
31
+
32
+ - Run multiple research tasks in parallel (e.g., "investigate module A, B, and C")
33
+ - Perform background work while continuing the main conversation
34
+ - Delegate tasks that require understanding of the current conversation context
35
+
36
+ ### Prompt Cache Sharing
37
+
38
+ All forks share the parent's exact API request prefix (system prompt, tools, conversation history), enabling DashScope prompt cache hits. When 3 forks run in parallel, the shared prefix is cached once and reused — saving 80%+ token costs compared to independent subagents.
39
+
40
+ ### Recursive Fork Prevention
41
+
42
+ Fork children cannot create further forks. This is enforced at runtime — if a fork attempts to spawn another fork, it receives an error instructing it to execute tasks directly.
43
+
44
+ ### Current Limitations
45
+
46
+ - **No result feedback**: Fork results are reflected in the UI progress display but are not automatically fed back into the main conversation. The parent AI sees a placeholder message and cannot act on the fork's output.
47
+ - **No worktree isolation**: Forks share the parent's working directory. Concurrent file modifications from multiple forks may conflict.
48
+
15
49
  ## Key Benefits
16
50
 
17
51
  - **Task Specialization**: Create agents optimized for specific workflows (testing, documentation, refactoring, etc.)
18
52
  - **Context Isolation**: Keep specialized work separate from your main conversation
53
+ - **Context Inheritance**: Fork subagents inherit the full conversation for context-heavy parallel tasks
54
+ - **Prompt Cache Sharing**: Fork subagents share the parent's cache prefix, reducing token costs
19
55
  - **Reusability**: Save and reuse agent configurations across projects and sessions
20
56
  - **Controlled Access**: Limit which tools each agent can use for security and focus
21
57
  - **Progress Visibility**: Monitor agent execution with real-time progress updates
@@ -23,7 +59,7 @@ Subagents are independent AI assistants that:
23
59
  ## How Subagents Work
24
60
 
25
61
  1. **Configuration**: You create Subagents configurations that define their behavior, tools, and system prompts
26
- 2. **Delegation**: The main AI can automatically delegate tasks to appropriate Subagents
62
+ 2. **Delegation**: The main AI can automatically delegate tasks to appropriate Subagents — or implicitly fork when no specific subagent type is needed
27
63
  3. **Execution**: Subagents work independently, using their configured tools to complete tasks
28
64
  4. **Results**: They return results and execution summaries back to the main conversation
29
65
 
@@ -6,7 +6,7 @@ Qwen Code is an open-source AI coding assistant tool maintained by the Qwen Code
6
6
 
7
7
  Qwen Code supports three authentication methods to access AI models. Your authentication method determines which terms of service and privacy policies apply to your usage:
8
8
 
9
- 1. **Qwen OAuth** — Log in with your qwen.ai account (free daily quota, ending 2026-04-15)
9
+ 1. **Qwen OAuth** — Log in with your qwen.ai account (free tier discontinued 2026-04-15)
10
10
  2. **Alibaba Cloud Coding Plan** — Use an API key from Alibaba Cloud
11
11
  3. **API Key** — Bring your own API key
12
12