@chen_hu_hu/pi-qq 1.6.0 → 1.6.1

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/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.6.1] - 2026-11-11
11
+
12
+ ### Changed
13
+
14
+ - Settings are loaded when the extension starts and re-read on every inbound QQ message from the bound user, so edits to `pi-qq.json` take effect on the next message without restarting pi or logging in again. Config errors are reported once per distinct text.
15
+
16
+ ### Removed
17
+
18
+ - Removed the `thinkingRelay` setting. `replyType: "full"` now always relays thinking, while `simple` and `last` never do. Existing `thinkingRelay` keys are ignored.
19
+
10
20
  ## [1.6.0] - 2026-11-09
11
21
 
12
22
  ### Added
@@ -17,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
27
  ### Changed
18
28
 
19
29
  - In `last` mode, `/last` during a running task now replies that the task is still running instead of repushing partial output.
20
- - Consolidated the v6 design and delivery record into `doc/archive/delivery-v6.md`; removed the working document.
30
+ - Consolidated the v6 design and delivery record into `doc/archive/delivery.1.6.0.md`; removed the working document.
21
31
 
22
32
  ### Fixed
23
33
 
@@ -39,7 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
49
 
40
50
  ### Changed
41
51
 
42
- - Consolidated the v5 research, feature, and implementation plan into `doc/archive/delivery-v5.md`; removed the three working documents.
52
+ - Consolidated the v5 research, feature, and implementation plan into `doc/archive/delivery.1.5.0.md`; removed the three working documents.
43
53
 
44
54
  ### Fixed
45
55
 
@@ -71,7 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
71
81
  ### Changed
72
82
 
73
83
  - Tool bubbles now use `## <icon> <name>`, show `bash` commands in a `bash` code block without truncation, and choose result code-block languages from `read` file extensions (for example `markdown`, `python`, `json`).
74
- - Consolidated the v4 design and investigation records into `doc/archive/delivery-v4.md` and `doc/archive/delivery-v4-zh.md`.
84
+ - Consolidated the v4 design and investigation records into `doc/archive/delivery.1.4.0.md` and `doc/archive/delivery-v4-zh.md`.
75
85
 
76
86
  ## [1.3.6] - 2026-11-04
77
87
 
@@ -151,7 +161,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
151
161
  - Added thinking labels, per-tool icons, model-error recovery, and idle-safe session handling.
152
162
  - Reorganized modules by bounded context and updated settings and delivery documentation.
153
163
 
154
- [Unreleased]: https://github.com/CQ-Developer/pi-qq/compare/v1.5.0...HEAD
164
+ [Unreleased]: https://github.com/CQ-Developer/pi-qq/compare/v1.6.1...HEAD
165
+ [1.6.1]: https://github.com/CQ-Developer/pi-qq/compare/v1.6.0...v1.6.1
166
+ [1.6.0]: https://github.com/CQ-Developer/pi-qq/compare/v1.5.1...v1.6.0
167
+ [1.5.1]: https://github.com/CQ-Developer/pi-qq/compare/v1.5.0...v1.5.1
155
168
  [1.5.0]: https://github.com/CQ-Developer/pi-qq/compare/v1.4.2...v1.5.0
156
169
  [1.4.2]: https://github.com/CQ-Developer/pi-qq/compare/v1.4.1...v1.4.2
157
170
  [1.4.1]: https://github.com/CQ-Developer/pi-qq/compare/v1.4.0...v1.4.1
package/README-zh.md CHANGED
@@ -35,7 +35,7 @@ pi --extension /path/to/pi-qq
35
35
  给机器人发送 QQ 私聊消息即可开始任务。
36
36
 
37
37
  - **文字**:普通聊天消息。
38
- - **语音**:直接使用 QQ 内置 ASR 文本;音频不会下载或保存。如果 ASR 没有返回文本,机器人会提示你重发或改用文字。
38
+ - **语音**:QQ 内置 ASR 转写文本(`asr_refer_text`)会作为普通用户文本交给 pi;音频不会下载或保存,也不会使用外部语音识别服务。如果 ASR 没有返回文本,机器人会提示你重发或改用文字。通常语音和文字是两条独立的 QQ 消息,需要时按顺序发送。
39
39
  - **图片和文件**:保存到 `.pi/pi-qq/<sessionId>/uploads/`。如果消息中没有指令,pi 会等待你的下一条文字或语音消息。
40
40
 
41
41
  QQ 客户端对混合消息的支持不同。手机 QQ 通常一次只发一种类型,桌面版 QQ 可以发送“文字 + 图片”。当客户端把文字/语音和附件放在同一条消息里时,pi-qq 会把它们合并到同一个提示词中处理。
@@ -50,6 +50,7 @@ QQ 客户端对混合消息的支持不同。手机 QQ 通常一次只发一种
50
50
  - 图片通过 pi 的 `read` 工具查看,因此当前模型必须支持图片输入才能看到内容。
51
51
  - `/new` 会清空等待指令的附件。
52
52
  - 附件按当前 pi 会话隔离。相同文件名且内容相同会复用已有文件;相同文件名但内容不同会保存为 `name-1.ext`;不同文件名但内容相同会分别保存。
53
+ - 如有需要,请把 `.pi/` 加入你自己的项目 `.gitignore`。
53
54
 
54
55
  pi 看到的提示词示例:
55
56
 
@@ -74,25 +75,16 @@ Summarize this file.
74
75
  - 每条媒体消息消耗一次被动回复;超过限制后自动降级为主动消息。
75
76
  - 工具气泡与其它工具一致:`## 📤 qq_send_media`。
76
77
 
77
- ### 语音消息
78
-
79
- 语音消息使用 QQ 内置 ASR(`asr_refer_text`)。转写文本会作为普通用户文本交给 pi;pi 不会收到音频文件。
80
-
81
- - 语音附件不会下载或保存为 `.amr` / `.silk`。
82
- - 不使用本地或外部语音识别服务。
83
- - 如果 QQ ASR 没有返回文本,机器人会回复 `Could not transcribe this voice message; please resend or type it.`,并且不会启动 pi。
84
- - 语音和文字是两条独立的 QQ 消息;需要时按顺序发送。
85
- - 如果客户端允许语音消息同时携带文件或图片,它们会与转写文本一起处理。
86
-
87
- 将 `logLevel` 设为 `debug` 时,日志会包含原始 `asr_refer_text` 和附件元数据。
88
-
89
78
  ### 回复格式
90
79
 
