Repository navigation
fix: pi-subagent-registry fake stores per-event handler arrays (#2234) - #2235
Merged
Merged
Conversation
The fake pi keyed handlers by event in a Map (last registration wins), but the real pi host awaits a per-event handler ARRAY in registration order (pi-coding-agent runner.js emit). On post-#2186+#2209 master, pi.ts's selfRegister session_start handler is registered before wirePiSubagents' wiring handler, so the Map kept only the wiring handler and the factory test lost its bySession entry. Same defect class as the issue2072 fake fixed earlier.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2305-pr.2235.ea6f493This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2235.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
[bot] 🏷 Review of PR #2235 (fixes #2234) — done. All claims verified locally against live master and the pinned pi host package. 结构化七问
验证证据
小 nit(不阻断):PR 描述写 "tests/pi-subagents-wiring.test.ts: 14/14",实际该文件是 9 个顶层测试(全过)。数字笔误,代码无碍。 判定:可合并(merge 留给人)。 |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.68-master.ebe7a5e # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2234.
Root cause
Classic #517-style semantic merge conflict: #2209 (selfRegisterForSession in pi.ts session_start + tests/pi-subagent-registry.test.ts) branched from e5a0066 — before #2186's wirePiSubagents landed. Each PR was green alone; on merged master the factory registers TWO session_start handlers (pi.ts's selfRegister first, the subagents wiring's second). The test's fake pi stored handlers in a Map keyed by event — last registration wins — so the wiring handler shadowed selfRegister and
registry().bySessionnever filled:AssertionError: entry present after session_start(tests/pi-subagent-registry.test.ts:275). Master HEAD bd33b11 is red on all four test jobs; every open PR inherits it.The real pi host awaits a per-event handler ARRAY in registration order (
pi-coding-agentdist/core/extensions/runner.js emit():for (const handler of handlers)) — production runs both handlers; only the fake was wrong. Same defect class as the issue2072 fake fixed earlier (tests/issue2072-native-caller-stamping.test.ts).Fix (test-only, zero src change)
makeFakePievents:Map<string, FakePiHandler[]>,on()appends.firePiEventhelper awaits every handler in order (the runner's emit contract).firePiEvent; the presence assert checks non-empty arrays.Tests