opencode-acp 1.7.0 → 1.8.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/README.md CHANGED
@@ -419,6 +419,70 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
419
419
 
420
420
  ---
421
421
 
422
+ ## Changelog
423
+
424
+ ### v1.8.1 — Adaptive Nudge Frequency + System Prompt Gating
425
+
426
+ **Problem**: Large-context models (1M+) over-compressed at 20-30% context because Tips fired every 6K tokens (0.6% of 1M). System prompt injected every turn added constant pressure.
427
+
428
+ **Adaptive nudgeGrowthTokens**:
429
+ - Default is now adaptive: 5% of `modelContextLimit`, clamped to [6000, 50000]
430
+ - 128K → 6.4K, 200K → 10K, 500K → 25K, 1M → 50K, 2M+ → 50K (cap)
431
+ - Users can still set explicit `nudgeGrowthTokens` to override
432
+ - Removed hardcoded `6000` from schema defaults (was shadowing adaptive logic)
433
+
434
+ **System prompt gating**:
435
+ - SYSTEM prompt + `<dcp-system-reminder>` tags now pulse at `nudgeGrowthTokens` frequency
436
+ - Between nudges: system prompt injects **nothing** — zero compression noise
437
+ - First turn (`undefined` sentinel): always injects (establishes baseline)
438
+
439
+ **New tool: `acp_status`**:
440
+ - On-demand inspection of all compressed blocks (ID, tokens, age, topic)
441
+ - Replaces verbose block list in suffix with one-liner: `Compressed blocks: N (XK summary, last Ym ago). Use acp_status for details.`
442
+
443
+ **Compress notification improvement**:
444
+ - Header shows context before→after: `▣ ACP | Context 251.2K→249.3K`
445
+ - No percentage or limit shown (prevents model from anchoring on ceiling)
446
+
447
+ **Bug fixes**:
448
+ - `lastPerMessageNudgeTokens` reset to `0` after compress bypassed growth gate (feedback loop)
449
+ - Schema default `6000` shadowed `resolveAdaptiveNudgeGrowth()` — adaptive never activated
450
+ - `applyAnchoredNudges` + `injectContextUsage` duplicated context usage text
451
+ - `lastNudgeTokens === 0` sentinel replaced with `undefined` (explicit "never nudged")
452
+
453
+ **Tooling**:
454
+ - `scripts/dev-deploy.sh` — one-command build + deploy (auto-detects node, typecheck, build, deploy)
455
+ - Post-compress state transition integration tests (3 new)
456
+ - `acp_status` dedicated tests (7 new)
457
+
458
+ ---
459
+
460
+ ### v1.8.0 — Principle-Driven Prompts
461
+
462
+ **Philosophy**: Replaced verbose context-management guidance with 4 concise principles injected every turn. The model now sees *what matters* (principles) instead of *what to do* (rigid rules).
463
+
464
+ **Prompt changes**:
465
+ - 4 principles replace CONTEXT PRESSURE LEVELS, 7-item priority list, DO NOT RE-COMPRESS rules
466
+ - Context display simplified: absolute token count only, no percentage
467
+ - `<acp-context>` tag wrapping (backward compatible with `<dcp-context>`)
468
+
469
+ **Hybrid Tips frequency**:
470
+ - 💡 Light Tips (15-45%): Every turn — non-disruptive reminder
471
+ - ⚠️ Warning Tips (45%+): Key nodes only — first crossing or 10pp growth, prevents over-compression
472
+
473
+ **Config simplification**:
474
+ - Removed `hardNudgeContextPercent` — merged into `minContextLimit`/`maxContextLimit`
475
+ - Removed `perMessageNudgeGrowthPercent` — light Tips show every turn
476
+ - `maxSummaryLength` default: 200 → 2000
477
+ - `maxSummaryLengthHard` default: 3000 → 4000
478
+
479
+ **Bug fixes**:
480
+ - Windows path validation: `os.tmpdir()` + `path.relative()` (was hardcoded `/tmp/`)
481
+ - Compress after-detection: reset warning tracking
482
+ - Dead code cleanup: `shouldInjectPerMessageNudge`, no-op template
483
+
484
+ ---
485
+
422
486
  ## License
423
487
 
