opencode-acp 1.14.5 → 1.14.6
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 +10 -0
- package/README.zh-CN.md +10 -0
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/hooks.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -257,6 +257,8 @@ If no `acp.jsonc` is found, ACP falls back to `dcp.jsonc` / `dcp.json` (for back
|
|
|
257
257
|
|
|
258
258
|
Each level overrides the previous, so project settings take priority over global. Restart OpenCode after making config changes.
|
|
259
259
|
|
|
260
|
+
> **📖 Full parameter reference:** See [CONFIGURATION.md](./CONFIGURATION.md) for a complete reference of every configurable parameter with type, default value, and description.
|
|
261
|
+
|
|
260
262
|
> [!IMPORTANT]
|
|
261
263
|
> **Disable OpenCode's built-in auto-compaction.** ACP handles context management itself — OpenCode's compaction conflicts with ACP and can cause issues (re-expanded messages, lost compression state). Add to your `opencode.json`:
|
|
262
264
|
>
|
|
@@ -507,6 +509,14 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
507
509
|
|
|
508
510
|
## Changelog
|
|
509
511
|
|
|
512
|
+
### v1.14.6 — Debug Nudge Chat Visibility (PR #226)
|
|
513
|
+
|
|
514
|
+
**Problem**: With `debug: true`, ACP nudge injections (compression suggestions, context breakdown, tier triggers) were only visible via a 5-second toast and log files. The nudge suffix message is ephemeral — injected by the message-transform hook but never persisted to the conversation DB — so users could not see what the model was actually seeing in the chat UI. This made debugging nudge behavior very difficult.
|
|
515
|
+
|
|
516
|
+
**Fix**: When `config.debug` is on, the `debugNotify` callback in `hooks.ts` now also calls `sendIgnoredMessage()` to persist the full nudge text to the conversation DB as an `ignored: true` user message (user-visible, model-invisible). The message is prefixed with `[ACP Debug Nudge]` for easy identification. Toast notification still shown alongside for backward compat. Debug OFF: behavior unchanged (no persisted messages).
|
|
517
|
+
|
|
518
|
+
Files: `lib/hooks.ts`. No source logic changes. No config changes. No persisted-state schema changes. 937 tests pass.
|
|
519
|
+
|
|
510
520
|
### v1.14.5 — GC Module Removal + Property-Based Tests + Issue #176 Fix + Config Docs (PRs #222, #206, #221, #223, #224)
|
|
511
521
|
|
|
512
522
|
**Problem**: Five issues bundled. (1) **GC data-loss bugs** (PR #222): The `gc/truncate.ts` module had 4 confirmed bugs that could silently lose summaries — single-line truncation exceeded maxLength by 19 chars, barely-over-maxLength silently failed (longer than input), long-header output overrun, and off-by-one marker reservation. GC only triggered at 100% context (default), so it was rarely reached but catastrophic when it did. (2) **Dead code** (PR #206): Prune tool, sweep command, and strategies (~2309 lines) were never used — `prune` tool was replaced by `compress` tool, `sweep` was superseded by batch cleanup, strategies were vestigial. (3) **No property-based tests** (PR #221): All tests were targeted/unit tests — invariant violations across edge cases were undetectable. (4) **Missing config docs** (PR #223): No comprehensive config reference — users had to read source to discover parameters. (5) **Nudge permanently stops after compress** (PR #224, Issue #176): In autonomous sessions (single user message + many assistant/tool turns), `injectCompressNudges` had an unconditional early return when any compress was detected in the current turn. Since the entire session IS one turn, once compress happened, `currentTurnHasCompress` was always true → function always returned early → nudges never fired again → unbounded context growth.
|
package/README.zh-CN.md
CHANGED
|
@@ -212,6 +212,8 @@ ACP 使用自己的配置文件,按以下顺序搜索:
|
|
|
212
212
|
|
|
213
213
|
每一层覆盖前一层,因此项目设置优先于全局设置。修改配置后请重启 OpenCode。
|
|
214
214
|
|
|
215
|
+
> **📖 完整参数参考:** 请查看 [CONFIGURATION.zh-CN.md](./CONFIGURATION.zh-CN.md)(中文)或 [CONFIGURATION.md](./CONFIGURATION.md)(英文),包含每个可配置参数的类型、默认值和详细说明。
|
|
216
|
+
|
|
215
217
|
> [!IMPORTANT]
|
|
216
218
|
> **禁用 OpenCode 的内置自动压缩。** ACP 自行处理上下文管理 — OpenCode 的压缩与 ACP 冲突,可能导致问题(消息重新展开、压缩状态丢失)。请在 `opencode.json` 中添加:
|
|
217
219
|
>
|
|
@@ -461,6 +463,14 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
|
|
|
461
463
|
|
|
462
464
|
## 更新日志
|
|
463
465
|
|
|
466
|
+
### v1.14.6 — Debug Nudge 聊天界面可见性(PR #226)
|
|
467
|
+
|
|
468
|
+
**问题**:开启 `debug: true` 时,ACP nudge 注入(压缩建议、上下文分类、分层触发器)只能通过 5 秒 toast 和日志文件查看。nudge 后缀消息是临时的——由消息变换 hook 注入但从未持久化到会话数据库——因此用户无法在聊天界面看到模型实际看到的内容。这使得调试 nudge 行为非常困难。
|
|
469
|
+
|
|
470
|
+
**修复**:当 `config.debug` 开启时,`hooks.ts` 中的 `debugNotify` 回调现在额外调用 `sendIgnoredMessage()`,将完整 nudge 文本以 `ignored: true` 用户消息形式持久化到会话数据库(用户可见,模型不可见)。消息前缀为 `[ACP Debug Nudge]` 便于识别。Toast 通知仍同时显示以保持向后兼容。Debug 关闭:行为不变(无持久化消息)。
|
|
471
|
+
|
|
472
|
+
文件:`lib/hooks.ts`。无源逻辑变更。无配置变更。无持久化状态架构变更。937 项测试通过。
|
|
473
|
+
|
|
464
474
|
### v1.14.5 — GC 模块移除 + 属性测试 + Issue #176 修复 + 配置文档(PRs #222, #206, #221, #223, #224)
|
|
465
475
|
|
|
466
476
|
**问题**:打包修复 5 个问题。(1) **GC 数据丢失 Bug**(PR #222):`gc/truncate.ts` 有 4 个已确认的 bug,可能静默丢失摘要——单行截断超过 maxLength 19 字符、刚好超过 maxLength 时静默失败(输出比输入更长)、长 header 输出溢出、标记预留 off-by-one。GC 默认只在 100% 上下文时触发,所以很少触发但触发时是灾难性的。(2) **死代码**(PR #206):prune 工具、sweep 命令和策略(约 2309 行)从未被使用。(3) **无属性测试**(PR #221):所有测试都是针对性/单元测试——不变量违反在边界情况下无法检测。(4) **缺少配置文档**(PR #223):没有完整的配置参考——用户必须读源码才能发现参数。(5) **压缩后 nudge 永久停止**(PR #224,Issue #176):在自治会话(单条用户消息 + 大量助手/工具消息)中,`injectCompressNudges` 在检测到当前 turn 有压缩时无条件 early return。由于整个会话就是一个 turn,一旦发生压缩,`currentTurnHasCompress` 永远为 true → 函数永远 early return → nudge 不再触发 → 上下文无限增长。
|
package/dist/index.js
CHANGED
|
@@ -9543,7 +9543,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
|
9543
9543
|
import { join as join3 } from "path";
|
|
9544
9544
|
import { existsSync as existsSync3 } from "fs";
|
|
9545
9545
|
import { homedir as homedir3 } from "os";
|
|
9546
|
-
var LOG_VERSION = true ? "1.14.
|
|
9546
|
+
var LOG_VERSION = true ? "1.14.6" : "dev";
|
|
9547
9547
|
var Logger = class {
|
|
9548
9548
|
logDir;
|
|
9549
9549
|
enabled;
|
|
@@ -11482,6 +11482,23 @@ function createChatMessageTransformHandler(client, registry3, logger, config, pr
|
|
|
11482
11482
|
config.debug ? (text) => {
|
|
11483
11483
|
logger.debug(`[ACP Debug] Nudge injected:
|
|
11484
11484
|
${text}`);
|
|
11485
|
+
if (state.sessionId && lastUserMessage) {
|
|
11486
|
+
const userInfo = lastUserMessage.info;
|
|
11487
|
+
sendIgnoredMessage(
|
|
11488
|
+
client,
|
|
11489
|
+
state.sessionId,
|
|
11490
|
+
`[ACP Debug Nudge]
|
|
11491
|
+
${text}`,
|
|
11492
|
+
{
|
|
11493
|
+
providerId: userInfo.model?.providerID,
|
|
11494
|
+
modelId: userInfo.model?.modelID,
|
|
11495
|
+
agent: userInfo.agent,
|
|
11496
|
+
variant: userInfo.variant
|
|
11497
|
+
},
|
|
11498
|
+
logger
|
|
11499
|
+
).catch(() => {
|
|
11500
|
+
});
|
|
11501
|
+
}
|
|
11485
11502
|
client.tui.showToast({
|
|
11486
11503
|
body: {
|
|
11487
11504
|
title: "ACP: Nudge Injected",
|