91
- - **思考**:独立气泡,纯文本,首行 `## 💭 思考`。长思考可能续到新气泡,并重复标题。
80
+ `replyType: "full"` 模式下,QQ 会收到这些块类型:
81
+
82
+ - **思考**:独立气泡,纯文本,首行是本地化的 `## 💭 <标签>`(`Thinking` 或 `思考`)。长思考可能续到新气泡,并重复标题。
92
83
  - **工具**:每次调用独立气泡,首行 `## <图标> <工具名>`;`bash` 命令使用 `bash` 代码块,其他参数使用行内代码;结果按工具/文件类型使用 `text`、`markdown`、`python`、`json` 等代码块。
93
84
  - **普通消息**:原文,不加标题。
94
85
  - **工具图标**:💻 bash、📖 read、📝 write、✏️ edit、🔎 grep、🔍 search、🗂️ find、📁 ls、📋 list、🌐 web、📡 fetch、🗑️ delete、❌ remove、✅ todo、🧪 test;未配置工具使用 🔧。
95
- - **错误恢复**:模型错误后 60 秒内自动恢复的 run 会继续推送到原 QQ 会话;`/stop` 会等待当前工具和流收尾后再回复。
86
+
87
+ 模型错误后 60 秒内自动恢复的 run 会继续推送到原 QQ 会话;`/stop` 会等待当前工具和流收尾后再回复。
96
88
 
97
89
  ## 命令
98
90
 
@@ -126,15 +118,12 @@ QQ 侧命令:
126
118
  | `/qq-test-md [text]` | 发送 Markdown 测试消息 |
127
119
  | `/qq-test-stream` | 运行流式时间线诊断(`resume` 验证续写) |
128
120
 
129
- 将 `logLevel` 设为 `debug` 时,只有在登录后由 QQ 消息触发的 run 期间才会写入 agent/message/tool 日志;本地 run、登录流程和空闲时段不写日志。`scope: "media"` 记录媒体工具在这些 run 中的关键步骤,QQ relay 日志也只在 QQ 触发的 run 中出现。
130
-
131
121
  ## 设置
132
122
 
133
123
  创建 `~/.pi/agent/pi-qq.json` 覆盖默认值。该文件只保存设置;凭据不会写入其中。
134
124
 
135
125
  ```json
136
126
  {
137
- "thinkingRelay": true,
138
127
  "replyType": "full",
139
128
  "deliverAs": "steer",
140
129
  "fileMaxSize": 52428800,
@@ -143,16 +132,15 @@ QQ 侧命令:
143
132
  }
144
133
  ```
145
134
 
146
- | 配置项 | 默认值 | 说明 |
147
- | --------------- | ---------- | ------------------------------------------------------ |
148
- | `thinkingRelay` | `true` | 以本地化的 `## 💭` 标题纯文本回传思考;`false` 时隐藏 |
149
- | `replyType` | `"full"` | 推送到 QQ 的内容粒度:`full`、`simple`、`last` |
150
- | `deliverAs` | `"steer"` | 忙碌时新消息的排队方式:`steer` 或 `followUp` |
151
- | `fileMaxSize` | `52428800` | QQ 附件下载上限(字节,50MB) |
152
- | `language` | `"zh-cn"` | UI 和日志语言:`zh-cn` 或 `en-us` |
153
- | `logLevel` | `"silent"` | 日志阈值:`silent`、`error`、`warn`、`info` 或 `debug` |
135
+ | 配置项 | 默认值 | 说明 |
136
+ | ------------- | ---------- | ------------------------------------------------------ |
137
+ | `replyType` | `"full"` | 推送到 QQ 的内容粒度:`full`、`simple`、`last` |
138
+ | `deliverAs` | `"steer"` | 忙碌时新消息的排队方式:`steer` 或 `followUp` |
139
+ | `fileMaxSize` | `52428800` | QQ 附件下载上限(字节,50MB) |
140
+ | `language` | `"zh-cn"` | UI 和日志语言:`zh-cn` 或 `en-us` |
141
+ | `logLevel` | `"silent"` | 日志阈值:`silent`、`error`、`warn`、`info` 或 `debug` |
154
142
 
155
- 配置在 pi 会话启动时读取;修改文件后请重启 pi。未知配置项会被忽略,无效值会回退到默认值并给出提示。
143
+ 配置在扩展加载时读取,并在每条来自已绑定用户的 QQ 消息处理前重新读取。修改后下一条消息即生效,无需重启 pi 或重新登录。未知配置项会被忽略,无效值会回退到默认值并给出提示。
156
144
 
157
145
  ### `replyType`
158
146
 
@@ -164,20 +152,12 @@ QQ 侧命令:
164
152
  | `simple` | 只推 assistant 消息,每条一个气泡 |
165
153
  | `last` | 只推 run 中最后一条 assistant 消息,在 run 结束时送出 |
166
154
 
167
- - `full` 是默认值,保持 pi-qq 1.5.x 的行为,也是唯一会应用 `thinkingRelay` 的模式。
155
+ - `full` 是默认值,保持 pi-qq 1.5.x 的行为;该模式固定回传思考。
168
156
  - `simple` 会实时流出每一条 assistant 消息,一条消息一个气泡。
169
157
  - `last` 在任务运行期间不推送任何内容;运行期间执行 `/last` 会回复“任务仍在进行中”。
170
158
  - 无论哪种模式,模型错误消息都会立即以普通消息发出。
171
159
  - `simple` 与 `last` 不回传工具输出,但 `qq_send_media` 发送的文件仍然会送达。
172
160
 
173
- ### `thinkingRelay`
174
-
175
- 是否把模型的思考单独回传成一个气泡。
176
-
177
- - `true`(默认):以本地化的 `## 💭` 标题纯文本回传思考。
178
- - `false`:丢弃思考。
179
- - 只在 `replyType: "full"` 下生效;`simple` 与 `last` 不会回传思考。
180
-
181
161
  ### `deliverAs`
182
162
 
183
163
  任务正在运行时,QQ 消息如何进入 pi。
@@ -198,7 +178,7 @@ UI 提示与日志的语言。
198
178
 
199
179
  ### `logLevel`
200
180
 
201
- 日志阈值。只有 QQ 触发的 run 处于活动状态时才会写记录,路径为 `<cwd>/.pi/pi-qq/logs/pi-qq-YYYY-MM-DD.log`;可用 `PI_QQ_LOG_DIR` 覆盖目录。
181
+ 日志阈值。只有登录后 QQ 触发的 run 处于活动状态时才会写记录,路径为 `<cwd>/.pi/pi-qq/logs/pi-qq-YYYY-MM-DD.log`;可用 `PI_QQ_LOG_DIR` 覆盖目录。`scope: "media"` 记录媒体工具在这些 run 中的步骤。
202
182
 
