Skip to content

test: accept readonly render output from pi 1.6.0 components - #223

Open
SpiGAndromeda wants to merge 1 commit into
mainfrom
fix/pi-1-6-compat
Open

SpiGAndromeda wants to merge 1 commit into
mainfrom
fix/pi-1-6-compat

Conversation

@SpiGAndromeda

@SpiGAndromeda SpiGAndromeda commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

pi 1.6.0 changed Component.render() to return readonly string[], which broke the typecheck of the current-pi compatibility job: test helpers that expect a mutable string[] no longer accept real components. The helpers now take readonly string[], which the pinned 1.2.0 still satisfies.

pi 1.6.0 check

The 1.5.2 to 1.6.0 diffs of the published pi-coding-agent, pi-tui, pi-ai and pi-agent-core packages and the pi-coding-agent changelog were checked against what the extension uses. Apart from the render type, pi 1.6.0 needs no change. These are the changes that could have reached the extension:

  • Aborted tool batches: pi-agent-core no longer stops the tool loop on abort. Every remaining call gets an "Operation aborted" error result and skips the tool_call hook. A probe on 1.2.0 and 1.6.0 returned identical spawn results for aborted child agents (outcome, result text, stats). For the handoff, the same probe showed the same decline, no cut and no refusal left over for the next prompt on both versions; only the turn_end events differ, with more tool results and an aborted instead of an error outcome.
  • session_start: AgentSession.reload() now re-emits it for hosts bound with bindExtensions({}), and RPC session replacement no longer runs it twice. The extension's handler is safe to run again and keeps no run counter.
  • Startup diagnostics: they now go to stderr in non-interactive modes, and json/rpc modes emit entry_appended for entries added during session_start. No e2e test asserts on stderr, and the only entry_appended count is the one for the handoff cut entry.
  • Width helpers: visibleWidth, truncateToWidth and sliceByColumn got faster paths. 1.5.2 and 1.6.0 returned identical output for a set of test strings covering ANSI styling, box drawing, CJK, emoji and the status glyphs of the spawn and model-group renderers.
  • Exports: the public export surface of pi-coding-agent (dist/index.d.ts) is unchanged, and typebox stays at 1.3.27.

node scripts/test-compat-current.mjs passes at 1.6.0, with the unit and e2e projects.

pi-tui 1.6.0 changed `Component.render()` to return `readonly string[]`. The test helpers declared a mutable `string[]` return, so they no longer accepted real components and the current-pi compatibility check failed to typecheck. The helpers in `model-groups-tui.test.ts`, `render-snapshots.test.ts`, `spawn-render.test.ts` and `helpers.ts` now take `readonly string[]`, which the `string[]` returned by the pinned 1.2.0 still satisfies.
@github-actions

Copy link
Copy Markdown

Unit test coverage

