opencode-acp 1.14.11 → 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,15 @@ 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
+
495
504
  ### v1.14.11 — Stable Release (1 PR since v1.14.10)
496
505
 
497
506
  Stable release with the omo-system-reminder filter fix and configurable `keepLast`.
package/README.zh-CN.md CHANGED
@@ -446,6 +446,15 @@ 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
+
449
458
  ### v1.14.11 — 正式版(v1.14.10 以来 1 个 PR)
450
459
 
451
460
  正式版发布,包含 omo-system-reminder 过滤器修复和可配置 `keepLast`。
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.11" : "dev";
8834
+ var LOG_VERSION = true ? "1.14.12" : "dev";
8835
8835
  var Logger = class {
8836
8836
  logDir;
8837
8837
  enabled;
@@ -10021,11 +10021,8 @@ function applyMessageFilters(messages, config, logger, ctx) {
10021
10021
  if (decision.action !== "drop" && decision.action !== "modify") continue;
10022
10022
  if (kept < keepCount) {
10023
10023
  kept++;
10024
- if (decision.action === "modify" && decision.text !== void 0) {
10025
- applyDecision(part, decision, filter.name, i, text);
10026
- }
10027
10024
  } else {
10028
- applyDecision(part, { action: "drop", reason: `keepLastOnly(${keepCount}): earlier occurrence` }, filter.name, i, text);
10025
+ applyDecision(part, decision, filter.name, i, text);
10029
10026
  }
10030
10027
  }
10031
10028
  }
@@ -10044,10 +10041,13 @@ function applyMessageFilters(messages, config, logger, ctx) {
10044
10041
  // lib/messages/filter/builtin/omo-system-reminder.ts
10045
10042
  var SYSTEM_REMINDER_OPEN = "<system-reminder>";
10046
10043
  var OMO_MARKER = "<!-- OMO_INTERNAL_INITIATOR -->";
10044
+ var PAIRED_BLOCK_RE = /<system-reminder>[\s\S]*?<\/system-reminder>\s*<!-- OMO_INTERNAL_INITIATOR -->/g;
10045
+ var LONE_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
10046
+ var LONE_MARKER_RE = /<!-- OMO_INTERNAL_INITIATOR -->/g;
10047
10047
  var OMO_SYSTEM_REMINDER_FILTER = {
10048
10048
  name: "omo-system-reminder",
10049
- version: "1.2.0",
10050
- description: "Keep only the 2 most recent OMO <system-reminder> messages, drop older ones",
10049
+ version: "1.3.0",
10050
+ description: "Keep recent OMO <system-reminder> messages; for older ones, strip blocks but preserve user content",
10051
10051
  keepLastOnly: true,
10052
10052
  keepLast: 2,
10053
10053
  filter(ctx) {
@@ -10055,7 +10055,26 @@ var OMO_SYSTEM_REMINDER_FILTER = {
10055
10055
  if (!ctx.text.includes(SYSTEM_REMINDER_OPEN) && !ctx.text.includes(OMO_MARKER)) {
10056
10056
  return { action: "keep" };
10057
10057
  }
10058
- return { action: "drop", reason: "OMO system-reminder match (keepLast dedup)" };
10058
+ let modified = ctx.text;
10059
+ let removedBlocks = 0;
10060
+ modified = modified.replace(PAIRED_BLOCK_RE, () => {
10061
+ removedBlocks++;
10062
+ return "";
10063
+ });
10064
+ modified = modified.replace(LONE_REMINDER_RE, () => {
10065
+ removedBlocks++;
10066
+ return "";
10067
+ });
10068
+ modified = modified.replace(LONE_MARKER_RE, "");
10069
+ modified = modified.replace(/\n{3,}/g, "\n\n").trim();
10070
+ if (modified.length === 0) {
10071
+ return { action: "drop", reason: `Pure OMO system-reminder (${removedBlocks} block(s), no user content)` };
10072
+ }
10073
+ return {
10074
+ action: "modify",
10075
+ text: modified,
10076
+ reason: `Stripped ${removedBlocks} OMO system-reminder block(s), preserved user content (${modified.length} chars)`
10077
+ };
10059
10078
  }
10060
10079
  };
10061
10080