203
183
  - `silent`(默认):完全不写日志文件。
204
184
  - `error`:只记录失败。
@@ -230,8 +210,6 @@ npm run format:check
230
210
 
231
211
  - 仅支持 C2C(QQ 私聊)。
232
212
  - QQ 入站消息触发的任务会回传 QQ;直接在 pi 中启动的无关任务不会推送。
233
- - 图片会保存为文件,并通过 pi 的 `read` 工具查看;当前模型必须支持图片输入才能看到内容。
234
- - 保存的附件位于工作区 `.pi/` 下;如有需要,请把 `.pi/` 加入你自己的项目 `.gitignore`。
235
213
  - QQ 对每条入站消息的被动回复次数有限制。可用 `/qq-test-budget` 查看本地额度。
236
214
  - 读取 `SKILL.md` 时,QQ 显示 `## 🧩 技能` 和 skill 名称,不转发文件内容。
237
215
 
package/README.md CHANGED
@@ -35,7 +35,7 @@ Credentials are not written to `pi-qq.json`. Restarting pi requires scanning aga
35
35
  Send a private message to the bot to start a task.
36
36
 
37
37
  - **Text**: normal chat message.
38
- - **Voice**: QQ's built-in ASR text is sent to pi. The audio is not downloaded or saved. If ASR returns no text, the bot asks you to resend or type it.
38
+ - **Voice**: QQ's built-in ASR transcript (`asr_refer_text`) is sent to pi as normal user text. The audio is not downloaded or saved, and no external speech-to-text service is used. If ASR returns no text, the bot asks you to resend or type it. Voice and text are normally separate QQ messages; send them in sequence when needed.
39
39
  - **Images and files**: saved under `.pi/pi-qq/<sessionId>/uploads/`. If the message has no instruction, pi waits for your next text or voice message.
40
40
 
41
41
  QQ clients differ in mixed-message support. Mobile QQ usually sends one message type at a time; desktop QQ can send text with an image. When a client includes text or voice together with attachments, pi-qq processes them in the same prompt.
@@ -50,6 +50,7 @@ An attachment-only message does **not** start pi. Files and images are saved, an
50
50
  - Images are read through pi's `read` tool, so the current model must support image input to see them.
51
51
  - `/new` clears attachments waiting for an instruction.
52
52
  - Uploads are scoped to the current pi session. Same filename and identical content reuse the existing file; same filename with different content becomes `name-1.ext`; different filenames with identical content are kept separately.
53
+ - Add `.pi/` to your project `.gitignore` if needed.
53
54
 
54
55
  Example prompt seen by pi:
55
56
 
@@ -74,25 +75,16 @@ Ask pi explicitly, for example `send me the screenshot` or `把截图发给我`.
74
75
  - Each media message consumes one passive reply; after the limit, pi-qq falls back to a proactive message.
75
76
  - The tool bubble is the same as any other tool: `## 📤 qq_send_media`.
76
77
 
77
- ### Voice messages
78
-
79
- Voice messages use QQ's built-in ASR (`asr_refer_text`). The transcript is sent to pi as normal user text; pi never receives the audio file.
80
-
81
- - The voice attachment is not downloaded or saved as `.amr` / `.silk`.
82
- - No local or external speech-to-text service is used.
83
- - If QQ ASR returns no text, the bot replies `Could not transcribe this voice message; please resend or type it.` and does not start a pi run.
84
- - Voice and text are separate QQ messages; send them one after another when needed.
85
- - If a client sends files or images together with a voice message, they are processed with the transcript.
86
-
87
- Debug logs include the raw `asr_refer_text` and attachment metadata when `logLevel` is set to `debug`.
88
-
89
78
  ### Reply format
90
79
 
91
- - **Thinking**: its own bubble, plain text, starting with `## 💭 思考`. Long thinking may continue in a new bubble with the header repeated.
80
+ In `replyType: "full"` mode, QQ receives these block types:
81
+
82
+ - **Thinking**: its own bubble, plain text, starting with a localized `## 💭 <label>` heading (`Thinking` or `思考`). Long thinking may continue in a new bubble with the header repeated.
92
83
  - **Tools**: one bubble per call: `## <icon> <name>`; `bash` commands use a `bash` code block, other arguments use inline code, and results use `text`, `markdown`, `python`, `json`, etc. depending on the tool and file type.
93
84
  - **Regular messages**: raw text with no header.
94
85
  - **Tool icons**: 💻 bash, 📖 read, 📝 write, ✏️ edit, 🔎 grep, 🔍 search, 🗂️ find, 📁 ls, 📋 list, 🌐 web, 📡 fetch, 🗑️ delete, ❌ remove, ✅ todo, 🧪 test; unconfigured tools use 🔧.
95
- - **Error recovery**: after a model error, automatic retry runs within 60 seconds keep pushing to the original QQ chat. `/stop` waits for active tools and streams to finish before replying.
86
+
87
+ After a model error, automatic retries within 60 seconds keep pushing to the original QQ chat. `/stop` waits for active tools and streams to finish before replying.
96
88
 
97
89
  ## Commands
98
90
 
@@ -126,15 +118,12 @@ These terminal commands are intended for troubleshooting:
126
118
  | `/qq-test-md [text]` | Send a Markdown test message |
127
119
  | `/qq-test-stream` | Run a streamed timeline diagnostic (`resume` for probe) |
128
120
 
129
- With `logLevel: "debug"`, logs are written only while a QQ-triggered run is active after login; local runs, login, and idle periods are not logged. `scope: "media"` covers media-tool steps during those runs, and QQ relay logs only appear for QQ-triggered runs.
130
-
131
121
  ## Settings
132
122
 
133
123
  Create `~/.pi/agent/pi-qq.json` to override defaults. It stores settings only; credentials are never written to it.
134
124
 
135
125
  ```json
136
126
  {
137
- "thinkingRelay": true,
138
127
  "replyType": "full",
139
128
  "deliverAs": "steer",
140
129
  "fileMaxSize": 52428800,
@@ -143,16 +132,15 @@ Create `~/.pi/agent/pi-qq.json` to override defaults. It stores settings only; c
143
132
  }
144
133
  ```
145
134
 
146
- | Key | Default | Description |
147
- | --------------- | ---------- | ------------------------------------------------------------ |
148
- | `thinkingRelay` | `true` | Relay thinking as plain text with a localized `## 💭` header |
149
- | `replyType` | `"full"` | How much of a run is pushed to QQ: `full`, `simple`, `last` |
150
- | `deliverAs` | `"steer"` | Queue new messages while busy: `steer` or `followUp` |
151
- | `fileMaxSize` | `52428800` | QQ attachment download limit in bytes (50MB) |
152
- | `language` | `"zh-cn"` | UI and log language: `zh-cn` or `en-us` |
153
- | `logLevel` | `"silent"` | Log threshold: `silent`, `error`, `warn`, `info`, or `debug` |
135
+ | Key | Default | Description |
136
+ | ------------- | ---------- | ------------------------------------------------------------ |
137
+ | `replyType` | `"full"` | How much of a run is pushed to QQ: `full`, `simple`, `last` |
138
+ | `deliverAs` | `"steer"` | Queue new messages while busy: `steer` or `followUp` |
139
+ | `fileMaxSize` | `52428800` | QQ attachment download limit in bytes (50MB) |
140
+ | `language` | `"zh-cn"` | UI and log language: `zh-cn` or `en-us` |
141
+ | `logLevel` | `"silent"` | Log threshold: `silent`, `error`, `warn`, `info`, or `debug` |
154
142
 
155
- Settings are read when a pi session starts; restart pi after editing the file. Unknown keys are ignored, and invalid values fall back to defaults with a warning.
143
+ Settings are loaded when the extension starts and re-read on every inbound QQ message from the bound user, so edits take effect on the next message without restarting pi or logging in again. Unknown keys are ignored, and invalid values fall back to defaults with a warning.
156
144
 
157
145
  ### `replyType`
158
146
 
@@ -164,20 +152,12 @@ How much of an agent run is pushed to QQ.
164
152
  | `simple` | Assistant messages only, one bubble each |
165
153
  | `last` | Only the last assistant message of the run, sent when the run ends |
166
154
 
167
- - `full` is the default and keeps the behaviour of pi-qq 1.5.x; it is the only mode where `thinkingRelay` applies.
155
+ - `full` is the default and keeps the behaviour of pi-qq 1.5.x; thinking is always relayed in this mode.
168
156
  - `simple` streams every assistant message live, one QQ bubble per message.
169
157
  - `last` sends nothing while the task is running; `/last` during a running task replies that the task is still running.
170
158
  - Model errors are always delivered immediately as a normal message, in every mode.
171
159
  - Tool output is not relayed in `simple` or `last`, but files sent with `qq_send_media` are still delivered.
172
160
 
173
- ### `thinkingRelay`
174
-
175
- Whether the model's thinking is relayed to QQ as its own bubble.
176
-
177
- - `true` (default): thinking is relayed as plain text under a localized `## 💭` heading.
178
- - `false`: thinking is dropped.
179
- - Only applies to `replyType: "full"`; `simple` and `last` never relay thinking.
180
-
181
161
  ### `deliverAs`
182
162
 
183
163
  How a QQ message reaches pi while a task is already running.
@@ -198,7 +178,7 @@ Language of the UI notifications and the log messages.
198
178
 
199
179
  ### `logLevel`
200
180
 
201
- Log threshold. Records are written only while a QQ-triggered run is active, to `<cwd>/.pi/pi-qq/logs/pi-qq-YYYY-MM-DD.log`; `PI_QQ_LOG_DIR` overrides the directory.
181
+ Log threshold. Records are written only while a QQ-triggered run is active after login, to `<cwd>/.pi/pi-qq/logs/pi-qq-YYYY-MM-DD.log`; `PI_QQ_LOG_DIR` overrides the directory. `scope: "media"` covers media-tool steps during those runs.
202
182
 
203
183
  - `silent` (default): no log file at all.
204
184
  - `error`: failures only.
@@ -230,8 +210,6 @@ The extension entrypoint is `index.ts`. Source modules are grouped by responsibi
230
210
 
231
211
  - Only C2C (QQ private chat) is supported.
232
212
  - Runs triggered by inbound QQ messages are relayed to QQ. Unrelated tasks started directly in pi stay local.
233
- - Images are saved as files and read through pi's `read` tool; the current model must support image input to see them.
234
- - Saved attachments are workspace-local under `.pi/`; add `.pi/` to your own project `.gitignore` if needed.
235
213
  - QQ limits passive replies per inbound message. Use `/qq-test-budget` to inspect the local budget.
236
214
  - Reading a `SKILL.md` is shown as a `## 🧩 Skill` block with the skill name; the file content is not forwarded to QQ.
237
215
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Archived record.** Content reflects the delivery at that time and may reference removed modules or settings. See [README](../../README.md) for current behavior.
4
4
  > Status: v1 delivered; this is a historical baseline for later versions.
5
- > Later versions: [delivery-v2.md](./delivery-v2.md), [delivery-v3.md](./delivery-v3.md).
5
+ > Later versions: [delivery.1.2.0.md](./delivery.1.2.0.md), [delivery.1.3.0.md](./delivery.1.3.0.md).
6
6
 
7
7
  ## 1. Scope
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Archived record.** Content reflects the delivery at that time and may reference removed modules or settings. See [README](../../README.md) for current behavior.
4
4
  > Status: v2 delivered; this is a historical record.
5
- > Previous: [delivery-v1.md](./delivery-v1.md); next: [delivery-v3.md](./delivery-v3.md).
5
+ > Previous: [delivery.1.0.0.md](./delivery.1.0.0.md); next: [delivery.1.3.0.md](./delivery.1.3.0.md).
6
6
 
7
7
  ## 1. Scope
8
8
 
@@ -3,7 +3,7 @@
3
3
  > **Archived record.** Content reflects the delivery at that time and may reference removed modules or settings. See [README](../../README.md) for current behavior.
4
4
  > Status: v3 implemented and the main path has been verified on real QQ.
5
5
  > Note: later changes removed the image-specific pipeline; images now use the same save/pending path as files.
6
- > Previous: [delivery-v1.md](./delivery-v1.md), [delivery-v2.md](./delivery-v2.md).
6
+ > Previous: [delivery.1.0.0.md](./delivery.1.0.0.md), [delivery.1.2.0.md](./delivery.1.2.0.md).
7
7
 
8
8
  ## 1. Scope
9
9
 
@@ -4,7 +4,7 @@
4
4
  > Status: v4 delivered. Tool block types were verified on real QQ; long-running tool handling and offline delivery remain open items.
5
5
  > Version: 1.4.0