424
488
  AGPL-3.0-or-later -- This project is a fork of [@tarquinen/opencode-dcp](https://github.com/Tarquinen/opencode-dynamic-context-pruning). Original copyright belongs to the original author. Modifications and bug fixes by ranxianglei.
package/README.zh-CN.md CHANGED
@@ -391,6 +391,70 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
391
391
 
392
392
  ---
393
393
 
394
+ ## 更新日志
395
+
396
+ ### v1.8.1 — 自适应提醒频率 + 系统提示门控
397
+
398
+ **问题**:大上下文模型(1M+)在 20-30% 上下文时过度压缩,因为 Tips 每 6K tokens(1M 的 0.6%)就触发一次。系统提示每轮注入增加了持续压力。
399
+
400
+ **自适应 nudgeGrowthTokens**:
401
+ - 默认值现在自适应:`modelContextLimit` 的 5%,限制在 [6000, 50000]
402
+ - 128K → 6.4K,200K → 10K,500K → 25K,1M → 50K,2M+ → 50K(上限)
403
+ - 用户仍可显式设置 `nudgeGrowthTokens` 覆盖
404
+ - 移除了 schema 默认值中的硬编码 `6000`(之前覆盖了自适应逻辑)
405
+
406
+ **系统提示门控**:
407
+ - SYSTEM 提示 + `<dcp-system-reminder>` 标签现在按 `nudgeGrowthTokens` 频率脉冲
408
+ - 两次提醒之间:系统提示**不注入任何内容** —— 零压缩噪音
409
+ - 第一轮(`undefined` 哨兵值):始终注入(建立基线)
410
+
411
+ **新工具:`acp_status`**:
412
+ - 按需查看所有压缩块(ID、token 数、年龄、主题)
413
+ - 用一行摘要替代 suffix 中的冗长块列表:`Compressed blocks: N (XK summary, last Ym ago). Use acp_status for details.`
414
+
415
+ **压缩通知改进**:
416
+ - 头部显示上下文前后水平:`▣ ACP | Context 251.2K→249.3K`
417
+ - 不显示百分比或上限(防止模型锚定天花板)
418
+
419
+ **Bug 修复**:
420
+ - `lastPerMessageNudgeTokens` 压缩后重置为 `0` 绕过了增长检查(反馈循环)
421
+ - Schema 默认值 `6000` 覆盖了 `resolveAdaptiveNudgeGrowth()` —— 自适应从未生效
422
+ - `applyAnchoredNudges` + `injectContextUsage` 重复注入上下文使用文本
423
+ - `lastNudgeTokens === 0` 哨兵值替换为 `undefined`(明确的"从未触发")
424
+
425
+ **工具链**:
426
+ - `scripts/dev-deploy.sh` —— 一键构建 + 部署(自动检测 node、类型检查、构建、部署)
427
+ - 压缩后状态转换集成测试(新增 3 个)
428
+ - `acp_status` 独立测试(新增 7 个)
429
+
430
+ ---
431
+
432
+ ### v1.8.0 — 原则驱动提示
433
+
434
+ **理念**:用 4 条简洁原则替代冗长的上下文管理指导。模型现在看到的是*重要原则*而非*死板规则*。
435
+
436
+ **提示变更**:
437
+ - 4 条原则替代 CONTEXT PRESSURE LEVELS、7 项优先级列表、DO NOT RE-COMPRESS 规则
438
+ - 上下文显示简化:仅显示绝对 token 数,不显示百分比
439
+ - `<acp-context>` 标签包裹(向后兼容 `<dcp-context>`)
440
+
441
+ **混合 Tips 频率**:
442
+ - 💡 轻量提示(15-45%):每轮显示 — 不打扰
443
+ - ⚠️ 警告提示(45%+):仅关键节点 — 首次跨越或增长 10pp,防止过度压缩
444
+
445
+ **配置简化**:
446
+ - 移除 `hardNudgeContextPercent` — 合并到 `minContextLimit`/`maxContextLimit`
447
+ - 移除 `perMessageNudgeGrowthPercent` — 轻量提示每轮显示
448
+ - `maxSummaryLength` 默认值:200 → 2000
449
+ - `maxSummaryLengthHard` 默认值:3000 → 4000
450
+
451
+ **Bug 修复**:
452
+ - Windows 路径校验:`os.tmpdir()` + `path.relative()`(原硬编码 `/tmp/`)
453
+ - 压缩检测后:重置警告追踪
454
+ - 死代码清理:`shouldInjectPerMessageNudge`、空操作模板
455
+
456
+ ---
457
+
394
458
  ## 许可证
395
459
 
396
460
  AGPL-3.0-or-later — 本项目是 [@tarquinen/opencode-dcp](https://github.com/Tarquinen/opencode-dynamic-context-pruning) 的分支。原始版权归原始作者所有。修改和错误修复由 ranxianglei 完成。
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA0BjD,QAAA,MAAM,MAAM,EAAE,MAmHK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA2BjD,QAAA,MAAM,MAAM,EAAE,MAqHK,CAAA;AAEnB,eAAe,MAAM,CAAA"}