feat(coding-agent): add turn boundary renderer hook - #44
Conversation
baby-joel
left a comment
There was a problem hiding this comment.
Adversarial review of exact head 471f50211e5194afba12cb427d317ae0ab989bf4 found two change requests.
-
packages/coding-agent/src/modes/interactive/components/turn-boundary-renderer.ts:35: when a transform mutatescontextand then throws or returns an invalid component, the fallback receives that same mutated object. This breaks per-layer fallback isolation: a failed extension can still change what the previous renderer displays. Fix and regression test: #45. -
packages/coding-agent/src/modes/interactive/interactive-mode.ts:3350:chatContainer.children.lengthtreats any prior transcript component as a prior user turn. A startup notice, custom message, or bash item therefore invokes the extension hook for the first rendered user message, contrary to the public contract. The existing default spacer should remain, but the hook should start only after a rendered user/skill turn. Fix and regression test: #46.
I also traced later-transform wrapping order, direct and queued prompt source correlation and cleanup, default no-extension spacing, replay rebuilds, skill rendering, and public type exports. Queued source identity is preserved because agent-core enqueues and emits the same message object; source entries are consumed on delivery and direct entries are removed in finally.
Focused validation after hydrating the repository's ignored model data: turn-boundary renderer and interactive-mode tests (6 passed), agent-session prompt tests (13 passed), plus focused Biome and git diff --check for each fix. Root typecheck and hosted CI remain red on the same two unrelated packages/ai/test errors (abort.test.ts:157 and openai-completions-tool-choice.test.ts:1416).
|
Additional change request from release-surface closeout: |
…y-fallback-isolation fix(coding-agent): isolate turn boundary fallbacks
…oundary fix(coding-agent): skip boundary hook for first user turn
Summary
Add a dedicated, chainable
registerTurnBoundaryRendererextension hook for rendering the boundary before non-initial user turns.The default remains Pi's existing blank
Spacer(1). Extensions can wrap or replace that fallback without taking over user-message rendering.Behavior
InputSource, andisReplaythroughTurnBoundaryContext.isReplay: false.── turn ──example.Validation
git diff --check: passed.npm run check: formatting passed; the check then reached two unrelated AI test/type failures caused by live model-catalog drift (claude-opus-4-1membership and currentmaxTokensFieldcompatibility typing). Generated model files were restored byte-for-byte with no AI diff../test.shwith direct NVM Node/npm: agent package reached 235 passed / 1 skipped with two baseline workspace-resolution failures; AI reached 753 passed / 785 skipped with the same two live-catalog expectation failures. Coding-agent continued without an observed patch failure until the bounded 900-second run timed out. No orphan processes or temporary suite artifacts remain.No changelog entry is included, per this repository's contributing guidance.