6
6
  > Date: 2026-11-04
7
- > Previous: [delivery-v1.md](./delivery-v1.md), [delivery-v2.md](./delivery-v2.md), [delivery-v3.md](./delivery-v3.md).
7
+ > Previous: [delivery.1.0.0.md](./delivery.1.0.0.md), [delivery.1.2.0.md](./delivery.1.2.0.md), [delivery.1.3.0.md](./delivery.1.3.0.md).
8
8
  > Open work: [doc/todo.md](../todo.md).
9
9
 
10
10
  ## 1. Scope
@@ -3,7 +3,7 @@
3
3
  > **Delivery record.** v5 adds outbound media delivery and fixes debug log coverage for non-QQ runs. See [README](../../README.md) for current user-facing behavior.
4
4
  > Version: 1.5.0
5
5
  > Date: 2026-11-05
6
- > Previous: [delivery-v1.md](./delivery-v1.md), [delivery-v2.md](./delivery-v2.md), [delivery-v3.md](./delivery-v3.md), [delivery-v4.md](./delivery-v4.md).
6
+ > Previous: [delivery.1.0.0.md](./delivery.1.0.0.md), [delivery.1.2.0.md](./delivery.1.2.0.md), [delivery.1.3.0.md](./delivery.1.3.0.md), [delivery.1.4.0.md](./delivery.1.4.0.md).
7
7
  > Supersedes: `doc/research.md`, `doc/feature.md`, and `doc/plan.md`; those working documents were consolidated into this record and removed.
8
8
  > Open work: [doc/todo.md](../todo.md).
9
9
 
@@ -211,7 +211,7 @@ The v5 acceptance log does not cover the two long-running bash scenarios; they r
211
211
 
212
212
  ## 12. References
213
213
 
214
- - Design history: [delivery-v4.md](./delivery-v4.md).
214
+ - Design history: [delivery.1.4.0.md](./delivery.1.4.0.md).
215
215
  - User-facing behavior: [README.md](../../README.md), [README-zh.md](../../README-zh.md).
216
216
  - QQ SDK: `@tencent-connect/qqbot-nodejs` 1.0.5, `src/QQBot.ts`, `src/protocol/api/media.ts`.
217
217
  - pi extension API: `pi/packages/coding-agent/docs/extensions.md`.
@@ -3,7 +3,7 @@
3
3
  > **Delivery record.** v6 adds the `replyType` setting to control how much of an agent run is pushed to QQ, and fixes the 12k bubble split that almost never fired. See [README](../../README.md) for current user-facing behavior.
4
4
  > Version: 1.6.0
5
5
  > Date: 2026-11-09
6
- > Previous: [delivery-v1.md](./delivery-v1.md), [delivery-v2.md](./delivery-v2.md), [delivery-v3.md](./delivery-v3.md), [delivery-v4.md](./delivery-v4.md), [delivery-v5.md](./delivery-v5.md).
6
+ > Previous: [delivery.1.0.0.md](./delivery.1.0.0.md), [delivery.1.2.0.md](./delivery.1.2.0.md), [delivery.1.3.0.md](./delivery.1.3.0.md), [delivery.1.4.0.md](./delivery.1.4.0.md), [delivery.1.5.0.md](./delivery.1.5.0.md).
7
7
  > Open work: [doc/todo.md](../todo.md).
8
8
 
9
9
  ## 1. Scope
@@ -256,8 +256,8 @@ Not covered by the acceptance run:
256
256
 
257
257
  ## 10. References
258
258
 
259
- - Design history: [delivery-v5.md](./delivery-v5.md).
259
+ - Design history: [delivery.1.5.0.md](./delivery.1.5.0.md).
260
260
  - User-facing behavior: [README.md](../../README.md), [README-zh.md](../../README-zh.md).
261
- - Earlier split design: [delivery-v3.md](./delivery-v3.md) §3 (12k split, repeated header).
261
+ - Earlier split design: [delivery.1.3.0.md](./delivery.1.3.0.md) §3 (12k split, repeated header).
262
262
  - pi extension API: `pi/packages/coding-agent/docs/extensions.md` (`message_update`, `message_end`, `agent_end`).
263
263
  - QQ SDK: `@tencent-connect/qqbot-nodejs` 1.0.5, `src/protocol/api/messages.ts` (`sendC2CStreamMessage`).
