Commit Graph

12629 Commits

Author SHA1 Message Date
Austin Merrick 5e828aed9d fix(angular): emit fresh messages array so OnPush views render on addMessage (#5418)
Fixes #5416

## Problem

`AgentStore` mirrored the agent's messages into a signal via
`this.#messages.set(abstractAgent.messages)`. `AbstractAgent.addMessage`
pushes **in place** and notifies with the **same array reference**.
Angular signals compare with `Object.is`, so `set(sameRef)` is a no-op:
the signal never notifies, the OnPush `<copilot-chat>` view is never
marked dirty, and a freshly added message — including the user's own
bubble on submit — does not render until the run pipeline reassigns
`messages` to a new array at run completion.

## Fix

```ts
this.#messages.set([...abstractAgent.messages]);
```

A shallow copy gives the array a new identity, so the signal notifies
and OnPush views re-render immediately. The `Message` objects stay
referentially stable, so `trackBy` still avoids re-creating existing
bubbles.

`onStateChanged` is intentionally left unchanged: `AbstractAgent`
reassigns `this.state` to a freshly cloned reference on every change
(`setState(e) { this.state = clone(e) }`) and never mutates state in
place, so that signal already notifies correctly. Scoping the fix to
messages keeps it minimal.

## Tests

Added two regression tests in `agent.spec.ts`, both exercising the
in-place mutation path that the existing tests never hit (they assign a
fresh array each emit):

1. **Reference guard** — the store must not hand back the agent's live
`messages` array.
2. **OnPush re-render** — a count rendered in an OnPush *descendant* (a
root `detectChanges()` would force-check the root and hide the bug; only
a child whose dirty flag depends on the signal exposes it). Two in-place
pushes; the second is the same-reference no-op the fix repairs.

Both tests fail without the fix (`'1' to be '2' // Object.is equality`)
and pass with it.

## Verification

- `agent.spec.ts`: 6/6 pass
- full `@copilotkitnext/angular` suite: 50/50 pass
- `tsc --noEmit`: clean
2026-06-12 10:08:03 -07:00
Ben Taylor 6bbf33aee6 fix(shared): preserve lambda client cjs export (#5419)
## Summary
- export the telemetry lambda client as a named binding instead of
default-reexporting it through the shared barrel
- update shared telemetry internals/tests to consume the named binding
- add a built-package smoke check to ensure both CommonJS and ESM expose
`lambdaClient.send`

## Root Cause
`@copilotkit/shared` re-exported `lambdaClient` from a default export.
The unbundled CommonJS build emitted `exports.lambdaClient =
require_lambda_client`, so CommonJS consumers received the module
namespace object instead of the `{ send }` client. `@copilotkit/runtime`
then called `lambdaClient.send(...)` and crashed because `send` was
nested under `lambdaClient.default`.

## Validation
- `pnpm nx run @copilotkit/shared:build --skip-nx-cache`
- `node packages/shared/scripts/verify-cjs-exports.cjs`
- `pnpm nx run @copilotkit/shared:test --skip-nx-cache`
- `pnpm nx run @copilotkit/shared:check-types --skip-nx-cache`
- `pnpm nx run @copilotkit/shared:publint --skip-nx-cache`
- `pnpm nx run @copilotkit/runtime:build --skip-nx-cache`
- runtime CJS telemetry capture smoke test
- `pnpm nx run @copilotkit/runtime:test --skip-nx-cache --
src/v2/runtime/__tests__/telemetry.test.ts`
- pre-commit hook: `pnpm run test && pnpm run check:packages`
2026-06-12 12:01:14 -05:00
Tyler Slaton d33c40c56a fix(react-core): scope streamdown markdown styles (#5099)
## Summary

Fixes #5072 

Fix unstyled Streamdown markdown in non-Tailwind apps that import
`@copilotkit/react-core/v2/styles.css`.

Streamdown renders plain utility class names, but CopilotKit’s CSS
bundle is generated with the `cpk:` Tailwind prefix. That left default
markdown elements like headings, lists, strong text, tables,
blockquotes, inline code, and code blocks without matching styles unless
the host app also shipped unprefixed Tailwind utilities.

## Changes

-> Add scoped fallback styles for Streamdown’s stable `data-streamdown`
elements under `[data-copilotkit]`.
-> Use CopilotKit theme variables and prefixed Tailwind utilities so
styles stay inside the CopilotKit surface.
-> Remove the ineffective Streamdown `@source` scan, since it only
generated prefixed utilities that Streamdown does not emit.
-> Add a regression test to ensure the scoped Streamdown selectors
remain present.

## Testing

-> `node node_modules\nx\bin\nx.js run @copilotkit/react-core:build:css
--excludeTaskDependencies`
-> `node node_modules\nx\bin\nx.js run @copilotkit/react-core:test
--excludeTaskDependencies --skip-nx-cache --
src/v2/styles/__tests__/streamdown-styles.test.ts`
2026-06-12 09:58:30 -07:00
Austin Merrick 9275ec2ce0 fix(react-core): cover mermaid-block + sub/superscript streamdown styles 2026-06-12 09:49:45 -07:00
Tushar-Khandelwal-2004 f90c3dcfd7 fix(react-core): scope streamdown markdown styles 2026-06-12 09:49:44 -07:00
Mike Ryan 5eea242e1f fix(shared): preserve lambda client cjs export 2026-06-12 09:29:52 -07:00
Marco Castro d11fb33169 fix(angular): drop redundant comment on messages signal copy 2026-06-12 18:21:20 +02:00
Marco Castro aa71a6190c Merge branch 'main' into fix/5416-angular-agentstore-messages-ref 2026-06-12 18:17:36 +02:00
Marco Castro 05c6b9bdcd fix(angular): emit fresh messages array so OnPush views render on addMessage
AgentStore mirrored the agent's messages into a signal via
`this.#messages.set(abstractAgent.messages)`. AbstractAgent.addMessage
pushes in place and notifies with the same array reference, so the
signal's Object.is equality check treats set(sameRef) as a no-op: it
never notifies, the OnPush <copilot-chat> view is never marked dirty,
and a freshly added message (including the user's own on submit) does
not render until the run pipeline reassigns messages to a new array at
run completion.

Copy into a fresh array so the reference changes and the signal
notifies. Message objects stay referentially stable, so trackBy still
avoids re-creating existing bubbles. State is unaffected: AbstractAgent
reassigns this.state to a cloned reference on every change, so its
signal already notifies.

Adds regression tests covering the in-place mutation path: a reference
guard and an OnPush descendant re-render check. Both fail without the
fix.

Fixes #5416
2026-06-12 18:14:36 +02:00
Ran Shemtov 54a99977c8 fix(runtime): add a2ui enabled opt-out via shared isA2UIEnabled predicate (#5385)
## Summary

Follow-up to #5383 (per-agent A2UI scoping). Two small,
backwards-compatible runtime changes:

1. **One shared `isA2UIEnabled()` predicate.** Before, "is a2ui on?" was
computed independently in two places — `if (runtime.a2ui)` in the run
path (`agent-utils.ts`) and `!!runtime.a2ui` in the `/info` response
(`get-runtime-info.ts`). Two separate checks can drift apart, and that
drift between the run path and the info path is the root of #5369. Both
now call the same predicate, so they can't disagree.

2. **An explicit `enabled` off-switch** on the runtime `a2ui` config.
Previously, once `a2ui` was configured there was no way to turn it off
short of deleting the whole block. Now `a2ui: { enabled: false }`
disables it while keeping the rest of the config (e.g.
`schema`/`catalog`) in place.

```ts
export function isA2UIEnabled(a2ui) {
  return !!a2ui && a2ui.enabled !== false;
}
```

## Backwards compatibility

No breaking changes. `enabled` is a new optional field; every existing
config behaves identically:

- omitted `a2ui` → off (unchanged)
- `a2ui: {}` → on (unchanged)
- `a2ui: { injectA2UITool: true }` / `{ agents: [...] }` → on
(unchanged)
- only an explicit `a2ui: { enabled: false }` is new behavior — and it's
an opt-out nobody could have relied on.

Enablement stays entirely server-side; no client/provider API change.

## Scope

This does **not** fix the #5369 leak — #5383 does that via per-agent
scoping. This is complementary hardening: it adds the missing off-switch
and removes the run-path/info-path divergence that allowed the leak to
exist in the first place.

## Tests

- `get-runtime-info`: reports `a2uiEnabled: false` when `a2ui: {
enabled: false }`.
- run path (`handle-run`): does not apply `A2UIMiddleware` when
`a2ui.enabled` is `false`.

https://claude.ai/code/session_01TYohiEJyhsU3mJS4jabdv6

---
_Generated by [Claude
Code](https://claude.ai/code/session_01TYohiEJyhsU3mJS4jabdv6)_
2026-06-12 17:49:56 +02:00
Ran Shemtov f5a2dbbb79 Merge branch 'main' into claude/a2ui-injection-config-9r2ve3 2026-06-12 17:14:30 +02:00
Jordan Ritter 881c24bb2a fix(showcase): content-red dashboard remediation — spring-ai/ag2/cst/llamaindex (#5412)
## Summary

Content-red dashboard remediation across CopilotKit showcase
integrations (spring-ai, ag2, claude-sdk-typescript, llamaindex). Aligns
aimock fixtures (d4 and d6) with real backend output shapes, ports A2UI
v0.9 declarative legs, quarantines unsupported features as NSF with the
canonical d5-feature-mapping literals, adds route aliases the harness
expects, and fixes backend bugs in the per-family agent stacks.

## Verification (local `bin/showcase test <family> --d6`
baseline-vs-branch comparison)

**13 dashboard cells go from RED on `main` to GREEN on this branch:**

| Family | Cells fixed |
|--------|-------------|
| spring-ai | auth, gen-ui-open, gen-ui-open-advanced, headless-simple,
subagents, tool-rendering-custom-catchall |
| ag2 | gen-ui-a2ui-fixed, gen-ui-agent, tool-rendering |
| claude-sdk-typescript | beautiful-chat-search-flights,
gen-ui-a2ui-fixed, gen-ui-agent, tool-rendering |
| built-in-agent | headless-simple ✓ (verified — was the targeted A20
fix) |

**Zero regressions on spring-ai, claude-sdk-typescript.** Pre-existing
reds unchanged.

## ⚠️ Known regression — DOCUMENTED, not yet fixed

- **ag2 / `mcp-apps`**: was GREEN on `main`, RED on this branch.
Per-pill snapshot confirms (`/tmp/cr/baseline-ag2-pills.json` vs
`/tmp/cr/ag2-final-pills.json`). Harness signature: `assistant did not
respond within 30000ms (turns_completed=0)` → "Run ended without
emitting a terminal event". Root cause not localized; suspect
interaction between R7-A1 (`http.disconnect` synthesis dropped from
request-context middleware) and the mcp-apps SSE shutdown path, but the
middleware fix was deliberate ASGI semantics correction and reverting it
re-opens the SSE-abort it was meant to address.

Possible remediations (for follow-up):
1. Investigate the mcp-apps `/api/copilotkit-mcp-apps` SSE close
sequence under R7-A1's "always await real disconnect" semantics. If the
inner FastAPI app holds the channel waiting for a real disconnect, the
harness may time out before uvicorn signals it.
2. Re-evaluate R7-A1: emit a synthetic disconnect ONCE per request, but
ONLY in response to a specific signal (e.g. `more_body=False` for the
inner app's final receive), not unconditionally.

This regression was caught BY the verification gate, NOT bypassed.
Documented here so reviewers can decide ship-as-is + follow-up vs
hold-for-fix.

## Pipeline summary

- 8 cr-loop review rounds, 1000+ findings deduped per round
- 5 fix cycles (R1: 24 items; R2: 10 R2-A regressions + 5 in-diff
bucket-(a); R3: 7 items; R5: 3 items; R7: 4 items; R9: 1 byoc demo
cleanup)
- Procedure 3 bucket-(c) promotion audit: 0 PROMOTE_TO_A
- Rebased onto `origin/main` (203-commit gap caught at pre-push)
- `pre-push-quality` clean: formatter (oxfmt + ruff) green, lint green,
typecheck green, tests green, build green, docker build green
(`showcase-spring-ai:prepush-test` 3.62GB), actionlint green on new
workflow
- Local `bin/showcase test --d6` verification per the user's hard gate —
5 families verified + baseline comparison

## Coordinated work

Coordinated via `coordinate` channel with peer session
`dashboard-cell-fixes` (PR #5407, merged: D6 manifest cleanup +
claude-sdk-python testid backfill, 13 manifests excluding ag2 +
spring-ai). Manifests ag2 + spring-ai are this PR's territory;
non-overlap confirmed.

## Test plan — what improved

Per-family local `bin/showcase test <family> --d6` baseline-on-main vs
branch (per-pill PocketBase snapshots in
`/tmp/cr/{baseline,our}-*-pills.json`). The change attributable to this
PR:

| Family | Δ on D6 dashboard | Cells flipped red → green |
|--------|-------------------|----------------------------|
| **spring-ai** | **+6** | `auth`, `gen-ui-open`,
`gen-ui-open-advanced`, `headless-simple`, `subagents`,
`tool-rendering-custom-catchall` |
| **ag2** | **+2 net** (+3 fixed, −1 regression) | fixed:
`gen-ui-a2ui-fixed`, `gen-ui-agent`, `tool-rendering` · regression:
`mcp-apps` (see ⚠️ above) · also: dangling `byoc` declarative-* demos
removed from manifest |
| **claude-sdk-typescript** | **+4** | `beautiful-chat-search-flights`,
`gen-ui-a2ui-fixed`, `gen-ui-agent`, `tool-rendering` |
| **llamaindex** | **+1** | `gen-ui-agent` (R1-A4 target) —
`shared-state-write` confirmed green |
| **built-in-agent** | **+1** | `headless-simple` (A20 targeted fix) |

**Net dashboard impact: 13 cells red → green, 1 regression
(ag2/`mcp-apps`) = +12 net.**

What landed per family (commit per concern, in stack order):

- **`975d5d80b` spring-ai** — manifest NSF reasoning canon (closes
spring-ai's reasoning-default-render + agentic-chat-reasoning +
tool-rendering-reasoning-chain pills against AG-UI Java SDK's missing
`REASONING_MESSAGE_*` union) + Jackson `@Primary` ObjectMapper bean-race
fix (deterministic JSON wire shape) + `RunErrorEvent` mixin renaming
`error` → `message` for AG-UI core wire compatibility + error-banner
pattern across mcp-apps routes + Java tool JSON hardening + `.ag-ui-sha`
centralized pin source + new `test_unit-spring-ai.yml` workflow +
Dockerfile explicit `git fetch origin $SHA` guard. → fixes the 6
spring-ai cells above by closing the wire-shape gap between spring-ai
and the harness.
- **`2b0ce1065` ag2** — manifest NSF reasoning canon + new ASGI
middleware `_request_context.py` with `_latest_user_message`
`ContextVar` (unblocks per-request user-message threading the harness
asserts on) + async OpenAI client + tool serialization fix + R9-A2
manifest cleanup of stale declarative-* demos. → fixes the 3 ag2 cells.
- **`4e79e3bd1` claude-sdk-typescript** — per-content-block array
refactor for text/thinking/tool_use replay order on Anthropic
`/v1/messages` shape (the core fix) + per-block `randomUUID` + reasoning
route + alias coherence. → fixes the 4 cst cells by aligning Anthropic
content-block sequencing with the harness's strict replay-order check.
- **`5fd4028b4` llamaindex** — `gen-ui` + beautiful-chat agent updates +
mcp-apps + copilotkit route alias coherence + demo-files assets. → fixes
`gen-ui-agent`.
- **`aec5b82ed` per-integration adjacencies** — `@ts-expect-error` swaps
+ agno comment + built-in-agent `headless-simple` UUID fallback + error
banner across agno/crewai-crews/langroid/mastra/pydantic-ai/strands
mcp-apps routes. → fixes built-in-agent `headless-simple`; prevents
banner-render regressions across 6 other families.
- **`a02cfb7a7` aimock** — d4 broad-matcher narrowing + d6 per-family
content-shape alignment + chunkSize emoji surrogate-pair guard +
threadid context gates. → the fixture realignment that makes all the
above backend fixes verifiable end-to-end through the harness.
- **`1f5b90095` Validate Showcase fix** — `KNOWN_SHADOW_CEILING` 123 →
128 in `aimock-fixtures.test.ts` (the d6 content-shape alignment adds
tracked, runtime-disambiguated substring overlaps; this is the test
author's documented escape hatch — see the comment around the constant).

Quality gates run:

- [x] `pre-push-quality` — oxfmt+ruff, lint, typecheck, tests, monorepo
build, `docker build` on `showcase-spring-ai:prepush-test` (3.62 GB
image), actionlint on the new CI workflow — all green
- [x] CI: 43/43 green on `1f5b90095` (Validate Showcase needed attempt
2; `generate-registry.test.ts:211` is a known sentinel-cleanup flake
unrelated to this PR's diff)

**Decision needed**: ship-as-is and roll `ag2/mcp-apps` regression into
the consolidated follow-up PR (alongside the bucket-(c)/(d) deferred
items in `## Follow-up` below), OR hold this PR and fix `mcp-apps` in-PR
first. Two candidate remediations are described in the ⚠️ block above.
## Upstream gaps (flagged, not in scope)

- AG-UI Java SDK lacks `REASONING_MESSAGE_*` typed event union —
spring-ai uses raw-JSON workaround in `ReasoningController` (manifest
declares `reasoning-default-render` + `agentic-chat-reasoning` +
`tool-rendering-reasoning-chain` NSF accordingly)
- aimock has no `customEvents` key — blocks headless-interrupt D6 replay
(interrupt-headless red across all families)
- llama-index `ag-ui` lacks `REASONING_MESSAGE_*` ingestion gap —
manifest declares accordingly
- ag2 image-content rejection — multimodal pill red across ag2 (Python
ValueError in agent.py); separate from this PR

## Follow-up

A consolidated follow-up handoff file documents the deferred
bucket-(c)/(d) items (R2-D1 stack-leak hardening sweep across 11 routes,
R2-D2 customEvents, R2-D3 @copilotkit/runtime agents-generic, R2-D4
mcp.excalidraw.com default URL, R3 misc adjacencies, etc.) for a single
consolidated follow-up PR per the "minimize PRs by aggregating related
work" directive.
2026-06-12 08:11:23 -07:00
Ran Shemtov e0f64c8f9e Merge branch 'main' into claude/a2ui-injection-config-9r2ve3 2026-06-12 17:01:20 +02:00
Jordan Ritter 29bd450534 chore(showcase/aimock): bump KNOWN_SHADOW_CEILING 123→128 for tracked runtime-disambiguated overlaps (PR #5412)
The 5 new substring shadows are in d6 fixtures landed by this PR:
- d6/ag2/gen-ui-declarative.json: 'Show me a quick KPI dashboard' inner-call mirror overlaps with pre-existing 'KPI dashboard' entry in render-a2ui.json (same toolName=render_a2ui, context=ag2). Runtime-disambiguated by load order (inner-call mirrors ordered BEFORE outer generate_a2ui fixtures per the _meta._note in that file).
- d6/claude-sdk-typescript/gen-ui-declarative.json: same pattern as ag2.
- d6/claude-sdk-typescript/tool-rendering.json: dropped userMessage/turnIndex gates on toolCallId-keyed follow-up fixtures (per _shape_note in that file — Anthropic /v1/messages shape needs toolCallId-only gating for multi-pill loop safety). The remaining ungated userMessage fixtures ('weather in Tokyo', 'AAPL') now substring-overlap with gen-ui-headless-complete and tool-rendering-reasoning-chain prompts in the same context. Runtime-disambiguated by toolCallId chains and first-match-wins ordering.

These overlaps are exactly the runtime-disambiguated pattern the test comment endorses for ceiling bumps.
2026-06-12 08:00:05 -07:00
Jordan Ritter 95f726a408 fix(showcase/aimock): consolidate content-red fixture fixes — d4 broad-matcher narrowing, d6 per-family content-shape alignment, chunkSize emoji guard, threadid context gates 2026-06-12 08:00:05 -07:00
Jordan Ritter dd9270fe60 fix(showcase): per-integration adjacencies — @ts-expect-error swaps + agno comment + built-in-agent headless-simple UUID fallback + error banner across agno/crewai-crews/langroid/mastra/pydantic-ai/strands mcp-apps routes 2026-06-12 08:00:05 -07:00
Jordan Ritter e89abefb0f fix(showcase/llamaindex): consolidate content-red fixes — gen-ui agent + beautiful-chat agent updates, mcp-apps + copilotkit route alias coherence, demo-files assets 2026-06-12 07:59:36 -07:00
Jordan Ritter e306e25e42 fix(showcase/claude-sdk-typescript): consolidate content-red fixes — per-content-block array refactor for text/thinking/tool_use replay order, per-block randomUUID, reasoning route + alias coherence 2026-06-12 07:59:36 -07:00
Jordan Ritter 3f601daaea fix(showcase/ag2): consolidate content-red fixes — manifest NSF reasoning canon, ASGI middleware for per-request user-message ContextVar, async OpenAI client, tool serialization, manifest demos cleanup (R9-A2) 2026-06-12 07:59:36 -07:00
Jordan Ritter df1b2d572d fix(showcase/spring-ai): consolidate content-red fixes — manifest NSF reasoning canon, Jackson @Primary mapper + RunErrorEvent wire-shape, error-banner pattern, Java tool JSON hardening, .ag-ui-sha pin + CI workflow 2026-06-12 07:59:35 -07:00
Jordan Ritter 9984c82c66 fix(showcase): D6 reds remediation on built-in-agent — testid backfill + PARITY_NOTES + aimock fixtures + STATE_DELTA wiring (#5413)
## Scope

Built-in-agent integration D6 readiness pass — companion to PR #5407
(merged) which fixed the claude-sdk-python integration. This PR follows
the same PARITY_NOTES pattern.

### What changed

- **~28 testids backfilled across 13 demos**: declarative-gen-ui
renderers, headless-complete (assistant-bubble, user-bubble,
weather-card, highlight-note, input-bar), headless-simple, gen-ui-agent,
a2ui-fixed-schema (definitions + renderers), auth (new `sign-in-card`
component), chat-slots welcome, gen-ui-interrupt cancel.
- **New components**: shared `not-supported-banner` for NSF demos (hitl,
shared-state-streaming); subagents extraction into LGP-mirror components
(`subagent-activity-card`, `delegation-log`,
`supervisor-activity-banner`).
- **2 aimock fixtures**: `gen-ui-a2ui-fixed.json` (new — routes
`display_flight` pill through the Card mount); `gen-ui-declarative.json`
(reshaped to BIA's two-call sequence + flat catalog shape).
- **1 backend wire-up**: `set_steps` tool registered in `state-tools`
and wired through `tanstack-factory` so `gen-ui-agent` emits
`STATE_DELTA` events on its agent-plan stream.
- **PARITY_NOTES.md**: tracks BIA-vs-LGP feature parity + a Known Issues
section.
- **feature-registry.json**: adds `threadid-frontend-tool-roundtrip`
feature entry.

## D6 verify status

- **3 GREEN**: auth, chat-slots, subagents.
- **1 expected-NSF**: gen-ui-interrupt (cancel testid verified).
- **3 still RED with documented downstream root causes** (all require
fixes in `packages/react-core`, outside this PR's scope — see
`PARITY_NOTES.md` "Known Issues"):
  - a2ui-fixed-schema: renderer host doesn't mount Card.
- gen-ui-agent: STATE_DELTA stream emits, but `useAgent`
state-subscription gap prevents the React side from observing the delta.
  - declarative-gen-ui: same renderer-host class as a2ui-fixed-schema.
- **2 additional reds are pre-existing harness issues NOT introduced
here**: headless-complete aimock fixture, headless-simple chip-text
drift.

Verify reports: `/tmp/cr/verify-5425/d6-direct-v2-REPORT.md`.

## Builds on

PR #5407's PARITY_NOTES pattern for documenting integration-vs-LGP gaps
with downstream-tracked known issues.
2026-06-12 07:57:13 -07:00
Ran Shemtov 3788748e32 chore: release monorepo v1.60.1 (#5415) v1.60.1 2026-06-12 15:30:00 +02:00
ranst91 02c3a8aef0 chore: release monorepo v1.60.1 2026-06-12 13:03:45 +00:00
Ran Shemtov 8fb13fd602 fix: update cpk to use latest agui core packages (#5408)
## Summary

- Bumps `@ag-ui/client`, `@ag-ui/core`, and `@ag-ui/encoder` to `0.0.57`
across all packages under `packages/`
- Updates `pnpm-lock.yaml` to reflect the new versions

## Test plan

- [ ] Verify packages build successfully
- [ ] Confirm no runtime regressions in ag-ui communication
2026-06-12 14:52:10 +02:00
Ran Shemtov 246b907ed8 Merge branch 'main' into claude/stupefied-fermi-0c3310 2026-06-12 14:23:17 +02:00
Jordan Ritter 1427475a7e fix(showcase): bump generate-catalog test counts for threadid-frontend-tool-roundtrip feature add 2026-06-12 05:12:24 -07:00
Ran Shem Tov 10a4c38b46 fix(showcase-tests): skip generator in integration-smoke-registry when registry.json exists
Prevents a file-parallelism race where this suite's beforeAll generator
call atomically renamed catalog.json while generate-registry.test.ts was
mid-sentinel-test, clobbering the appended sentinel.
2026-06-12 14:06:53 +02:00
Jordan Ritter 02fcf43d6d docs(showcase): built-in-agent PARITY_NOTES + feature-registry threadid-frontend-tool-roundtrip + known issues
Documentation companion to the BIA D6 readiness work:

- PARITY_NOTES.md: tracks built-in-agent feature parity vs LGP +
  a 'Known Issues' section documenting 3 D6 demos that remain red
  due to downstream renderer/state gaps in @copilotkit/react-core
  (a2ui renderer host doesn't mount Card; STATE_DELTA → useAgent
  state-subscription gap; declarative-gen-ui renderer host shares
  the same class). All three require fixes outside this PR's scope.
- feature-registry.json: adds threadid-frontend-tool-roundtrip
  feature entry covering the new gen-ui-agent STATE_DELTA wiring.
2026-06-12 05:02:39 -07:00
Jordan Ritter 9abe8a183f fix(showcase/built-in-agent): wire set_steps tool for gen-ui-agent STATE_DELTA stream
Adds the set_steps tool definition to state-tools and wires it through
the tanstack factory so the gen-ui-agent demo emits STATE_DELTA events
on its agent-plan stream the same way the LGP integration does.
2026-06-12 05:02:32 -07:00
Jordan Ritter c49da076dd fix(showcase/aimock): add gen-ui-a2ui-fixed + reshape gen-ui-declarative fixtures for built-in-agent D6
Two aimock fixture updates to unblock built-in-agent D6 verification:

- gen-ui-a2ui-fixed.json: new fixture so display_flight pill routes
  the Card mount through the a2ui-fixed-schema renderer host
- gen-ui-declarative.json: reshaped to the built-in-agent two-call
  sequence with the flat catalog shape the BIA route emits
2026-06-12 05:02:26 -07:00
Jordan Ritter 99aafd0283 feat(showcase/built-in-agent): extract subagents DelegationCard into LGP-mirror components
Extracts the inline subagents page DelegationCard into three reusable
components that mirror the LGP integration layout, enabling D6 testid
coverage:

- subagent-activity-card.tsx: per-subagent activity panel
- delegation-log.tsx: cumulative delegation event log
- supervisor-activity-banner.tsx: supervisor-level status banner

The subagents page now composes these components instead of inlining
the markup, with data-testid hooks for D6 selectors.
2026-06-12 05:02:20 -07:00
Jordan Ritter b6750b7423 fix(showcase/built-in-agent): D6 testid backfill across 13 demos
Backfills data-testid attributes to enable D6 cross-integration test
coverage for the built-in-agent integration. Covers:

- declarative-gen-ui renderers (5 testids)
- headless-complete demo components (6 testids: assistant-bubble,
  user-bubble, weather-card, highlight-note, input-bar)
- headless-simple page (3 testids)
- gen-ui-agent page (3 testids including agent-step)
- a2ui-fixed-schema definitions + renderers (chat-slots, auth flow)
- new sign-in-card component for auth demo
- gen-ui-interrupt cancel testid on time-picker-card
- shared not-supported-banner component for hitl +
  shared-state-streaming NSF demos
2026-06-12 05:02:13 -07:00
Jordan Ritter 089f8ac243 fix(showcase): D6 reds remediation — manifest NSF + hygiene (14 integrations) + claude-sdk-python testid/hook fixes (+16 component testids) (#5407)
## Summary

D6 reds remediation across the staging dashboard. Consolidates
manifest-level NSF/hygiene fixes for 13 integrations with two targeted
claude-sdk-python fixes that surfaced during the per-integration audit.

### What's in scope

**Manifest cleanup** (12-14 integrations touched):
- Added `not_supported_features` entries for `reasoning-default-render`,
`agentic-chat-reasoning`, `tool-rendering-reasoning-chain`, and
`interrupt-headless` per backend capability (e.g. ms-agent-dotnet gets
only `interrupt-headless` since its `ReasoningAgent.cs` natively emits
REASONING_MESSAGE_*; langgraph-fastapi natively supports both → no
additions).
- Deduped `shared-state-streaming` and related entries that previously
appeared in BOTH `features:` AND `not_supported_features:`.
- Added `shared-state-read` and `threadid-frontend-tool-roundtrip` to
`features:` where the demo exists but wasn't declared. **Note**:
`threadid-frontend-tool-roundtrip` was REVERTED — feature isn't
registered in `showcase/shared/feature-registry.json`; the registry
needs the canonical entry before manifests can declare it. Tracked as
follow-up.

**claude-sdk-python**:
- `hitl/page.tsx`: replaced `useLangGraphInterrupt` (from
`@copilotkit/react-core`) with `useInterrupt` (from
`@copilotkit/react-core/v2`) — wrong-framework import on a non-LG
backend.
- `gen-ui-interrupt`: added `data-testid="time-picker-cancel"` to the
cancel button.

### Out of scope (deferred / handled elsewhere)

- **ag2 + spring-ai manifests**: owned by parallel session
`fix/content-reds` — those changes land via that PR.
- **11 of 12 audit-flagged claude-sdk-python testid gaps**: investigated
and refused — they're missing FEATURES (custom-catchall renderers,
sign-in cards, headless composer, etc.), not missing testid attributes
on existing JSX. Adding them would be a behavior change requiring
backend-capability audit per demo. Separate follow-up if the team wants
the structural gaps closed.
- **built-in-agent 17-item testid backfill**: per D analysis, the
single-`"default"`-agent pattern is INTENTIONAL architecture (documented
in README + earliest port commit + uniform across 12+ routes); per-demo
dimension comes from `src/lib/factory/*` keyed off route URL. Track 1
(PARITY_NOTES.md doc) + Track 2 (testid-only backfill, separate PR)
tracked as follow-ups.

### Validation

- `npm run validate-manifests` passes; all 15 affected manifests parse
valid YAML.
- claude-sdk-python typecheck: no new errors (pre-existing
module-resolution noise unchanged).
- No vitest tests exist for the touched claude-sdk-python demos.
- `npx oxfmt --write` on changed files.

### Provenance

Driven by a per-integration parity audit (LGP canon, 17 red
integrations, 11-slot CR fan-out, 39-demo canon enumerated; reports
archived to /tmp/cr/audit/ during the investigation). Coordinated with
parallel `fix/content-reds` session via the `coordinate` skill to avoid
file-overlap with their ag2 + spring-ai manifest work and other deeper
changes.

Closes #5406 (claude-sdk-python testid/hook fixes — folded into this
PR).

## Additional fixes (folded in after re-audit)

Re-audit of the original claude-sdk-python audit revealed 16 ADD-EMITTER
fixes the prior agent missed. All components existed; only `data-testid`
attributes were absent.

| demo | testids | commit |
|---|---|---|
| auth | 1 (`auth-demo-error-message`) | 1238046fc |
| headless-simple | 3 (composer + 2 message bubbles) | 5793a3652 |
| a2ui-fixed-schema | 1 (`a2ui-fixed-card` via Card renderer override +
matching definitions entry, mirroring LGP) | 4436f3afa |
| headless-complete | 6 (composer + 2 bubbles + stock/weather/highlight
cards) | 083eb09a7 |
| declarative-gen-ui | 5 (card + status-badge + metric + pie-chart +
bar-chart) | 6187040b5 |

Not added (genuinely missing components, deferred):
- `auth-sign-in-card`, `auth-sign-out-button`, `auth-profile-card`
- `headless-revenue-chart`
- tool-rendering testids (15 components), chat-slots (2), etc.
2026-06-12 03:33:08 -07:00
Jordan Ritter dad8ff0a71 chore(showcase/claude-sdk-python): document LGP parity for headless-message testids
Adds inline comments next to the data-testid="headless-message-{user,assistant}"
markers in assistant-bubble.tsx, user-bubble.tsx, and headless-simple/page.tsx
explaining that the testids intentionally repeat once per message — mirroring
the canonical LGP implementation — and that role discrimination for the D6
conversation-runner is via data-message-role, not unique testids.
2026-06-12 03:25:32 -07:00
Jordan Ritter f9bb881555 fix(showcase/claude-sdk-python): D6 probe alignment — testid backfill + demo bugfixes + V2 import for gen-ui-interrupt
Backfills the data-testid markers the D6 probes assert against across the
auth, headless-simple, headless-complete, a2ui-fixed-schema,
declarative-gen-ui, and gen-ui-interrupt demos; aligns the python
a2ui_fixed agent + a2ui definitions/renderers with the canonical LGP
shapes; and switches the gen-ui-interrupt CopilotKit provider import to
@copilotkit/react-core/v2 so the demo mounts under the V2 runtime that
the D6 probe drives.
2026-06-12 03:25:18 -07:00
Jordan Ritter 28055f0688 feat(showcase/claude-sdk-python): add headless-revenue-chart for D6 probe
Adds the chart-card renderer and wires it into the headless-complete
tool-renderers map so the D6 probe for the headless-revenue-chart feature
can mount and assert against a real chart component.
2026-06-12 03:24:43 -07:00
Jordan Ritter 2df48c8581 fix(showcase/aimock): a2ui-fixed + declarative fixtures for claude-sdk-python D6 probes
Adds the missing gen-ui-a2ui-fixed aimock fixture and reshapes the
declarative-gen-ui fixture so the claude-sdk-python D6 probes have
deterministic LLM replay for both gen-ui demos.
2026-06-12 03:24:38 -07:00
Jordan Ritter 8f72c2840a fix(showcase/claude-sdk-python): hitl demo bugfixes — useInterrupt hook + V2 CopilotKit import
Replaces useLangGraphInterrupt with useInterrupt (LangGraph-specific hook
not exported from the V2 React core) and switches the CopilotKit provider
import to @copilotkit/react-core/v2 so the demo mounts under the V2
runtime that the D6 probe drives.
2026-06-12 03:24:22 -07:00
Jordan Ritter 928ece2f6c fix(showcase): add D6 NSF entries + feature alignment across 14 integration manifests
Annotates 14 integration manifests with d6_not_supported_features entries
and aligns d6_supported_features with what each backend actually implements,
so the D6 fleet probe only enumerates demos that the backend can serve.
2026-06-12 03:24:16 -07:00
Ran Shem Tov da5b50a929 fix(bot-slack): adapt runHttpRequest call to ag-ui 0.0.57 signature 2026-06-12 11:58:12 +02:00
Ran Shem Tov 7805a9a57b fix: update cpk to use latest agui core packages 2026-06-12 11:16:19 +02:00
Jordan Ritter 1e9d77ec50 feat(showcase): end-to-end run-visibility for fleet — /api/runs + family-silence Slack alerting (#5400)
## Summary

Adds end-to-end **run-visibility** to the showcase fleet — a new data
path from queue enqueue → per-family projection → dashboard + Slack
alerting:

- **Contracts + PB schema**: `EnqueueJobInput.family`,
`FleetQueueClient.pruneAged`, run-id/family/worker-id columns on
`probe_jobs` / `resource_snapshots`, fleet-claim hook stamps at claim
time.
- **Queue + aggregator**: queue-client stamps run-id/family on enqueue;
d6 producer owns `pruneAged` retention; aggregator computes
`redsIntroduced`/`redsCleared` into `probe_runs`.
- **Run-view projection (`run-view.ts`)**: §5.1 `FLEET_FAMILIES`
registry + §5.2.1 family-summary projection.
`createMemoizedFamilySummary` bounds PB load at ~one fan-out per TTL
regardless of viewer count.
- **Producer wiring**: `PRODUCER_FAMILY_WIRING` drift-locks the four
producers' family ids set-equal to the registry (unit-tested);
CLI-triggered runs route through `familyForLevel` so a registry rename
breaks loudly.
- **Family-silence monitor (§9)**: Slack alerting for the one incident
class transition-keyed rules are blind to (a silent family produces no
row transitions). Rides the existing fleet-health interval (no extra
timer), per-family 6h rate-limit + recovered one-shot + boot-grace,
fails open on PB-down for the meta-alert. Closed-vocabulary redaction.
- **HTTP `/api/runs`** + **`/health.fleetRuns.lastEvaluatedAt`**:
read-only fleet-runs routes mounted unconditionally on the CP role,
backed by the SAME memoized summary the monitor uses. `/health` stamp is
the §9 compensating control so an external poll can detect a wedged
monitor.
- **Orchestrator wiring**: boot-resolved `workerStaleAfterMs` threaded
through both fleet-health and the projection so they judge staleness
against the same window; test queues across the harness gain a no-op
`pruneAged`.
- **Dashboard**: worker-runs Ops section (family table, worker strip,
run-history drill-down), D0-from-staleness vs D0-from-failure family
annotation, per-family silence banner on the coverage tab; data layer
(DTOs, fetchers, polling hook, context provider).
- **Integration test**: 689-line end-to-end test exercising the full
queue lifecycle → /api/runs projection across all four families.

This is the merged scope of the **runviz blitz** lanes T1-T15.

## Test plan

- [x] `pnpm typecheck` on `showcase/harness` and
`showcase/shell-dashboard` — clean
- [x] `vitest run` on full harness suite — 2276 pass / 3 pre-existing
probe-pool timing flakes (NOT in diff; subject is "probe-pool timing
fragility", a different PR's concern)
- [x] `oxfmt --check showcase/` — all green
- [x] Integration test `run-visibility.integration.test.ts` passes —
exercises queue → projection across all four families
- [ ] CI on PR HEAD — pending push, monitored after open

## Known follow-up (bucket-d)

- Probe-pool timing-sensitive flakes in
`src/probes/helpers/browser-pool.test.ts` (FIX#4a self-heal) and
`src/probes/loader/probe-invoker.test.ts` (timeout assertions) —
different test fails on each run; subject is probe-pool timing
fragility, not runviz.

## Deviation note

The runviz ship-finisher session ran in a Claude Agent SDK harness
without an Agent dispatch tool, so the standard 7-agent CR-loop could
not be dispatched. Inline review was performed against the cr-loop
subject-manifest + four-bucket partition: T1-T15 each landed via their
own per-task review on the blitz integration branch before reaching this
PR, and T8/T15 (the two final-merged streams) were validated via
typecheck-clean + targeted-tests-pass + cross-module wiring inspection.
A heavyweight 7-agent CR can be run against this PR if desired.
2026-06-11 21:49:06 -07:00
Jordan Ritter f6edd48ca8 fix(harness): post-rebase test/syntax fixes for queue-client and fleet tests
- queue-client.ts: add missing closing brace at EOF (TS1005 after rebase)
- job-producer.test.ts: add required `family: "d6"` to producer fixtures
  and remove duplicate `logger` key in startedProducer
- result-aggregator.test.ts: align with per-row try/catch + dedup-lookup
  behavior introduced in 0b2f613e0 — add `persisted: true` and
  `writeOverlay` to test writers, update B6 contract expectations
- queue-client.test.ts: drop a stray blank line
2026-06-11 21:48:18 -07:00
Jordan Ritter 06f6f2cd6d fix(dashboard): worker-run-detail-panel abort fetches on cleanup + move side-effects out of setState updater 2026-06-11 21:16:38 -07:00
Jordan Ritter 91f4fd9f55 fix(harness): job-producer.pruneAged uses depth registry constant, not hardcoded literal 2026-06-11 21:16:37 -07:00
Jordan Ritter 0b2f613e00 fix(harness): aggregator per-row try/catch + dedup lookup throw + worker-health helper parity 2026-06-11 21:16:00 -07:00
Jordan Ritter 3c03377935 fix(harness): escape PB filter args in control-plane-run + run-history 2026-06-11 21:13:36 -07:00
github-actions[bot] 3aae755694 style: auto-fix formatting 2026-06-11 21:13:36 -07:00
Jordan Ritter 5c62a1f1d7 test(showcase): run-visibility integration + deploy-script regression covers
Adds a 689-line integration test that exercises the full queue lifecycle
to the /api/runs projection (enqueue → claim → terminal → projection)
across all four families. Updates the railway-envs golden + verify-deploy
drivers regression test to account for the new fleet-runs route surface.
2026-06-11 21:13:35 -07:00
Jordan Ritter 1223bb9fc1 feat(showcase): dashboard worker-runs UI + data layer
Adds the dashboard Ops worker-runs section — family table, worker strip,
run-history drill-down, D0-from-staleness vs D0-from-failure family
annotation with clock glyph, and the per-family silence banner on the
coverage tab. Wires the data layer: DTOs, /api/runs fetchers, polling
hook, and a worker-runs context provider. cell-drilldown / cell-pieces
gain family-aware rendering.
2026-06-11 21:13:34 -07:00