opencode-acp 1.14.10 → 1.14.12

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
@@ -492,6 +492,24 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
492
492
 
493
493
  ## Changelog
494
494
 
495
+ ### v1.14.12 — Stable Release (1 PR since v1.14.11)
496
+
497
+ Stable release with the omo-system-reminder filter fix that preserves user content when stripping `<system-reminder>` blocks.
498
+
499
+ **PRs included**:
500
+ - **#271** — Fix (follow-up to #268): `omo-system-reminder` filter v1.2.0 returned `{ action: "drop" }` for ANY user message containing `<system-reminder>`, losing user text when OMO prepends system-reminder blocks to user messages. Rewrote to v1.3.0: strips `<system-reminder>` blocks + OMO markers, preserves remaining user content via `modify`. Pure OMO messages still return `drop`. Phase 2 `keepLastOnly` now applies the filter's actual decision (drop or modify) to older matches instead of unconditional drop. Recent N matches kept fully untouched (semantically correct). Backward compatible with other 3 `keepLastOnly` filters (they only return `drop`). Dual-agent reviewed (Oracle + Explore, both APPROVE).
501
+
502
+ **Install**: `opencode plugin opencode-acp@stable --global`
503
+
504
+ ### v1.14.11 — Stable Release (1 PR since v1.14.10)
505
+
506
+ Stable release with the omo-system-reminder filter fix and configurable `keepLast`.
507
+
508
+ **PRs included**:
509
+ - **#268** — Fix (issue #267): `omo-system-reminder` filter was stripping ALL `<system-reminder>` blocks from messages, deleting background task notifications and preventing the main session from recovering subagent results. Rewrote to v1.2.0: `keepLastOnly: true, keepLast: 2` — keeps the 2 most recent matches, drops older duplicates. Also adds framework-level configurable `keepLast` field so users can override how many recent matches to keep per `keepLastOnly` filter (default 1, clamped to minimum 1).
510
+
511
+ **Install**: `opencode plugin opencode-acp@stable --global`
512
+
495
513
  ### v1.14.10 — Stable Release (1 PR since v1.14.9)
496
514
 
497
515
  Stable release with the omo-mode-injection filter fix.
package/README.zh-CN.md CHANGED
@@ -446,6 +446,24 @@ ACP 是 DCP 的直接替代品。迁移步骤:
446
446
 
447
447
  ## 更新日志
448
448
 
449
+ ### v1.14.12 — 正式版(v1.14.11 以来 1 个 PR)
450
+
451
+ 正式版发布,包含 omo-system-reminder 过滤器修复——剥离 `<system-reminder>` 块时保留用户正文。
452
+
453
+ **包含的 PR**:
454
+ - **#271** — 修复(#268 后续):`omo-system-reminder` 过滤器 v1.2.0 对任何含 `<system-reminder>` 的用户消息直接返回 `drop`,当 OMO 将 system-reminder 块注入到用户消息前面时丢失用户正文。改为 v1.3.0:剥离 `<system-reminder>` 块 + OMO 标记,保留剩余用户内容(`modify`)。纯 OMO 消息仍返回 `drop`。Phase 2 `keepLastOnly` 现在对较旧的匹配应用过滤器实际决策(drop 或 modify),不再无条件丢弃。最近 N 条保持不动(语义正确)。与其他 3 个 `keepLastOnly` 过滤器向后兼容(它们只返回 `drop`)。双 Agent Review(Oracle + Explore,全部 APPROVE)。
455
+
456
+ **安装**:`opencode plugin opencode-acp@stable --global`
457
+
458
+ ### v1.14.11 — 正式版(v1.14.10 以来 1 个 PR)
459
+
460
+ 正式版发布,包含 omo-system-reminder 过滤器修复和可配置 `keepLast`。
461
+
462
+ **包含的 PR**:
463
+ - **#268** — 修复(issue #267):`omo-system-reminder` 过滤器删除所有 `<system-reminder>` 块,导致后台任务通知丢失、主会话无法恢复子代理结果。改为 v1.2.0:`keepLastOnly: true, keepLast: 2` — 保留最近 2 条匹配,丢弃更早的重复。同时添加框架级可配置 `keepLast` 字段,用户可覆盖每个 `keepLastOnly` 过滤器保留最近几条(默认 1,最小 1)。
464
+
465
+ **安装**:`opencode plugin opencode-acp@stable --global`
466
+
449
467
  ### v1.14.10 — 正式版(v1.14.9 以来 1 个 PR)
