opencode-acp 1.8.0 → 1.8.2
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 +49 -1
- package/README.zh-CN.md +49 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +195 -108
- package/dist/index.js.map +1 -1
- package/dist/lib/compress/index.d.ts +1 -0
- package/dist/lib/compress/index.d.ts.map +1 -1
- package/dist/lib/compress/pipeline.d.ts.map +1 -1
- package/dist/lib/compress/status.d.ts +4 -0
- package/dist/lib/compress/status.d.ts.map +1 -0
- package/dist/lib/config-validation.d.ts.map +1 -1
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/messages/inject/inject.d.ts.map +1 -1
- package/dist/lib/messages/inject/utils.d.ts +19 -0
- package/dist/lib/messages/inject/utils.d.ts.map +1 -1
- package/dist/lib/prompts/extensions/nudge.d.ts.map +1 -1
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/types.d.ts +3 -1
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/state/utils.d.ts.map +1 -1
- package/dist/lib/ui/notification.d.ts +1 -1
- package/dist/lib/ui/notification.d.ts.map +1 -1
- package/dist/lib/ui/utils.d.ts +1 -0
- package/dist/lib/ui/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -421,7 +421,55 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
421
421
|
|
|
422
422
|
## Changelog
|
|
423
423
|
|
|
424
|
-
### v1.
|
|
424
|
+
### v1.8.2 — Always Inject System Prompt
|
|
425
|
+
|
|
426
|
+
**Bug fix**: System prompt gating (v1.8.1 commit `24bbb1f`) caused binge compression on large-context models. Since ACP injections are ephemeral (not persisted to conversation history), gating the system prompt made the model completely forget compression tools existed between nudges. When the nudge fired after 50K growth, the model panicked and made 95 consecutive compress calls.
|
|
427
|
+
|
|
428
|
+
**Fix**: Removed `shouldInjectThisTurn` gate from system prompt hook (`hooks.ts:108-112`). System prompt now always injects every turn. Suffix remains gated at `nudgeGrowthTokens` frequency.
|
|
429
|
+
|
|
430
|
+
**Current behavior**:
|
|
431
|
+
- **System prompt** (compression philosophy, tool awareness): ✅ every turn
|
|
432
|
+
- **Suffix** (context level, block list, Tips): gated at nudgeGrowthTokens frequency
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
### v1.8.1 — Adaptive Nudge Frequency + System Prompt Gating
|
|
437
|
+
|
|
438
|
+
**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.
|
|
439
|
+
|
|
440
|
+
**Adaptive nudgeGrowthTokens**:
|
|
441
|
+
- Default is now adaptive: 5% of `modelContextLimit`, clamped to [6000, 50000]
|
|
442
|
+
- 128K → 6.4K, 200K → 10K, 500K → 25K, 1M → 50K, 2M+ → 50K (cap)
|
|
443
|
+
- Users can still set explicit `nudgeGrowthTokens` to override
|
|
444
|
+
- Removed hardcoded `6000` from schema defaults (was shadowing adaptive logic)
|
|
445
|
+
|
|
446
|
+
**System prompt gating**:
|
|
447
|
+
- SYSTEM prompt + `<dcp-system-reminder>` tags now pulse at `nudgeGrowthTokens` frequency
|
|
448
|
+
- Between nudges: system prompt injects **nothing** — zero compression noise
|
|
449
|
+
- First turn (`undefined` sentinel): always injects (establishes baseline)
|
|
450
|
+
|
|
451
|
+
**New tool: `acp_status`**:
|
|
452
|
+
- On-demand inspection of all compressed blocks (ID, tokens, age, topic)
|
|
453
|
+
- Replaces verbose block list in suffix with one-liner: `Compressed blocks: N (XK summary, last Ym ago). Use acp_status for details.`
|
|
454
|
+
|
|
455
|
+
**Compress notification improvement**:
|
|
456
|
+
- Header shows context before→after: `▣ ACP | Context 251.2K→249.3K`
|
|
457
|
+
- No percentage or limit shown (prevents model from anchoring on ceiling)
|
|
458
|
+
|
|
459
|
+
**Bug fixes**:
|
|
460
|
+
- `lastPerMessageNudgeTokens` reset to `0` after compress bypassed growth gate (feedback loop)
|
|
461
|
+
- Schema default `6000` shadowed `resolveAdaptiveNudgeGrowth()` — adaptive never activated
|
|
462
|
+
- `applyAnchoredNudges` + `injectContextUsage` duplicated context usage text
|
|
463
|
+
- `lastNudgeTokens === 0` sentinel replaced with `undefined` (explicit "never nudged")
|
|
464
|
+
|
|
465
|
+
**Tooling**:
|
|
466
|
+
- `scripts/dev-deploy.sh` — one-command build + deploy (auto-detects node, typecheck, build, deploy)
|
|
467
|
+
- Post-compress state transition integration tests (3 new)
|
|
468
|
+
- `acp_status` dedicated tests (7 new)
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
### v1.8.0 — Principle-Driven Prompts
|
|
425
473
|
|
|
426
474
|
**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).
|
|
427
475
|
|
package/README.zh-CN.md
CHANGED
|
@@ -393,7 +393,55 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
|
|
|
393
393
|
|
|
394
394
|
## 更新日志
|
|
395
395
|
|
|
396
|
-
### v1.
|
|
396
|
+
### v1.8.2 — 始终注入系统提示词
|
|
397
|
+
|
|
398
|
+
**Bug 修复**:系统提示词门控(v1.8.1 commit `24bbb1f`)导致大上下文模型 binge 压缩。由于 ACP 注入是临时的(不持久化到对话历史),gate 掉系统提示词会让模型在两次 nudge 之间完全忘记压缩工具的存在。当 50K 增长后 nudge 触发时,模型恐慌性连续调用 95 次压缩。
|
|
399
|
+
|
|
400
|
+
**修复**:移除系统提示词 hook 的 `shouldInjectThisTurn` gate(`hooks.ts:108-112`)。系统提示词现在每轮都注入。Suffix 仍按 `nudgeGrowthTokens` 频率 gate。
|
|
401
|
+
|
|
402
|
+
**当前行为**:
|
|
403
|
+
- **系统提示词**(压缩哲学、工具意识):✅ 每轮
|
|
404
|
+
- **Suffix**(上下文水平、块列表、Tips):按 nudgeGrowthTokens 频率
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
### v1.8.1 — 自适应提醒频率 + 系统提示门控
|
|
409
|
+
|
|
410
|
+
**问题**:大上下文模型(1M+)在 20-30% 上下文时过度压缩,因为 Tips 每 6K tokens(1M 的 0.6%)就触发一次。系统提示每轮注入增加了持续压力。
|
|
411
|
+
|
|
412
|
+
**自适应 nudgeGrowthTokens**:
|
|
413
|
+
- 默认值现在自适应:`modelContextLimit` 的 5%,限制在 [6000, 50000]
|
|
414
|
+
- 128K → 6.4K,200K → 10K,500K → 25K,1M → 50K,2M+ → 50K(上限)
|
|
415
|
+
- 用户仍可显式设置 `nudgeGrowthTokens` 覆盖
|
|
416
|
+
- 移除了 schema 默认值中的硬编码 `6000`(之前覆盖了自适应逻辑)
|
|
417
|
+
|
|
418
|
+
**系统提示门控**:
|
|
419
|
+
- SYSTEM 提示 + `<dcp-system-reminder>` 标签现在按 `nudgeGrowthTokens` 频率脉冲
|
|
420
|
+
- 两次提醒之间:系统提示**不注入任何内容** —— 零压缩噪音
|
|
421
|
+
- 第一轮(`undefined` 哨兵值):始终注入(建立基线)
|
|
422
|
+
|
|
423
|
+
**新工具:`acp_status`**:
|
|
424
|
+
- 按需查看所有压缩块(ID、token 数、年龄、主题)
|
|
425
|
+
- 用一行摘要替代 suffix 中的冗长块列表:`Compressed blocks: N (XK summary, last Ym ago). Use acp_status for details.`
|
|
426
|
+
|
|
427
|
+
**压缩通知改进**:
|
|
428
|
+
- 头部显示上下文前后水平:`▣ ACP | Context 251.2K→249.3K`
|
|
429
|
+
- 不显示百分比或上限(防止模型锚定天花板)
|
|
430
|
+
|
|
431
|
+
**Bug 修复**:
|
|
432
|
+
- `lastPerMessageNudgeTokens` 压缩后重置为 `0` 绕过了增长检查(反馈循环)
|
|
433
|
+
- Schema 默认值 `6000` 覆盖了 `resolveAdaptiveNudgeGrowth()` —— 自适应从未生效
|
|
434
|
+
- `applyAnchoredNudges` + `injectContextUsage` 重复注入上下文使用文本
|
|
435
|
+
- `lastNudgeTokens === 0` 哨兵值替换为 `undefined`(明确的"从未触发")
|
|
436
|
+
|
|
437
|
+
**工具链**:
|
|
438
|
+
- `scripts/dev-deploy.sh` —— 一键构建 + 部署(自动检测 node、类型检查、构建、部署)
|
|
439
|
+
- 压缩后状态转换集成测试(新增 3 个)
|
|
440
|
+
- `acp_status` 独立测试(新增 7 个)
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
### v1.8.0 — 原则驱动提示
|
|
397
445
|
|
|
398
446
|
**理念**:用 4 条简洁原则替代冗长的上下文管理指导。模型现在看到的是*重要原则*而非*死板规则*。
|
|
399
447
|
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,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"}
|