@@ -0,0 +1,150 @@
1
+ # pi-qq delivery 1.6.1
2
+
3
+ > **Delivery record.** 1.6.1 reloads `pi-qq.json` before every inbound QQ message and removes the redundant `thinkingRelay` setting. See [README](../../README.md) for current user-facing behavior.
4
+ > Version: 1.6.1
5
+ > Date: 2026-11-11
6
+ > Previous: [delivery.1.6.0.md](./delivery.1.6.0.md).
7
+ > Open work: [doc/todo.md](../todo.md).
8
+
9
+ ## 1. Scope
10
+
11
+ Before 1.6.1, `~/.pi/agent/pi-qq.json` was read when the extension loaded, on `session_start`, and on `/qq-login`. Editing the file while the bot was running required a restart or a new login.
12
+
13
+ 1.6.1 changes the trigger points and removes one setting:
14
+
15
+ - reload configuration before handling every inbound QQ message from the bound user;
16
+ - keep one initialization read at extension load for static command descriptions and early i18n;
17
+ - remove the `session_start` and `/qq-login` reads;
18
+ - remove `thinkingRelay`; `replyType` becomes the only output-mode control.
19
+
20
+ In scope:
21
+
22
+ - a single `applyConfig()` path for reading and applying the file;
23
+ - per-message reload in `createInboundHandler()`;
24
+ - logger setup when the bot starts and on each reload;
25
+ - initial config errors reported at `session_start`;
26
+ - deduplication of repeated QQ-message config errors;
27
+ - removal of `thinkingRelay` from settings, relay code, i18n, tests, and READMEs.
28
+
29
+ Out of scope:
30
+
31
+ - file watching or reloading configuration without a new QQ message;
32
+ - restarting the QQ bot or re-running QR login on a config change;
33
+ - changing `replyType` modes or their relay policies;
34
+ - migrating local (non-QQ) runs to a new reload trigger.
35
+
36
+ ## 2. Final decisions
37
+
38
+ | # | Question | Decision |
39
+ | --- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | D1 | When is the config file read? | At extension load and before every inbound QQ message from the bound user. |
41
+ | D2 | Why keep the extension-load read? | Command descriptions and other static UI strings are registered before `session_start`, so `language` must be applied there. |
42
+ | D3 | Should `session_start` or `/qq-login` read the file again? | No. They reuse the latest initialized or reloaded values; `session_start` only reports the error captured at extension load. |
43
+ | D4 | Should a reload restart the bot? | No. It replaces in-memory settings, i18n, and logger configuration only. Credentials and the QQ connection stay intact. |
44
+ | D5 | What happens with an invalid file? | Valid fields are kept, invalid fields and parse failures fall back to defaults, and an error is reported. Identical QQ-message errors are reported once. |
45
+ | D6 | Should `thinkingRelay` stay? | No. `replyType: "full"` always relays thinking; `simple` and `last` never do. Existing `thinkingRelay` keys are ignored. |
46
+
47
+ ## 3. Trigger points
48
+
49
+ | Event | Before 1.6.1 | 1.6.1 |
50
+ | ---------------------- | -------------------------- | --------------------------------------------------------------- |
51
+ | Extension load | Read | Read (initialization) |
52
+ | `session_start` | Read | No read; uses initialized values and reports the captured error |
53
+ | `/qq-login` | Read | No read; uses current values |
54
+ | Inbound QQ message | No read | Read and apply (reload) |
55
+ | When edits take effect | After restart or new login | On the next QQ message |
56
+
57
+ ```text
58
+ QQ message
59
+ -> qqbot filtering, access policy, concurrency guard
60
+ -> createInboundHandler
61
+ -> bound-user check
62
+ -> reloadSettings()
63
+ readConfig()
64
+ getSettings()
65
+ configureI18n()
66
+ configureLogger()
67
+ -> command or normal message handling
68
+ -> markQQTrigger() / sendUserMessage()
69
+ ```
70
+
71
+ The reload runs before attachment downloads, message injection, and replies, so the current message already uses the new `fileMaxSize`, `deliverAs`, `language`, `logLevel`, and `replyType`.
72
+
73
+ Local runs started directly in pi use the latest initialized or reloaded values. Pi reloads extensions for `new`, `resume`, and `fork`, so those flows run the initialization read again.
74
+
75
+ ## 4. Settings
76
+
77
+ | Key | Effect after reload |
78
+ | ------------- | -------------------------------------------------------------------------- |
79
+ | `fileMaxSize` | Applied to attachments in the current inbound message |
80
+ | `deliverAs` | Applied when the current message is injected into pi |
81
+ | `language` | Applied to subsequent notifications, replies, and log text |
82
+ | `logLevel` | Applied to subsequent log writes; the QQ-run log gate is unchanged |
83
+ | `replyType` | Applied to subsequent relay decisions, including a run already in progress |
84
+
85
+ A run that is already executing without a new QQ message keeps the previous values.
86
+
87
+ ### 4.1 Logging
88
+
89
+ - The extension-load read has no session `cwd`, so it does not configure logging.
90
+ - `startWithCredentials()` configures the log path and level from `activeSettings` when the bot starts.
91
+ - A QQ-message reload applies the latest `logLevel` immediately.
92
+ - Logs are still written only while a QQ-triggered run is active after login.
93
+
94
+ ### 4.2 Invalid configuration
95
+
96
+ - Missing file: all defaults, no error.
97
+ - Invalid JSON root or parse failure: defaults, with an error.
98
+ - Invalid individual fields: valid fields are kept, invalid fields are ignored, with an error.
99
+ - The error captured at extension load is shown once at `session_start`.
100
+ - QQ-message reloads report new errors; identical error text is deduplicated until the config is fixed.
101
+ - `/qq-login` does not re-read the file, so it does not produce a new parse-error notification.
102
+
103
+ ## 5. `thinkingRelay` removal
104
+
105
+ `thinkingRelay` was a sub-option of `replyType: "full"`. Removing it leaves `replyType` as the only output-mode control:
106
+
107
+ - `full` relays thinking as before.
108
+ - `simple` and `last` never relay thinking.
109
+
110
+ Existing `"thinkingRelay": false` entries are ignored; they no longer suppress thinking in `full` mode. Users who want no thinking must choose `simple` or `last`, which also disable tool output. A "tools but no thinking" combination would require a new `replyType` mode and is not part of 1.6.1.
111
+
112
+ ## 6. Implementation
113
+
114
+ | File | Change |
115
+ | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
+ | `index.ts` | Single `applyConfig()`; error deduplication; initial error captured for `session_start`; `startWithCredentials()` configures logging; removed `getThinkingRelay`; removed `session_start` and `/qq-login` reads |
117
+ | `src/qq/qq-message-handler.ts` | Added `InboundDeps.reloadSettings` and call it after the bound-user check |
118
+ | `src/infra/settings.ts` | Removed `thinkingRelay` parsing, validation, and defaulting |
119
+ | `src/relay/run-stream-relay.ts` | Thinking relay now depends only on the `replyType` policy |
120
+ | `src/infra/i18n.ts` | Removed the `settings.thinkingRelay` error text |
121
+ | `test/index.test.ts` | Per-message reload, changed `deliverAs`, initial error display, and error deduplication |
122
+ | `test/qq/qq-message-handler.test.ts` | Reload happens before settings are read |
123
+ | `test/infra/settings.test.ts` | Removed `thinkingRelay` expectations; legacy key is ignored |
124
+ | `test/relay/run-stream-relay.test.ts` | Removed the `thinkingRelay` harness option and test |
125
+
126
+ ## 7. Verification
127
+
128
+ - **226 tests passed** across 19 files.
129
+ - `npm run typecheck`, `npm run lint`, `npm run format:check`, and `npm pack --dry-run` passed.
130
+ - The test suite covers:
131
+ - a config read before every handled QQ message;
132
+ - a `deliverAs` change between two messages taking effect on the second;
133
+ - `session_start` reporting the initialization error without another read;
134
+ - identical QQ-message config errors being reported once;
135
+ - the legacy `thinkingRelay` key being ignored.
136
+
137
+ ## 8. Risks and limitations
138
+
139
+ | Risk | Impact | Handling |
140
+ | ----------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
141
+ | Configuration is not watched | An edit without a new QQ message is not applied to a running task | Reload is intentionally tied to the next QQ message |
142
+ | `/qq-login` and local status use startup values | A mid-session edit is not reflected there until the next QQ message | Accepted; QQ conversations use the fresh values |
143
+ | `thinkingRelay` removal | `"thinkingRelay": false` users now receive thinking in `full` mode | Documented in the CHANGELOG and READMEs; choose `simple` or `last` to suppress thinking |
144
+ | Config errors are deduplicated | Repeating the same invalid config does not pop a new warning | The error is shown once at load and once per distinct text during message reloads |
145
+
146
+ ## 9. References
147
+
148
+ - User-facing behavior: [README.md](../../README.md), [README-zh.md](../../README-zh.md).
149
+ - Previous delivery: [delivery.1.6.0.md](./delivery.1.6.0.md).
150
+ - This record replaces the temporary configuration-timing note; that note was removed with the release.
package/doc/todo.md CHANGED
@@ -88,7 +88,7 @@
88
88
  > 记录日期:2026-11-04
