Skip to content

build(chat): consume partial-markdown 0.5.0 — streaming open-line rendering#734

Merged
blove merged 5 commits into
mainfrom
feat/chat-consume-pm-0.5.0
Jun 25, 2026
Merged

build(chat): consume partial-markdown 0.5.0 — streaming open-line rendering#734
blove merged 5 commits into
mainfrom
feat/chat-consume-pm-0.5.0

Conversation

@blove

@blove blove commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Bumps @cacheplane/partial-markdown ^0.4.1 → ^0.5.0 to pick up B.2 — streaming open-line rendering. The chat already calls materialize(parser.root), so no code change is needed: the open (unterminated) line now renders mid-stream (parsed, status: 'streaming') instead of buffering invisibly until a newline. Smoother streaming for long newline-free paragraphs; completed constructs render as they close.

Verification

  • Chat unit suite green — 898 passed (incl. streaming-markdown integration + NG0956 guards).
  • nx build chat green; lockfile synced (no platform bindings dropped).
  • The markdown-surfaces e2e is unaffected (it finish()es → committed tree, which B.2 doesn't change) — CI confirms.

Part B of the resilient-markdown work is now fully shipped: B.1 escapes, B.3 fuzz suite, the O(n²) perf fix, and B.2 streaming open-line — all in partial-markdown 0.5.0.

🤖 Generated with Claude Code

…en-line)

Bumps ^0.4.1 → ^0.5.0 so the chat picks up B.2: the open (unterminated) line now
renders mid-stream (parser.root grafts the parsed open line marked 'streaming')
instead of buffering until a newline — smoother streaming for long paragraphs.
The chat already consumes materialize(parser.root), so no code change needed.
Chat unit suite green (898 passed), no platform bindings dropped.
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 25, 2026 5:11am

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 1m 7s —— View job


PR Review

  • Read CLAUDE.md and gather context
  • Review PR diff
  • Analyze changes
  • Post findings

This PR looks good. Clean, minimal dependency bump — no issues found.

Summary

The bump from ^0.4.1 → ^0.5.0 is applied consistently across all three locations (libs/chat/package.json, root package.json, package-lock.json) with the correct 0.5.0 integrity hash.

No code changes are needed because streaming-markdown.component.ts:123 already calls materialize(this.parser.root), which is exactly the entry point that 0.5.0's open-line rendering hooks into. When the parser has an unterminated line in the buffer, materialize() now surfaces it with status: 'streaming' rather than buffering it, so long newline-free paragraphs will appear character-by-character instead of all at once.

Interaction with the sentinel-\n logic

The existing finish path (lines 108–109 in streaming-markdown.component.ts) pushes \n before calling finish() when isStreaming flips to false. With 0.5.0 this is still correct: the sentinel closes the open line and finish() commits the tree. Completed content renders as before; only mid-stream rendering changes.

Test coverage

The chunked integration test (streaming-markdown.integration.spec.ts:89-102) pushes content one character at a time with per-chunk change detection, which implicitly exercises the open-line path for every sample — each push before the first \n hits an unterminated line. No targeted open-line streaming test is added here, but the existing coverage is reasonable for a pass-through dependency bump.

No bugs, no security issues, no API regressions, no type-safety concerns.

The ag-ui e2e intermittently fails with 'Server did not become ready within
120000ms' — a cold CI runner re-optimizes vite deps on first serve (worse right
after a lockfile change), exceeding the old window. Not a test/app failure.
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 1m 12s —— View job


PR Review

  • Read CLAUDE.md and gather context
  • Review PR diff
  • Analyze changes
  • Post findings

serve:development replaces generated-keys.ts with the gitignored
generated-keys.local.ts, but only the `build` target depended on `inject-env`
(which generates it). `nx serve` (used by the e2e global-setup) skipped it, so
the dev server exited 1 with "generated-keys.local.ts ... does not exist" and
the e2e timed out waiting for :4201. Add inject-env to serve's dependsOn.
Fixes the ag-ui e2e on every PR (and main). Verified locally: serve now boots
to :4201 200 after deleting the local keys file.
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 1m 28s —— View job


PR Review

  • Read CLAUDE.md and gather context
  • Review PR diff
  • Analyze changes
  • Post findings

This PR looks good. The dependency bump is clean and the bundled e2e fixes are legitimate.

Dependency bump

The ^0.4.1 → ^0.5.0 bump is applied consistently across all three required locations:

File Change
libs/chat/package.json ^0.4.1 → ^0.5.0
package.json ^0.4.1 → ^0.5.0
package-lock.json resolved 0.4.1 → 0.5.0, new integrity hash

