opencode-acp 1.11.1 → 1.11.4
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 +42 -0
- package/README.zh-CN.md +42 -0
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/messages/inject/inject.d.ts.map +1 -1
- package/dist/lib/state/persistence.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -422,6 +422,48 @@ For the complete list with root cause analysis, see the [bug tracker](https://gi
|
|
|
422
422
|
|
|
423
423
|
## Changelog
|
|
424
424
|
|
|
425
|
+
### v1.11.4 — Baseline Persistence Fix + Unified Release Workflow (PR #112, #113)
|
|
426
|
+
|
|
427
|
+
**Bug fix (PR #112)**: After compress sets `lastPerMessageNudgeTokens = undefined`, the next transform re-establishes the baseline in memory but never persists it to disk (save condition was false). After restart, nudges break again. Fix: added `baselineReEstablished` flag to save condition. Also fixed async save race condition in `writePersistedSessionState` (file path resolved after `await`).
|
|
428
|
+
|
|
429
|
+
**CI fix (PR #113)**: Merged `auto-tag.yml` + `release.yml` into single workflow. GitHub Actions `GITHUB_TOKEN` cannot trigger chained workflows — the tag pushed by `auto-tag.yml` didn't fire `release.yml`.
|
|
430
|
+
|
|
431
|
+
Files: `lib/messages/inject/inject.ts`, `lib/state/persistence.ts`. Tests: `tests/inject.test.ts` (+94 lines, 2 new E2E tests).
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
### v1.11.3 — Auto-Tag on Release Branch Merge (PR #111)
|
|
436
|
+
|
|
437
|
+
**Problem**: After merging a release PR, the version tag (`v{VERSION}`) still had to be pushed manually — easy to forget.
|
|
438
|
+
|
|
439
|
+
**Fix**: Added `auto-tag.yml` workflow. When a `YYYY-MM-DD_release-v*` branch is merged to master, CI automatically reads `package.json` version, creates the tag, and pushes it. The tag push then triggers `release.yml` for auto-publish. Normal (non-release) branches that accidentally change the version are ignored.
|
|
440
|
+
|
|
441
|
+
Files: `.github/workflows/auto-tag.yml`. AGENTS.md Section 5.4 updated.
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
### v1.11.2 — CI Enforcement & Auto-Publish (PR #104)
|
|
446
|
+
|
|
447
|
+
Added GitHub Actions CI to automate AGENTS.md compliance enforcement:
|
|
448
|
+
|
|
449
|
+
- **PR validation** (`pr-checks.yml`): every PR to master is checked for branch name convention (`YYYY-MM-DD_short-title`), devlog existence (`devlog/{branch}/REQ.md` + `WORKLOG.md`), and changelog updates on version bumps.
|
|
450
|
+
- **Auto-publish** (`release.yml`): pushing a `v*` tag triggers `npm ci` → `npm run check:package` → `npm test` → `npm publish` → GitHub Release, fully automated.
|
|
451
|
+
- Script: `scripts/ci/check-pr.sh` — reusable PR validation logic.
|
|
452
|
+
|
|
453
|
+
Requires `NPM_TOKEN` secret in GitHub repo settings.
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
### v1.11.1 — Compress Baseline Fix (PR #99)
|
|
458
|
+
|
|
459
|
+
**Problem**: When the model called `compress`, both `lastPerMessageNudgeTokens` and `lastToolOutputNudgeTokens` were set to `currentTokens` — the token count from the compress-calling assistant message, which reflects **pre-compression** context. After compressing 100K→50K, the baseline was stuck at 100K, so `growth = 50K - 100K = -50K` and nudges never fired again.
|
|
460
|
+
|
|
461
|
+
**Fix**: Both baselines are now set to `undefined` on compress detection. The next message-transform run re-establishes the baseline from the real post-compression API token count, without triggering a nudge (`computeShouldNudge` returns `shouldNudge: false` when baseline is `undefined`).
|
|
462
|
+
|
|
463
|
+
Files: `lib/messages/inject/inject.ts` (line 98-99). Tests: `tests/inject.test.ts` — 3 updated + 2 new (621 total, 0 fail).
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
425
467
|
### v1.11.0 — Tool-Result Recap Injection, Context Breakdown & Fork Rebuild
|
|
426
468
|
|
|
427
469
|
This release fixes two critical compression-injection bugs (#20 echo, #78 drift), adds a visible context breakdown to `acp_status`, and introduces a fork-rebuild mechanism.
|
package/README.zh-CN.md
CHANGED
|
@@ -395,6 +395,48 @@ ACP 在首次启动时自动将配置从 `dcp.jsonc` 迁移到 `acp.jsonc`,将
|
|
|
395
395
|
|
|
396
396
|
## 更新日志
|
|
397
397
|
|
|
398
|
+
### v1.11.4 — 基线持久化修复 + 统一发布工作流(PR #112, #113)
|
|
399
|
+
|
|
400
|
+
**Bug 修复(PR #112)**:压缩后 baseline 设为 `undefined`,下一轮重建为真实值但**不写盘**(save 条件为 false)。重启后 nudge 失效。修复:新增 `baselineReEstablished` flag 加入 save 条件。同时修复 `writePersistedSessionState` 异步竞态(文件路径在 `await` 之后解析)。
|
|
401
|
+
|
|
402
|
+
**CI 修复(PR #113)**:合并 `auto-tag.yml` + `release.yml` 为单一工作流。GitHub Actions `GITHUB_TOKEN` 无法链式触发 workflow——auto-tag push 的 tag 不会触发 release.yml。
|
|
403
|
+
|
|
404
|
+
文件:`lib/messages/inject/inject.ts`、`lib/state/persistence.ts`。测试:`tests/inject.test.ts`(+94 行,2 个新 E2E 测试)。
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
### v1.11.3 — 发布分支合并自动打 Tag(PR #111)
|
|
409
|
+
|
|
410
|
+
**问题**:合并发布 PR 后,仍需手动 push 版本 tag(`v{VERSION}`)——容易遗忘。
|
|
411
|
+
|
|
412
|
+
**修复**:新增 `auto-tag.yml` 工作流。当 `YYYY-MM-DD_release-v*` 分支合并到 master 时,CI 自动读取 `package.json` 版本号,创建并 push tag。Tag push 随即触发 `release.yml` 自动发布。普通分支误改版本号不会触发。
|
|
413
|
+
|
|
414
|
+
文件:`.github/workflows/auto-tag.yml`。AGENTS.md Section 5.4 已更新。
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
### v1.11.2 — CI 自动校验 & 自动发布(PR #104)
|
|
419
|
+
|
|
420
|
+
新增 GitHub Actions CI 自动执行 AGENTS.md 规范:
|
|
421
|
+
|
|
422
|
+
- **PR 校验**(`pr-checks.yml`):每个到 master 的 PR 自动检查分支名规范(`YYYY-MM-DD_short-title`)、devlog 是否存在(`devlog/{分支}/REQ.md` + `WORKLOG.md`)、版本号变更时 changelog 是否更新。
|
|
423
|
+
- **自动发布**(`release.yml`):push `v*` tag 后自动执行 `npm ci` → `npm run check:package` → `npm test` → `npm publish` → GitHub Release,全自动。
|
|
424
|
+
- 脚本:`scripts/ci/check-pr.sh` — 可复用的 PR 校验逻辑。
|
|
425
|
+
|
|
426
|
+
需要在 GitHub Secrets 中配置 `NPM_TOKEN`。
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
### v1.11.1 — 压缩基线修复(PR #99)
|
|
431
|
+
|
|
432
|
+
**问题**:当模型调用 `compress` 时,`lastPerMessageNudgeTokens` 和 `lastToolOutputNudgeTokens` 都被设为 `currentTokens` —— 这是调用 compress 的 assistant 消息的 token 计数,反映的是**压缩前**的上下文。压缩 100K→50K 后,基线卡在 100K,导致 `growth = 50K - 100K = -50K`,nudge 永远不再触发。
|
|
433
|
+
|
|
434
|
+
**修复**:压缩时将两个基线都设为 `undefined`。下一次 message-transform 运行时从真实的压缩后 API token 计数重建基线,不会误触发 nudge(`computeShouldNudge` 在基线为 `undefined` 时返回 `shouldNudge: false`)。
|
|
435
|
+
|
|
436
|
+
文件:`lib/messages/inject/inject.ts`(第 98-99 行)。测试:`tests/inject.test.ts` — 3 个更新 + 2 个新增(共 621 个测试,0 失败)。
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
398
440
|
### v1.11.0 — 工具结果注入、上下文分解 & Fork 重建
|
|
399
441
|
|
|
400
442
|
本次发布修复了两个关键压缩注入 bug(#20 复读、#78 漂移),为 `acp_status` 添加了可见上下文分解,并引入了 fork 重建机制。
|
package/dist/index.js
CHANGED
|
@@ -3686,19 +3686,16 @@ function migrateFromLegacyIfNeeded(logger) {
|
|
|
3686
3686
|
logger.warn(`[ACP] Storage migration failed: ${e.message}`);
|
|
3687
3687
|
}
|
|
3688
3688
|
}
|
|
3689
|
-
async function ensureStorageDir(logger) {
|
|
3690
|
-
const storageDir = getStorageDir();
|
|
3691
|
-
if (!existsSync2(storageDir)) {
|
|
3692
|
-
migrateFromLegacyIfNeeded(logger);
|
|
3693
|
-
await fs.mkdir(storageDir, { recursive: true });
|
|
3694
|
-
}
|
|
3695
|
-
}
|
|
3696
3689
|
function getSessionFilePath(sessionId) {
|
|
3697
3690
|
return join2(getStorageDir(), `${sessionId}.json`);
|
|
3698
3691
|
}
|
|
3699
3692
|
async function writePersistedSessionState(sessionId, state, logger) {
|
|
3700
|
-
await ensureStorageDir(logger);
|
|
3701
3693
|
const filePath = getSessionFilePath(sessionId);
|
|
3694
|
+
const storageDir = getStorageDir();
|
|
3695
|
+
if (!existsSync2(storageDir)) {
|
|
3696
|
+
migrateFromLegacyIfNeeded(logger);
|
|
3697
|
+
await fs.mkdir(storageDir, { recursive: true });
|
|
3698
|
+
}
|
|
3702
3699
|
const content = JSON.stringify(state, null, 2);
|
|
3703
3700
|
await fs.writeFile(filePath, content, "utf-8");
|
|
3704
3701
|
logger.info("Saved session state to disk", {
|
|
@@ -6606,6 +6603,7 @@ var injectCompressNudges = (state, config, logger, messages, prompts, compressio
|
|
|
6606
6603
|
return;
|
|
6607
6604
|
}
|
|
6608
6605
|
let anchorsChanged = false;
|
|
6606
|
+
let baselineReEstablished = false;
|
|
6609
6607
|
if (!overMinLimit) {
|
|
6610
6608
|
const hadTurnAnchors = state.nudges.turnNudgeAnchors.size > 0;
|
|
6611
6609
|
const hadIterationAnchors = state.nudges.iterationNudgeAnchors.size > 0;
|
|
@@ -6681,6 +6679,7 @@ var injectCompressNudges = (state, config, logger, messages, prompts, compressio
|
|
|
6681
6679
|
state.nudges.shouldInjectThisTurn = decision.shouldNudge;
|
|
6682
6680
|
if (state.nudges.lastPerMessageNudgeTokens === void 0 && currentTokens !== void 0) {
|
|
6683
6681
|
state.nudges.lastPerMessageNudgeTokens = currentTokens;
|
|
6682
|
+
baselineReEstablished = true;
|
|
6684
6683
|
}
|
|
6685
6684
|
const composition = estimateContextComposition(messages, state);
|
|
6686
6685
|
const toolOutputThreshold = config.compress?.toolOutputNudgeThreshold ?? nudgeGrowthTokens;
|
|
@@ -6777,7 +6776,7 @@ ${HOW_TO_COMPRESS_RULES}`;
|
|
|
6777
6776
|
}
|
|
6778
6777
|
}
|
|
6779
6778
|
}
|
|
6780
|
-
if (anchorsChanged || decision.shouldNudge) {
|
|
6779
|
+
if (anchorsChanged || decision.shouldNudge || baselineReEstablished) {
|
|
6781
6780
|
saveSessionState(state, logger).catch(() => {
|
|
6782
6781
|
});
|
|
6783
6782
|
}
|