Skip to content

Commit b80c9fe

Browse files
bloveclaude
andauthored
build(chat): consume partial-markdown 0.5.0 — streaming open-line rendering (#734)
* build(chat): consume @cacheplane/partial-markdown 0.5.0 (streaming open-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. * test(ag-ui): raise e2e dev-server ready timeout 120s → 240s 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. * fix(ag-ui): run inject-env before serve so e2e dev-server starts 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. * build(chat): resolve partial-markdown to 0.5.1 (adds optimistic open-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. * test(ag-ui): assert durable subagent card for research delegation 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> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent feff1bd commit b80c9fe

6 files changed

Lines changed: 36 additions & 34 deletions

File tree

examples/ag-ui/angular/e2e/global-setup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export default async function globalSetup(): Promise<void> {
7878
angular.stdout?.on('data', (b) => process.stdout.write(`[angular] ${b}`));
7979
angular.stderr?.on('data', (b) => process.stderr.write(`[angular] ${b}`));
8080

81-
await waitForPort('http://localhost:4201/', 120_000);
81+
// 240s: a cold CI runner re-optimizes vite deps on first serve (especially
82+
// after a lockfile change), which can exceed the old 120s ready window.
83+
await waitForPort('http://localhost:4201/', 240_000);
8284
// eslint-disable-next-line no-console
8385
console.log('[aimock-e2e] angular ready on :4201');
8486

examples/ag-ui/angular/e2e/subagent-card.spec.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@ interface SubagentProbe {
2020
}
2121

2222
// Reads the live `agent.subagents()` projection off the shell component via
23-
// Angular's dev-mode global. The chat-subagents primitive renders a
24-
// <chat-subagent-card> for each subagent whose status is pending/running, and
25-
// the card binds the ORDERED transcript: `messages()` (the assistant turn(s)
26-
// the child streamed, each carrying `toolCallIds`/reasoning) and `toolCalls()`
27-
// (the child's own `lookup` calls, rendered as <chat-tool-call-card>). Under
28-
// the aimock harness the run settles near-instantly (started → finished within
29-
// one SSE flush), so the card transits the RUNNING state below a render frame
30-
// and is filtered out of the DOM by the time the assistant turn finalizes —
31-
// exactly the reason the cockpit subagents spec (and the original card spec)
32-
// asserts on durable signals rather than the card element. We read the
33-
// projected map directly: it IS the data the card renders, and it proves the
34-
// ACTIVITY snapshot/delta pipeline reconstructed the full reason→tool→answer
35-
// transcript and that it settled to `complete`.
23+
// Angular's dev-mode global. The chat-tool-calls primitive renders a durable
24+
// <chat-subagent-card> for each delegation tool call, and the card binds the
25+
// ORDERED transcript: `messages()` (the assistant turn(s) the child streamed,
26+
// each carrying `toolCallIds`/reasoning) and `toolCalls()` (the child's own
27+
// `lookup` calls, rendered as <chat-tool-call-card>). We read the projected map
28+
// directly rather than scraping the rendered card: it IS the data the card
29+
// renders, and asserting on it proves the ACTIVITY snapshot/delta pipeline
30+
// reconstructed the full reason→tool→answer transcript and settled to
31+
// `complete`, independent of card layout.
3632
async function readSubagents(page: Page): Promise<SubagentProbe> {
3733
return page.evaluate(() => {
3834
const ng = (window as unknown as { ng?: { getComponent?: (el: Element) => unknown } }).ng;
@@ -81,13 +77,16 @@ test('research delegation reconstructs the multi-message subagent transcript', a
8177
await input.fill('Research Angular signals and summarize');
8278
await page.getByRole('button', { name: /send/i }).click();
8379

84-
// The orchestrator dispatched the research subagent — its tool-call card is a
85-
// durable DOM signal (renders the tool name verbatim), unlike the
86-
// active-only subagent card.
87-
const researchCall = page
88-
.locator('chat-tool-call-card')
80+
// The orchestrator dispatched the research subagent. A delegation tool call
81+
// renders as a durable <chat-subagent-card> (the full child transcript)
82+
// anchored to that call — it supersedes a bare tool-call card for the turn
83+
// (see the chat-tool-calls grouping: a call with a matching subagent is its
84+
// own subagent group). The card binds the subagent name verbatim, so it is a
85+
// stable DOM signal to wait on.
86+
const researchCard = page
87+
.locator('chat-subagent-card')
8988
.filter({ hasText: /research/i });
90-
await expect(researchCall.first()).toBeVisible({ timeout: 30_000 });
89+
await expect(researchCard.first()).toBeVisible({ timeout: 30_000 });
9190

9291
// Wait for the parent turn to finalize so the full run (delegation + child
9392
// reason/tool/answer loop + settle) has played out.

examples/ag-ui/angular/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"serve": {
7777
"continuous": true,
7878
"executor": "@angular/build:dev-server",
79+
"dependsOn": ["inject-env"],
7980
"options": {
8081
"port": 4201,
8182
"proxyConfig": "examples/ag-ui/angular/proxy.conf.mjs"

libs/chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@cacheplane/partial-json": ">=0.1.1 <0.3.0",
13-
"@cacheplane/partial-markdown": "^0.4.1"
13+
"@cacheplane/partial-markdown": "^0.5.0"
1414
},
1515
"peerDependencies": {
1616
"zod": "^3.25.0",

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"@angular/platform-browser": "~21.1.0",
114114
"@angular/router": "~21.1.0",
115115
"@cacheplane/partial-json": "^0.1.1",
116-
"@cacheplane/partial-markdown": "^0.4.1",
116+
"@cacheplane/partial-markdown": "^0.5.0",
117117
"@langchain/core": "^1.1.33",
118118
"@langchain/langgraph-sdk": "^1.7.4",
119119
"@neondatabase/serverless": "^0.10.0",

0 commit comments

Comments
 (0)