lines statements functions branches
Total 88.65% (3689/4161) 88.78% (3815/4297) 93.34% (743/796) 79.96% (2619/3275)
Base (6e8cd36) 88.65% (3689/4161) 88.78% (3815/4297) 93.34% (743/796) 79.96% (2619/3275)
Change ±0.00 ±0.00 ±0.00 ±0.00
Coverage per file (52)
File lines statements functions branches
as-promise.ts 100% (2/2) 100% (2/2) 100% (2/2) 100% (0/0)
frontmatter-cache.ts 95.83% (92/96) 95.83% (92/96) 100% (23/23) 93.91% (108/115)
handoff/boundary.ts 96.42% (135/140) 96.57% (141/146) 100% (23/23) 93.87% (92/98)
handoff/command.ts 100% (16/16) 100% (16/16) 100% (3/3) 95% (19/20)
handoff/copy.ts 100% (16/16) 100% (16/16) 100% (0/0) 100% (0/0)
handoff/eligibility.ts 100% (18/18) 100% (18/18) 100% (5/5) 100% (30/30)
handoff/format.ts 100% (17/17) 100% (17/17) 100% (7/7) 100% (12/12)
handoff/tool.ts 100% (32/32) 100% (32/32) 100% (5/5) 100% (31/31)
index.ts 95.98% (359/374) 96.08% (368/383) 91.93% (57/62) 92.83% (246/265)
model-groups/autocomplete.ts 93.02% (40/43) 92% (46/50) 94.44% (17/18) 76.66% (23/30)
model-groups/availability.ts 100% (2/2) 100% (2/2) 100% (2/2) 100% (2/2)
model-groups/command.ts 78.57% (11/14) 78.57% (11/14) 80% (4/5) 87.5% (7/8)
model-groups/constraints/engine.ts 91.66% (11/12) 92.85% (13/14) 100% (7/7) 87.5% (7/8)
model-groups/constraints/modalities.ts 92.15% (47/51) 92.3% (60/65) 90.24% (37/41) 91.52% (54/59)
model-groups/constraints/presentation.ts 100% (16/16) 100% (16/16) 100% (6/6) 62.5% (5/8)
model-groups/constraints/registry.ts 100% (9/9) 100% (12/12) 100% (4/4) 100% (4/4)
model-groups/constraints/resolution.ts 100% (1/1) 100% (2/2) 100% (2/2) 100% (0/0)
model-groups/constraints/types.ts 0% (0/0) 0% (0/0) 0% (0/0) 0% (0/0)
model-groups/display.ts 98.14% (53/54) 98.18% (54/55) 100% (3/3) 98% (49/50)
model-groups/modalities.ts 100% (7/7) 100% (7/7) 100% (3/3) 100% (0/0)
model-groups/modality.ts 100% (29/29) 100% (30/30) 100% (2/2) 100% (34/34)
model-groups/names.ts 100% (1/1) 100% (1/1) 100% (1/1) 100% (0/0)
model-groups/prompt.ts 100% (7/7) 100% (7/7) 100% (3/3) 83.33% (5/6)
model-groups/router.ts 98.24% (112/114) 98.36% (120/122) 100% (30/30) 92.59% (100/108)
model-groups/store.ts 94.69% (250/264) 94.77% (254/268) 100% (51/51) 90.09% (200/222)
model-groups/tui.ts 90.05% (616/684) 90.2% (645/715) 89.47% (119/133) 80.32% (351/437)
model-groups/types.ts 100% (5/5) 100% (5/5) 100% (1/1) 100% (0/0)
notebook/pager.ts 94.33% (50/53) 94.33% (50/53) 90% (9/10) 85.36% (35/41)
notebook/prompt.ts 100% (12/12) 100% (12/12) 100% (6/6) 85.71% (12/14)
notebook/rehydration.ts 100% (57/57) 100% (58/58) 100% (6/6) 92% (46/50)
notebook/store.ts 96.82% (61/63) 96.96% (64/66) 100% (14/14) 89.47% (34/38)
notebook/tools.ts 96.72% (59/61) 96.72% (59/61) 100% (13/13) 78.43% (40/51)
notebook/topic-tool.ts 100% (9/9) 100% (9/9) 100% (3/3) 100% (8/8)
notebook/topic.ts 100% (14/14) 100% (14/14) 100% (3/3) 100% (6/6)
notifications.ts 100% (44/44) 100% (44/44) 100% (21/21) 100% (2/2)
os-sandbox.ts 80.51% (62/77) 80.76% (63/78) 94.11% (16/17) 84.21% (48/57)
prompt-sections.ts 100% (21/21) 100% (22/22) 100% (6/6) 100% (10/10)
readonly-bash.ts 62.8% (439/699) 62.98% (451/716) 76.47% (52/68) 53.5% (359/671)
readonly-boundary.ts 94.73% (18/19) 94.73% (18/19) 100% (4/4) 86.66% (13/15)
readonly-rehydration.ts 100% (12/12) 100% (13/13) 100% (1/1) 100% (10/10)
resolve-path.ts 88.88% (8/9) 88.88% (8/9) 100% (1/1) 50% (1/2)
runtime-singletons.ts 100% (9/9) 100% (9/9) 80% (4/5) 100% (4/4)
spawn/index.ts 98.69% (227/230) 98.75% (238/241) 100% (49/49) 92.22% (178/193)
spawn/renderer.ts 89.34% (503/563) 89.35% (512/573) 91.66% (77/84) 74.27% (332/447)
spawn/shared.ts 100% (13/13) 100% (14/14) 100% (2/2) 100% (8/8)
state.ts 96.55% (56/58) 96.55% (56/58) 83.33% (10/12) 100% (2/2)
system-prompt.ts 100% (3/3) 100% (5/5) 100% (4/4) 100% (0/0)
temp-dir.ts 80% (4/5) 80% (4/5) 100% (1/1) 100% (0/0)
thinking-levels.ts 100% (2/2) 100% (2/2) 100% (1/1) 100% (0/0)
time/format.ts 93.33% (28/30) 93.54% (29/31) 100% (10/10) 80% (12/15)
tui.ts 100% (25/25) 100% (25/25) 100% (1/1) 92.85% (26/28)
watchdog.ts 100% (49/49) 100% (49/49) 100% (12/12) 96.42% (54/56)

Commit c3be193, attempt 1 of the workflow run; the HTML report is in that attempt's coverage artifact.

@grzegorznowak grzegorznowak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome thanks a tonne!

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.

2 participants