89
89
  > 分析日期:2026-11-06
90
90
  > 相关版本:pi-qq 1.4.0
91
- > 详细调研:`doc/archive/delivery-v4.md`
91
+ > 详细调研:`doc/archive/delivery.1.4.0.md`
92
92
 
93
93
  ### 现象
94
94
 
@@ -206,7 +206,7 @@ QQ 侧的 `/last` 已可用于手动恢复:
206
206
  - 本次日志未复现失败;不要据此实施错误分类、预算或自动重绑修复。
207
207
  - 继续等待一次真正的多分钟单命令日志(最好 >5 分钟,并覆盖 >1 小时的 `msg_id` 生命周期);复现时按上面的“复现时仍需采集/分析”执行。
208
208
  - 如果目标只是改善长工具期间的体感:优先实现长工具心跳和 `tool_execution_update` 转发,这不依赖失败复现。
209
- - 如果后续日志确认 `msg_id` 过期/被动次数超限:再按 `doc/archive/delivery-v4.md` 的“Long-running tools”建议实现错误分类和预算修复。
209
+ - 如果后续日志确认 `msg_id` 过期/被动次数超限:再按 `doc/archive/delivery.1.4.0.md` 的“Long-running tools”建议实现错误分类和预算修复。
210
210
  - 如果 `/stop` 的 `wait done` 缺失或 `waitedMs` 很大:实现非阻塞 `/stop`。
211
211
  - `/last` 目前作为手动兜底可用,保持现状,不急于自动重绑。
212
212
  - 修复后补测试,更新 `doc/todo.md` / `CHANGELOG.md`,再发布版本。
package/index.ts CHANGED
@@ -40,11 +40,11 @@ let stateDetail: string | undefined;
40
40
  let sessionCtx: ExtensionContext | undefined;
41
41
  let mediaTool: MediaToolController | undefined;
42
42
  let activeSettings: ResolvedSettings = getSettings({});
43
+ let lastConfigError: string | undefined;
43
44
  const budget = new ReplyBudget();