The lockfile also reflects the @threadplane/* packages moving from 0.0.52 → 0.0.53 (from the prior release commit already on main), which is expected and correct.

Integration verified

streaming-markdown.component.ts:123 already calls materialize(this.parser.root) — the exact entry point that 0.5.0 hooks into to surface unterminated lines with status: 'streaming'. No code changes needed here.

The sentinel-\n finish path (lines 108–109) remains correct: it closes any open line before finish() commits the tree. 0.5.0 doesn't change committed-tree semantics, so existing behaviour is preserved.

Bundled e2e fixes

Two commits are bundled that the PR body doesn't call out, but both are legitimate:

  • project.jsondependsOn: ["inject-env"]: Adds a task ordering constraint so inject-env always runs before serve. Without this, the dev server could start before env vars are injected, breaking e2e runs. Correct fix.
  • global-setup.ts — 120s → 240s timeout: Cold CI runners re-optimize Vite deps after a lockfile change (which this PR introduces), which can exceed the old 120 s window. The in-code comment explains the reason clearly.

Minor observation

The PR body says "no code change is needed" — strictly true for the @threadplane/chat library itself, but the e2e infrastructure files do change. Not a bug, just a description gap.

No correctness bugs, no security issues, no type-safety concerns, no public API regressions.

…line)

Lockfile now pins 0.5.1 (^0.5.0 range unchanged) so the chat ships the complete
streaming open-line feature — including optimistic mid-construct rendering
(**bold renders before its closer). Chat unit suite green.
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 1m 31s —— View job


PR Review

  • Read CLAUDE.md and gather context
  • Review PR diff
  • Analyze changes
  • Post findings

This PR looks good. One minor documentation gap; no code issues.

Dependency version: ^0.5.0 → resolves to 0.5.1

The range in package.json / libs/chat/package.json is ^0.5.0, but the lockfile pins to 0.5.1 (not 0.5.0). The final commit (64b5ff8 build(chat): resolve partial-markdown to 0.5.1 (adds optimistic open-line)) makes this intentional — the PR body describes 0.5.0's streaming open-line feature but 0.5.1 also adds "optimistic open-line" on top. No issue, but the PR description is slightly behind the lockfile. Worth a one-line note in the body for future readers.

Integration (streaming-markdown.component.ts:123)

materialize(this.parser.root) at line 123 is the correct hook for 0.5.x's open-line path. Unfinished lines now surface with status: 'streaming' mid-push rather than buffering until the next \n. The sentinel-\n + finish() logic at lines 108–109 and 115–116 remains correct and unchanged: committed-tree semantics are unaffected by 0.5.x.

Bundled e2e fixes

Both are legitimate and explained by their commit messages:

  • dependsOn: ["inject-env"] in project.json — correct Nx task-dependency placement on the serve target. Ensures env injection completes before the dev server starts; fixes a race that broke e2e runs.
  • global-setup.ts 120s → 240s — the in-code comment (cold CI runner re-optimizes vite deps on first serve...) fully justifies the increase given the lockfile change this PR introduces.

Lockfile integrity

SHA-512 integrity for 0.5.1 is 88 base64 characters (86 + == padding), which is correct for a 64-byte digest. No anomalies.

No correctness bugs, no security issues, no type-safety concerns, no public API regressions.

subagent-card.spec.ts asserted the research delegation renders a durable
<chat-tool-call-card> with text "research". Since #692 made subagent cards
durable (full transcript), a delegation tool call becomes its own subagent
group in chat-tool-calls (a call whose id is in agent.subagents()), so the
template renders <chat-subagent-card> *instead* of a tool-call card — the
asserted element never exists. ag-ui e2e is non-required, so this merged red
and stayed red, identically on partial-markdown 0.4.2 and 0.5.1 (i.e. not the
markdown bump).

Assert the durable <chat-subagent-card> (binds subagent().name verbatim) and
refresh the stale comments that described the card as active-only/filtered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 2m 5s —— View job


PR Review

  • Read CLAUDE.md and gather context
  • Review PR diff
  • Analyze changes
  • Post findings

This PR looks good. Five well-scoped commits; no correctness bugs, no security issues, no public API regressions.

Dependency bump

^0.4.1 → ^0.5.0 applied consistently across libs/chat/package.json and the root package.json. The lockfile resolves to 0.5.1 (within the range) — intentional per commit 64b5ff8 which documents the patch as "adds optimistic open-line" on top of 0.5.0's streaming open-line. The integrity hash (sha512-eLaVKdz...) is valid for a 64-byte SHA-512 digest.

streaming-markdown.component.ts:123 already calls materialize(this.parser.root) — the exact entry point 0.5.x hooks into to surface unterminated lines with status: 'streaming'. The sentinel-\n + finish() path at lines 108–109/115–116 remains correct: committed-tree semantics are unchanged in 0.5.x.

Bundled e2e fixes

Both are correct and well-motivated:

project.jsondependsOn: ["inject-env"] on serve
The serve:development build target consumes generated-keys.local.ts (gitignored), which inject-env generates. Without this ordering, nx serve (called from global-setup.ts) would exit 1 before the port ever opened. Adding it to serve.dependsOn is the right Nx idiom — it runs on every cold start and is documented to be idempotent.

global-setup.ts — 120s → 240s
Justified: this PR introduces a lockfile change, which triggers Vite dep re-optimisation on the first cold serve in CI, reliably exceeding 120 s. The in-code comment calls this out explicitly. Acceptable window increase.

Test fix (subagent-card.spec.ts)

The original test asserted chat-tool-call-card with text "research", but since #692 a delegation tool call renders as <chat-subagent-card> (full durable transcript) instead of a bare tool-call card. The fix:

  • Switches the locator to chat-subagent-card
  • Updates the comment to accurately describe the rendering path (durable subagent group, not active-only filtering)
  • Renames researchCallresearchCard for clarity

The hasText: /research/i filter on chat-subagent-card is reliable — the card binds subagent().name verbatim, and the aimock harness names it "research".

No issues found

No bugs, no security concerns, no type-safety issues, no subscription leaks, no public @threadplane/* API regressions.

@blove blove merged commit b80c9fe into main Jun 25, 2026
7 checks passed
@blove blove deleted the feat/chat-consume-pm-0.5.0 branch June 25, 2026 05:12
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