Skip to content

fix(showcase/claude-sdk-python): hitl hook import fix + gen-ui-interrupt testid backfill - #5406

Closed
jpr5 wants to merge 2 commits into
mainfrom
fix/claude-sdk-python-testid-backfill
Closed

jpr5 wants to merge 2 commits into
mainfrom
fix/claude-sdk-python-testid-backfill

Conversation

@jpr5

@jpr5 jpr5 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Two surgical fixes against the claude-sdk-python showcase integration, scoped to showcase/integrations/claude-sdk-python/src/:

  1. hitl/page.tsx — wrong framework hook: replace useLangGraphInterrupt (LangGraph-specific, from @copilotkit/react-core) with useInterrupt (framework-agnostic CopilotKit v2 hook, from @copilotkit/react-core/v2). Matches the canonical LGP hitl/page.tsx pattern and is the correct surface for non-LangGraph backends.
  2. gen-ui-interrupt/time-picker-card.tsx — testid backfill: add data-testid=\"time-picker-cancel\" to the existing "None of these work" cancel button so the canonical LGP testid is now emitted. Pure attribute add, no behavior change.

STOP-and-surface: remaining audit gaps are NOT pure testid-add

The audit at /tmp/cr/audit/claude-sdk-python.md lists ~12 demos with missing canon testids (largest: tool-rendering with 14). On inspection, the vast majority of those gaps are missing features / missing components, not missing data-testid attributes on already-rendered JSX:

  • tool-rendering (14 missing): canon emits testids on custom-catchall, d20, flights, stock renderers — claude-sdk-python's tool-rendering demo only ships the weather card. Adding the testids would require adding the missing renderers (behavior change).
  • headless-simple / headless-complete: missing headless-composer, headless-message-* ids — corresponding components don't exist in claude variant.
  • declarative-gen-ui (5): canon emits testids from a2ui renderer overrides for declarative-card, declarative-bar-chart, etc. — claude has no matching renderer overrides.
  • a2ui-fixed-schema (1): canon emits a2ui-fixed-card from a Card renderer override; claude omits the Card override entirely.
  • auth (4): canon has a sign-in card flow with auth-sign-in-card, auth-sign-in-button, auth-demo-token, auth-demo-error-message — claude variant uses a banner-only flow.
  • chat-slots (2): canon emits custom-welcome-message + custom-feather from separate slot components; claude doesn't ship them.
  • readonly-state-agent-context (3): canon emits identity-* testids from an identity card section; claude doesn't render one.
  • subagents (5+), tool-rendering-default-catchall (5), multimodal (1 built-in): same pattern — missing JSX.

Per the task brief ("Do NOT change behavior — testid only" / "If any test fails or any demo's correct testid set is unclear: STOP and surface"), these are all out of scope for a testid-only PR. They are feature-parity tasks that belong in a separate effort scoped against the claude-sdk-python backend capabilities.

Test plan

  • Branch verified pre/post each commit (fix/claude-sdk-python-testid-backfill)
  • Typecheck delta: no new errors introduced (all pre-existing TS errors stem from upstream module resolution / e2e Playwright types — confirmed by baseline tsc against HEAD~2)
  • No vitest test files exercise the touched demos directly; e2e specs reference these testids and will pick up time-picker-cancel going forward
  • Formatter run (oxfmt --write) on both files
  • Reviewer: confirm the STOP-and-surface scope is acceptable; if a follow-up is wanted for the structural backfill, file separately

jpr5 added 2 commits June 12, 2026 00:15
…seInterrupt in hitl demo

useLangGraphInterrupt is the LangGraph-specific hook from @copilotkit/react-core
and is the wrong framework primitive on a Claude SDK Python backend. The canonical
LGP demo uses useInterrupt from @copilotkit/react-core/v2 — the framework-agnostic
CopilotKit v2 interrupt hook — which is the correct surface for non-LangGraph
backends. Swap the import and call site.
…-ui-interrupt cancel button

Backfills the canonical LGP testid time-picker-cancel on the 'None of these
work' button in the time picker card. Testid-only change — no behavior
modification.
@vercel

vercel Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
chat-with-your-data Ready Ready Preview, Comment Jun 12, 2026 7:18am
docs Ready Ready Preview, Comment Jun 12, 2026 7:18am
form-filling Ready Ready Preview, Comment Jun 12, 2026 7:18am
research-canvas Ready Ready Preview, Comment Jun 12, 2026 7:18am
travel Ready Ready Preview, Comment Jun 12, 2026 7:18am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@github-actions

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

12 of 41 service(s) not digest-pinned.

Service Source.image Status
starter-adk ghcr.io/copilotkit/starter-adk:latest mutable-tag
starter-agno ghcr.io/copilotkit/starter-agno:latest mutable-tag
starter-crewai-crews ghcr.io/copilotkit/starter-crewai-crews:latest mutable-tag
starter-langgraph-fastapi ghcr.io/copilotkit/starter-langgraph-fastapi:latest mutable-tag
starter-langgraph-js ghcr.io/copilotkit/starter-langgraph-js:latest mutable-tag
starter-langgraph-python ghcr.io/copilotkit/starter-langgraph-python:latest mutable-tag
starter-llamaindex ghcr.io/copilotkit/starter-llamaindex:latest mutable-tag
starter-mastra ghcr.io/copilotkit/starter-mastra:latest mutable-tag
starter-ms-agent-framework-dotnet ghcr.io/copilotkit/starter-ms-agent-framework-dotnet:latest mutable-tag
starter-ms-agent-framework-python ghcr.io/copilotkit/starter-ms-agent-framework-python:latest mutable-tag
starter-pydantic-ai ghcr.io/copilotkit/starter-pydantic-ai:latest mutable-tag
starter-strands-python ghcr.io/copilotkit/starter-strands-python:latest mutable-tag

Run 2026-06-12 00:16:01 PDT — 12 finding(s).

@jpr5

jpr5 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #5407 (consolidated D6 reds remediation PR). Both commits cherry-picked onto fix/manifest-nsf-additions; the unified PR carries the manifest cleanup + the two claude-sdk-python fixes together.

@jpr5 jpr5 closed this Jun 12, 2026
jpr5 added a commit that referenced this pull request Jun 12, 2026
…rations) + 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.

This branch was successfully deployed

5 active deployments
Preview – travel — afcd378a Deployed Jun 12, 2026 by vercel[bot]
Preview – research-canvas — afcd378a Deployed Jun 12, 2026 by vercel[bot]
Preview – docs — afcd378a Deployed Jun 12, 2026 by vercel[bot]
Preview – form-filling — afcd378a Deployed Jun 12, 2026 by vercel[bot]
Preview – chat-with-your-data — afcd378a Deployed Jun 12, 2026 by vercel[bot]
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