44
45
  const runFeedback = new RunFeedback({
45
46
  bot: () => running?.bot,
46
47
  budget,
47
- getThinkingRelay: () => activeSettings.thinkingRelay,
48
48
  getReplyType: () => activeSettings.replyType,
49
49
  onWarn: (msg) => sessionCtx?.ui.notify(`pi-qq ${msg}`, "warning"),
50
50
  onFallbackReply: (text) => {
@@ -114,6 +114,29 @@ function stopEventLoopMonitor(): void {
114
114
  export default function (pi: ExtensionAPI) {
115
115
  setLogGate(() => Boolean(getLoginState()) && runFeedback.isQQRunActive());
116
116
 
117
+ const notifyConfigError = (ctx: ExtensionContext, error: string | undefined, dedupe: boolean) => {
118
+ if (!error) {
119
+ lastConfigError = undefined;
120
+ return;
121
+ }
122
+ if (dedupe && error === lastConfigError) return;
123
+ lastConfigError = error;
124
+ ctx.ui.notify(`pi-qq ${error}`, "error");
125
+ };
126
+
127
+ const applyConfig = (ctx?: ExtensionContext, options: { dedupeError?: boolean } = {}) => {
128
+ const { config, error } = readConfig();
129
+ activeSettings = getSettings(config);
130
+ configureI18n(activeSettings.language);
131
+ if (ctx) {
132
+ configureLogger(activeSettings.logLevel, join(ctx.cwd, ".pi", "pi-qq", "logs"));
133
+ notifyConfigError(ctx, error, options.dedupeError ?? false);
134
+ }
135
+ return { settings: activeSettings, error };
136
+ };
137
+
138
+ let pendingConfigError = applyConfig().error;
139
+
117
140
  mediaTool = registerMediaTool(pi, {
118
141
  getBot: () => running?.bot,
119
142
  getLogin: () => getLoginState(),
@@ -121,23 +144,12 @@ export default function (pi: ExtensionAPI) {
121
144
  onWarn: (msg) => sessionCtx?.ui.notify(`pi-qq ${msg}`, "warning"),
122
145
  });
123
146
 
124
- activeSettings = getSettings(readConfig().config);
125
- configureI18n(activeSettings.language);
126
-
127
147
  const getAllowedOpenid = () => getLoginState()?.allowedOpenid;
128
148
  const getDeliverAs = () => activeSettings.deliverAs;
129
149
  const getReplyType = () => activeSettings.replyType;
130
150
 
131
151
  const onWarn = (ctx: ExtensionContext) => (msg: string) => ctx.ui.notify(`pi-qq ${msg}`, "warning");
132
152
 
133
- const applyConfig = (ctx: ExtensionContext) => {
134
- const { config, error } = readConfig();
135
- activeSettings = getSettings(config);
136
- configureI18n(activeSettings.language);
137
- if (error) ctx.ui.notify(`pi-qq ${error}`, "error");
138
- return { settings: activeSettings, error };
139
- };
140
-
141
153
  const getStatusLines = (ctx: ExtensionContext | undefined = sessionCtx): string[] => {
142
154
  const login = getLoginState();
143
155
  const usage = ctx?.getContextUsage();
@@ -200,6 +212,7 @@ export default function (pi: ExtensionAPI) {
200
212
  ctx,
201
213
  budget,
202
214
  getAllowedOpenid,
215
+ reloadSettings: () => applyConfig(ctx, { dedupeError: true }),
203
216
  getDeliverAs,
204
217
  getReplyType,
205
218
  getFileMaxSize: () => activeSettings.fileMaxSize,
@@ -223,8 +236,10 @@ export default function (pi: ExtensionAPI) {
223
236
  };
224
237
 
225
238
  pi.on("session_start", async (_event, ctx) => {
226
- const { settings, error } = applyConfig(ctx);
227
- configureLogger(settings.logLevel, join(ctx.cwd, ".pi", "pi-qq", "logs"));
239
+ const settings = activeSettings;
240
+ const configError = pendingConfigError;
241
+ pendingConfigError = undefined;
242
+ notifyConfigError(ctx, configError, false);
228
243
 
229
244
  const login = getLoginState();
230
245
  log.info("session", "started", {
@@ -234,7 +249,7 @@ export default function (pi: ExtensionAPI) {
234
249
  logLevel: settings.logLevel,
235
250
  replyType: settings.replyType,
236
251
  login: login ? { appId: login.credentials.appId, allowedOpenid: login.allowedOpenid } : null,
237
- configError: error ?? null,
252
+ configError: configError ?? null,
238
253
  });
239
254
  if (login) {
240
255
  await startWithCredentials(ctx, login.credentials, login.allowedOpenid);
@@ -422,7 +437,6 @@ export default function (pi: ExtensionAPI) {
422
437
  pi.registerCommand("qq-login", {
423
438
  description: t("commands.descQqLogin"),
424
439
  handler: async (_args, ctx) => {
425
- applyConfig(ctx);
426
440
  stopIfRunning();
427
441
  setLoginState(undefined);
428
442
  let result: QrLoginResult | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chen_hu_hu/pi-qq",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Connect pi to QQ private chats.",
5
5
  "license": "MIT",
6
6
  "author": "CQ-Developer",
package/src/infra/i18n.ts CHANGED
@@ -166,7 +166,6 @@ const enUS = {
166
166
  "settings.invalidRoot": "Invalid config file ({path}): expected a JSON object; using defaults.",
167
167
  "settings.invalidFields": "Invalid config file ({path}): {errors}; invalid values were ignored.",
168
168
  "settings.parseFailed": "Failed to parse config file ({path}): {message}",
169
- "settings.thinkingRelay": "thinkingRelay must be a boolean",
170
169
  "settings.deliverAs": 'deliverAs must be "steer" or "followUp"',
171
170
  "settings.replyType": 'replyType must be "full", "simple", or "last"',
172
171
  "settings.fileMaxSize": "fileMaxSize must be a positive finite number",
@@ -399,7 +398,6 @@ const zhCN: Record<TranslationKey, string> = {
399
398
  "settings.invalidRoot": "配置文件无效({path}):应为 JSON 对象;使用默认值。",
400
399
  "settings.invalidFields": "配置文件无效({path}):{errors};无效值已忽略。",
401
400
  "settings.parseFailed": "解析配置文件失败({path}):{message}",
402
- "settings.thinkingRelay": "thinkingRelay 必须是布尔值",
403
401
  "settings.deliverAs": 'deliverAs 必须是 "steer" 或 "followUp"',
404
402
  "settings.replyType": 'replyType 必须是 "full"、"simple" 或 "last"',
405
403
  "settings.fileMaxSize": "fileMaxSize 必须是正有限数",
@@ -6,7 +6,6 @@ import { DEFAULT_LANGUAGE, getLanguage, isLanguage, translate, type Language } f
6
6
  import { DEFAULT_REPLY_TYPE, isReplyType, type ReplyType } from "./reply-type";
7
7
 
8
8
  export interface PiQQSettings {
9
- thinkingRelay?: boolean;
10
9
  deliverAs?: "steer" | "followUp";
11
10
  replyType?: ReplyType;
12
11
  fileMaxSize?: number;
@@ -55,10 +54,6 @@ export function parseConfig(raw: unknown): ReadConfigResult {
55
54
  if (isLanguage(raw.language)) config.language = raw.language;
56
55
  else errors.push(translate(language, "settings.language"));
57
56
  }
58
- if (raw.thinkingRelay !== undefined) {
59
- if (typeof raw.thinkingRelay === "boolean") config.thinkingRelay = raw.thinkingRelay;
60
- else errors.push(translate(language, "settings.thinkingRelay"));
61
- }
62
57
  if (raw.deliverAs !== undefined) {
63
58
  if (raw.deliverAs === "steer" || raw.deliverAs === "followUp") config.deliverAs = raw.deliverAs;
64
59
  else errors.push(translate(language, "settings.deliverAs"));
@@ -116,7 +111,6 @@ export type ResolvedSettings = Required<Omit<PiQQSettings, "debug">>;
116
111
  export function getSettings(config: PiQQSettings): ResolvedSettings {
117
112
  const logLevel = normalizeLogLevel(config.logLevel ?? (config.debug ? "debug" : undefined));
118
113
  return {
119
- thinkingRelay: config.thinkingRelay ?? true,
120
114
  deliverAs: config.deliverAs ?? "steer",
121
115
  replyType: config.replyType ?? DEFAULT_REPLY_TYPE,
122
116
  fileMaxSize: config.fileMaxSize ?? 50 * 1024 * 1024,
@@ -17,6 +17,7 @@ import { PendingAttachments, resolveInboundContent } from "./inbound-attachments
17
17
  export interface InboundDeps extends InboundCommandDeps {
18
18
  budget: ReplyBudget;
19
19
  getAllowedOpenid: () => string | undefined;
20
+ reloadSettings: () => void;
20
21
  getDeliverAs: () => "steer" | "followUp";
21
22
  getReplyType: () => ReplyType;
22
23
  getFileMaxSize: () => number;
@@ -60,6 +61,7 @@ export function createInboundHandler(deps: InboundDeps) {
60
61
  return;
61
62
  }
62
63
 
64
+ deps.reloadSettings();
63
65
  deps.budget.observeInbound(msg.senderId, msg.messageId);
64
66
  log.info("inbound", "message received", {
65
67
  messageId: msg.messageId,
@@ -9,7 +9,6 @@ import { detectSkillRead } from "./stream-block-format";
9
9
  export interface RunFeedbackDeps {
10
10
  bot: () => QQBot | undefined;
11
11
  budget: ReplyBudget;
12
- getThinkingRelay: () => boolean;
13
12
  getReplyType: () => ReplyType;
14
13
  onWarn: (msg: string) => void;
15
14
  onFallbackReply?: (text: string) => void;
@@ -272,7 +271,7 @@ export class RunFeedback {
272
271
  if (snapshotThinking.length > run.thinkingSentLen) {
273
272
  const thinkingDelta = snapshotThinking.slice(run.thinkingSentLen);
274
273
  run.thinkingSentLen = snapshotThinking.length;
275
- if (policy.relayThinking && this.deps.getThinkingRelay()) {
274
+ if (policy.relayThinking) {
276
275
  if (this.hasPendingTools(run)) {
277
276
  run.deferredThinking += thinkingDelta;
278
277
  } else {