450
468
 
451
469
  正式版发布,包含 omo-mode-injection 过滤器修复。
package/dist/index.js CHANGED
@@ -8831,7 +8831,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
8831
8831
  import { join as join3 } from "path";
8832
8832
  import { existsSync as existsSync3 } from "fs";
8833
8833
  import { homedir as homedir3 } from "os";
8834
- var LOG_VERSION = true ? "1.14.10" : "dev";
8834
+ var LOG_VERSION = true ? "1.14.12" : "dev";
8835
8835
  var Logger = class {
8836
8836
  logDir;
8837
8837
  enabled;
@@ -9999,7 +9999,9 @@ function applyMessageFilters(messages, config, logger, ctx) {
9999
9999
  }
10000
10000
  const keepLastFilters = allFilters.filter((f) => f.keepLastOnly);
10001
10001
  for (const filter of keepLastFilters) {
10002
- let foundLast = false;
10002
+ const fcKeepLast = config.filters?.[filter.name]?.keepLast;
10003
+ const keepCount = Math.max(1, fcKeepLast ?? filter.keepLast ?? 1);
10004
+ let kept = 0;
10003
10005
  for (let i = messages.length - 1; i >= 0; i--) {
10004
10006
  const msg = messages[i];
10005
10007
  const role = msg.info.role ?? "unknown";
@@ -10017,13 +10019,10 @@ function applyMessageFilters(messages, config, logger, ctx) {
10017
10019
  continue;
10018
10020
  }
10019
10021
  if (decision.action !== "drop" && decision.action !== "modify") continue;
10020
- if (foundLast) {
10021
- applyDecision(part, { action: "drop", reason: `keepLastOnly: earlier occurrence` }, filter.name, i, text);
10022
+ if (kept < keepCount) {
10023
+ kept++;
10022
10024
  } else {
10023
- foundLast = true;
10024
- if (decision.action === "modify" && decision.text !== void 0) {
10025
- applyDecision(part, decision, filter.name, i, text);
10026
- }
10025
+ applyDecision(part, decision, filter.name, i, text);
10027
10026
  }
10028
10027
  }
10029
10028
  }
@@ -10047,8 +10046,10 @@ var LONE_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
10047
10046
  var LONE_MARKER_RE = /<!-- OMO_INTERNAL_INITIATOR -->/g;
10048
10047
  var OMO_SYSTEM_REMINDER_FILTER = {
10049
10048
  name: "omo-system-reminder",
10050
- version: "1.0.0",
10051
- description: "Strip OMO <system-reminder> blocks and OMO_INTERNAL_INITIATOR markers from user messages",
10049
+ version: "1.3.0",
10050
+ description: "Keep recent OMO <system-reminder> messages; for older ones, strip blocks but preserve user content",
10051
+ keepLastOnly: true,
10052
+ keepLast: 2,
10052
10053
  filter(ctx) {
10053
10054
  if (ctx.role !== "user") return { action: "keep" };
10054
10055
  if (!ctx.text.includes(SYSTEM_REMINDER_OPEN) && !ctx.text.includes(OMO_MARKER)) {
@@ -10067,16 +10068,13 @@ var OMO_SYSTEM_REMINDER_FILTER = {
10067
10068
  modified = modified.replace(LONE_MARKER_RE, "");
10068
10069
  modified = modified.replace(/\n{3,}/g, "\n\n").trim();
10069
10070
  if (modified.length === 0) {
10070
- return { action: "drop", reason: `Stripped ${removedBlocks} OMO system-reminder block(s)` };
10071
+ return { action: "drop", reason: `Pure OMO system-reminder (${removedBlocks} block(s), no user content)` };
10071
10072
  }
10072
- if (modified !== ctx.text) {
10073
- return {
10074
- action: "modify",
10075
- text: modified,
10076
- reason: `Stripped ${removedBlocks} OMO system-reminder block(s)`
10077
- };
10078
- }
10079
- return { action: "keep" };
10073
+ return {
10074
+ action: "modify",
10075
+ text: modified,
10076
+ reason: `Stripped ${removedBlocks} OMO system-reminder block(s), preserved user content (${modified.length} chars)`
10077
+ };
10080
10078
  }
10081
10079
  };
10082
10080