Skip to content

fix(ci): 对齐 pi 1.0.0 的 stock 调用头并钉住 pi 版本 - #44

Closed
onyx-space wants to merge 1 commit into
mainfrom
fm/ci-pi-100-drift-f1a2
Closed

onyx-space wants to merge 1 commit into
mainfrom
fm/ci-pi-100-drift-f1a2

Conversation

@onyx-space

Copy link
Copy Markdown
Owner

摘要

本仓 CI 因上游 pi 漂移变红:CI 装 pi 用的是 npm install -g @earendil-works/pi-coding-agent(无版本号)⇒ 上游 1.0.0 一发布,CI 自己就漂了;PR #43 那三条红 shard 都落在它未触碰的文件上。本 PR 修根因、对齐一条、并放开一条抖动界:

  1. CI 钉住 pi 版本(.github/workflows/ci.yml 三处加 @1.0.0)—— 今天 CI 装的本来就是 1.0.0 ⇒ 行为不变,但从此升版必须是一笔可审的改动。
  2. 把 Calm 的 off 路径对齐 1.0.0 的 stock 渲染:1.0.0 把 ToolExecutionComponent.createCallFallback() 从「只显工具名」改成 formatToolCallWithArgs(title, args, theme, expanded);本仓扩展的 renderCall 仍按旧形状 ⇒ stock-render-consumers 那条「Calm-off ≡ Pi stock」的逐字节比较变红。改法:在本仓镜像同一形状(pi 未公开导出该 helper,而本仓扩展只从公开入口 import),不变量按新 stock 重述,比较与断言都保留;pi 若再改形状,fixture 会立刻红。
  3. serial3 的等待界从 4 秒放宽到 15 秒(tests/fm-wake-queue.test.sh 的 wait_for_exit "$!" 40 → 150,5 处)—— 仍有界,只是给 runner 负载留余量。

证据

① import 崩溃(环境面)前后:修前两条用例都红在 SyntaxError: The requested module '@earendil-works/pi-ai' does not provide an export named 'retryDelayMs'(抛自 pi-coding-agent/dist/core/agent-session.js:17)⇒ 断言根本没执行;环境修好后探针 node --input-type=module -e "await import('<pi>/dist/core/agent-session.js')" rc=0。

② 0.85.1 ↔ 1.0.0 的真实 diff(npm pack @0.85.1 取真对照;两版 dist 共 565 个文件不同),要点在 dist/modes/interactive/components/tool-execution.js:

- createCallFallback() { return new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0); }
+ createCallFallback() { return new Text(formatToolCallWithArgs(this.toolName, this.args, theme, this.expanded), 0, 0); }

③ 两条用例的前后输出:

  • 修前:fm-calm-pi-extension 18 ok + not ok - calm mode was not off by default (missing: 'CALM_E2E_OUTPUT');fm-pi-branch-extension not ok - Pi outcomes rendering consumers must preserve stock behavior … Error: Calm-off ToolExecutionComponent rendering differs from Pi stock。
  • 修后:见下。

自证(本机,pi 1.0.0)

$ timeout 120 bash tests/fm-pi-branch-extension.test.sh
ok - …(42 项全过,0 个 not ok)⇒ rc=0

fm-calm-pi-extension 那条(CALM_E2E_OUTPUT)本机未复跑:它同族但需更长时限,按约定交 CI 复跑判定;若仍红,那时才有可读的真实输出可据以改(不放宽判据)。

未做

  • 不深引 pi 的 formatToolCallWithArgs(本仓扩展只从公开入口 import);请上游公开导出由维护环另行禀报,本 PR 不跨仓。
  • fm-test-suite-over-30m(每步 30 分钟硬顶)与本次漂移不是同一根因,另做。
English

Summary

CI red came from upstream pi drift: the workflow installs pi with no version, so 1.0.0 publishing upstream moved CI by itself, and all three red shards landed in files the change under test never touched.

  1. Pin pi in CI (three sites get @1.0.0) - behaviour-preserving today, and from now on a version bump is one reviewable change.
  2. Align Calm's off path with 1.0.0's stock call header: 1.0.0 changed ToolExecutionComponent.createCallFallback() from the bare bold tool name to formatToolCallWithArgs(title, args, theme, expanded), so the byte-equality check "Calm-off equals Pi stock" went red. The shape is mirrored here because pi does not export that helper and this repository's extensions import only the public entry; the invariant is restated against the new stock and every assertion stays. If pi changes the shape again, the fixture reds at once.
  3. Widen serial3's wait bound from 4 seconds to 15 (five sites in tests/fm-wake-queue.test.sh): still bounded, with room for runner load.

Evidence: the import crash before and after (environment), the real 0.85.1 versus 1.0.0 diff of tool-execution.js, and the two suites' before and after output. Local self-proof: timeout 120 bash tests/fm-pi-branch-extension.test.sh exits 0 with 42 ok and no failures. fm-calm-pi-extension was not re-run locally and is left to CI; a red there is fixed from CI's own output, never by widening an assertion.

CI installs pi with no version, so upstream 1.0.0 publishing moved CI by
itself; the red shards landed in files the change under test never touched.
Pi 1.0.0 renders a tool call's own header as title plus arguments
(createCallFallback now calls formatToolCallWithArgs), so the outcomes tools'
renderCall no longer matched Pi's stock fallback byte for byte and the
stock-render fixture went red. Mirror that shape here, because pi does not
export the helper and this repository's extensions import only the public
entry; the byte-equality fixture still guards it. Pin the pi version in the
workflow, and widen fm-wake-queue's wait bound from 4 to 15 seconds: bounded,
with room for runner load.
@onyx-space

Copy link
Copy Markdown
Owner Author

Closing this hand-opened PR: the repo's GitHub-side gate requires the PR to be raised through the no-mistakes pipeline, so this one can never pass 'PR must be raised via no-mistakes'. The diff is unchanged and is being shipped through the pipeline instead (branch fm/ci-pi-100-drift-f1a2, commit 645b6a1).

@onyx-space onyx-space closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant