Skip to content

tests/export-cmd.test.ts: 7 subtests fail on master (compress-result assertion "/1 block/" stale after #376/#377 panel change) #389

Description

@ranxianglei

来源: 分析 PR #380(feat(host) turn-boundary)rebase 到 master 时发现。

现象

tests/export-cmd.test.ts7 个子测试失败,全部经由共享 helper setupSession()(该文件第 89 行)抛出同一断言错误:

error: 'compress created a block'
code: 'ERR_ASSERTION'
operator: 'match'
actual: '▣ ACP | 8.0K → 6.2K tokens (~1.8K reclaimed, blocks: b1=m00002)'

断言是 assert.match(text, /1 block/, "compress created a block"),期望 compress 工具返回文本含 "1 block",实际拿到的是新的 ACP 状态面板串(blocks: b1=m00002)。

失败的 7 个子测试:

  • listSessions returns ACP-managed sessions with id, title, and block count
  • exportSession with no selector lists persisted sessions
  • exportSession renders the folded view (summary in place of the compressed range)
  • exportSession --full renders the original messages
  • exportSession --output writes the markdown file
  • exportSession throws when no session matches the selector
  • /acp-export command is registered and lists, folds, and expands

已在 master 上复现(非 #380 引入)

在干净的 worktree 检出 origin/master(2bdc831) 单独跑 node --import tsx --test tests/export-cmd.test.ts:同样 3 pass / 7 fail,报错逐字一致。即这些失败在 master 本身就已存在,与 PR #380 的改动无关(#380 未触碰 export 相关文件)。

环境:acp-kernel 固定 0.0.63(与已安装一致)、node v22;本地全量套件 767 tests / 757 pass / 7 fail / 3 skip

根因(推断)

compress 结果面板的文案被改成了「报告新 block id + 真实 ref span」的形式(blocks: bN=<ref>),来自 #376/#377("report new block ids and actual ref spans in compress result panel");而 #272 的 acp-export 测试仍按旧措辞断言 /1 block/。两处特性对 compress 返回格式的假设漂移了,面板格式变更时没有同步更新这个测试。

影响

  • master CI 在这个文件上是红的。
  • 任何 rebase 到 master 的 PR 都会把这 7 个显示为失败(与各自改动无关),干扰 PR review 与 CI 门禁判断。

建议修复

tests/export-cmd.test.ts:89 的断言改成匹配当前 compress 结果格式(例如断言新建的 block id b1=,或一个稳定的子串),或让 setupSession() 对面板措辞保持稳健。归属 acp-export(#272)/ compress-result-panel(#376/#377)的维护者。

注:此修复有意未并入 PR #380(与 turn-boundary/host 无关,保持该 PR diff 收敛)。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions