@tomflow/chatloop-extension 0.3.34 → 0.3.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ Run: chatloop-extension extension <command> --help
30
30
  {"projectId":"new-distinct-test","prompt":"新的独立任务","confirmed":true,"replaceBlockedSessionId":"11111111-1111-4111-a111-111111111111"}
31
31
  ```
32
32
 
33
- `PAGE_ERROR` 且无原生 Retry 时,Worker 仅观察最多四次;只有原用户消息 ID 未变且连续两次证明错误消失才继续观察,其余情况依旧 BLOCKED。**不能把当前网页错误消失当成原消息未发送的证据**。
33
+ `PAGE_ERROR` 且无原生 Retry 时,Worker 仅观察最多四次;只有原用户消息 ID 未变且连续两次证明错误消失才继续观察;若回查时已经识别到同一 Turn 的可靠完成事件或已发出完成事件,则让已排队的完成回执自然结项,避免 4 秒回查窗口错误覆盖 DONE。其余情况依旧 BLOCKED。**不能把当前网页错误消失当成原消息未发送的证据**。
34
34
 
35
35
  Clean 只清空输入框,不发送,不更改 Owner;必须指定精确标签页 ID 且验证目标。Chrome 已安装扩展不随 npm 包自动安装。本地源码与已发布 npm 版本可能不同,真实结果请看 [CURRENT](../../context/CURRENT.md)。
36
36
 
@@ -333,7 +333,15 @@ async function onTurnBlocked(message, sender) {
333
333
  const sameTurn = proof?.contract === "chat-loop.turn-observer.v1"
334
334
  && proof.page === previous.page
335
335
  && proof.userKey === previous.newUserKey;
336
- if (sameTurn && ["RUNNING", "UNKNOWN", "IDLE"].includes(proof.status)) {
336
+ // The Observer may emit its verified completion while this error handler
337
+ // owns the serialized Worker queue. That completion message is waiting
338
+ // behind us: fail-closing here would discard a real, finished Turn.
339
+ // TURN_FINISHED or the exact already-emitted state is sufficient proof
340
+ // that the SAME user Turn recovered; do not invent/send another message.
341
+ if (sameTurn && (proof.status === "TURN_FINISHED"
342
+ || proof.status === "IDLE" && proof.reason === "TURN_ALREADY_EMITTED"))
343
+ return {status: "IGNORED", code: "PAGE_ERROR_COMPLETION_QUEUED"};
344
+ if (sameTurn && ["RUNNING", "UNKNOWN"].includes(proof.status)) {
337
345
  recovered++;
338
346
  if (recovered === 2) return {status: "IGNORED", code: "PAGE_ERROR_CLEARED_SAME_TURN"};
339
347
  } else recovered = 0;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.3.34",
4
+ "version": "0.3.35",
5
5
  "description": "Chat Loop browser companion: Eye actions, Turn observer, Continue and Handoff Actions",
6
6
  "permissions": [
7
7
  "activeTab",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/chatloop-extension",
3
- "version": "0.3.34",
3
+ "version": "0.3.35",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension package: nine formal Action pages and its own native CLI bridge",
6
6
  "bin": {