GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(showcase): fix reasoning snippet syntax error and add reasoning-block.tsx tab by Abubakar-01 · Pull Request #4858 · CopilotKit/CopilotKit

Conversation

@Abubakar-01

@Abubakar-01 Abubakar-01 commented May 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Problem

Two issues affect the Custom reasoning rendering code snippet shown at
/generative-ui/reasoning in the docs:

Issue 1 — Syntax error: missing closing } in rendered snippet

In all 16 agentic-chat-reasoning/page.tsx files the
// @endregion[reasoning-block-render] marker is placed inside the
Chat function body, before its closing brace:

function Chat() {
  return ( ... );
  // @endregion[reasoning-block-render]   ← region ends here
}                                          ← } is NOT included

The docs snippet therefore renders incomplete TypeScript — the Chat
function has no closing }. This is a copy-paste syntax error for anyone
following the docs.

Fix: move the @endregion marker to the line after } in all 16
files.

Issue 2 — Import with no visible definition

The page.tsx snippet (inside the region) contains:

import { ReasoningBlock } from "./reasoning-block";

But reasoning-block.tsx is never shown on the docs page, leaving readers
with a dangling import and no way to see the component they are supposed to
copy.

Fix: wrap the existing snippet in a <Tabs> block and add a second
reasoning-block.tsx tab that shows the component file for the selected
framework (framework-aware via the existing <Snippet file="..."> lookup).


Changes

File Change
showcase/shell-docs/src/content/docs/generative-ui/reasoning.mdx Wrap <Snippet region="reasoning-block-render"> in <Tabs> with a second reasoning-block.tsx tab
showcase/integrations/ag2/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/agno/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/built-in-agent/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/claude-sdk-python/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/claude-sdk-typescript/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/crewai-crews/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/langgraph-fastapi/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/langgraph-typescript/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/langroid/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/llamaindex/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/mastra/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/ms-agent-dotnet/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/ms-agent-python/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/pydantic-ai/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/spring-ai/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }
showcase/integrations/strands/src/app/demos/agentic-chat-reasoning/page.tsx Move @endregion after }

Testing

  • Open http://localhost:3003/ag2/generative-ui/reasoning → page.tsx tab shows syntactically complete code with closing } included
  • Click reasoning-block.tsx tab → shows the ReasoningBlock component definition
  • Switch to ms-agent-python → reasoning-block.tsx tab shows the args/status props variant (tool-based)
  • Switch to langgraph-python → second tab shows a graceful "Missing snippet" notice (cell is unshipped)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Abubakar-01
fix(showcase): move @endregion marker after Chat closing brace in all…
51e2e0a
… agentic-chat-reasoning demos

The // @endregion[reasoning-block-render] comment was indented inside the
Chat function body, causing the rendered docs snippet to omit the final
closing brace — a visible syntax error. Moves the marker to after the }
in all 16 agentic-chat-reasoning/page.tsx files.

Also wraps the custom-reasoning snippet in reasoning.mdx in a two-tab
block so the ReasoningBlock import in page.tsx links directly to the
reasoning-block.tsx component definition in the adjacent tab.
@Abubakar-01
Abubakar-01 requested review from jpr5, marthakelly, mme, ranst91 and tylerslaton as code owners May 15, 2026 17:32
claude[bot]
claude Bot reviewed May 15, 2026
View reviewed changes

@claude claude Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vercel

vercel Bot commented May 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 15, 2026 5:34pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

@Abubakar-01 is attempting to deploy a commit to the CopilotKit Team on Vercel.

A member of the Team first needs to authorize it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Abubakar-01 Abubakar-01 changed the title fix(showcase): move @endregion marker after Chat closing brace in all… fix(showcase): fix reasoning snippet syntax error and add reasoning-block.tsx tab May 15, 2026
@vercel
vercel Bot deployed to Preview – docs May 15, 2026 17:34
View deployment
@samjulien samjulien mentioned this pull request May 15, 2026
fix(showcase): move @endregion marker after Chat closing brace in reasoning demos (cherry-pick of #4858) #4876
Merged
3 tasks
@samjulien

samjulien commented May 15, 2026

Copy link
Copy Markdown
Contributor

Hi @Abubakar-01 — thanks for this fix, it's exactly the right change.

The CI failures here were entirely due to fork PR restrictions (Depot OIDC token + Vercel deploy auth), not the code. To unblock cutover, I've cherry-picked your commit onto a maintainer branch with your authorship preserved in #4876; that PR will run full CI and merge.

Closing this in favor of #4876. Thanks again for the contribution and the careful diagnosis!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samjulien samjulien closed this May 15, 2026
samjulien added a commit that referenced this pull request May 15, 2026
@samjulien
fix(showcase): move @endregion marker after Chat closing brace in rea…
b039c8f
…soning demos (cherry-pick of #4858) (#4876)

## Summary

Cherry-pick of #4858 (by @Abubakar-01) onto a maintainer-owned branch so
CI can run with full token access. The original PR's CI was blocked at
the Depot OIDC step because fork PRs don't receive the build tokens —
the code itself is fine.

All credit to @Abubakar-01; commit authorship preserved.

## The fix

Region markers `@endregion[reasoning-block-render]` in 16
`agentic-chat-reasoning/page.tsx` demos closed **before** the enclosing
`function Chat()`'s closing brace, so the rendered snippet had an
unbalanced `{` and the closing `}` cut off mid-body. Moves each
`@endregion` to after the function's closing brace so the snippet body
is syntactically complete.

Matches the contiguous-region-wraps-imports-and-body convention
established in #4829.

## Files changed

16 demo files across ag2, agno, built-in-agent, claude-sdk-python,
claude-sdk-typescript, crewai-crews, google-adk, langgraph-fastapi,
langgraph-python, langgraph-typescript, langroid, llamaindex, mastra,
ms-agent-python, pydantic-ai, spring-ai, strands — each
`src/app/demos/agentic-chat-reasoning/page.tsx` gets the same
single-line marker move.

## Test plan

- [ ] Bundle regenerates clean: `pnpm tsx
showcase/scripts/bundle-demo-content.ts`
- [ ] Sample 3 `reasoning-block-render` region bodies in
`demo-content.json` — each should now contain a balanced `function
Chat() { ... }`
- [ ] `/{framework}/generative-ui/reasoning` (or wherever the snippet is
rendered) shows the full Chat function

## Original PR

Closes #4858 in favor of this maintainer-branch version. CI on fork PRs
is blocked on Depot OIDC + Vercel deploy authorization, neither of which
we can override per-PR.
@onsclom onsclom mentioned this pull request May 20, 2026
fix(ci): rebuild better-sqlite3 after pnpm cache restore to fix Node ABI mismatch #4938
Merged
onsclom added a commit that referenced this pull request May 20, 2026
@onsclom
fix(ci): rebuild better-sqlite3 after pnpm cache restore to fix Node …
1bd5936
…ABI mismatch (#4938)

## Summary

Fixes a probabilistic CI failure in the `test / unit` matrix where Node
20.x and 22.x jobs would fail with `Module did not self-register` on
`better-sqlite3`.

### Root cause

`setup-node`'s built-in `cache: "pnpm"` uses a cache key of
`node-cache-Linux-pnpm-{lockfileHash}` — **no Node.js version in the
key**. All three matrix jobs (Node 20, 22, 24) share one cache entry.

The failure is **probabilistic, not always-present**:

- **Cold run (first after cache reset):** all three jobs install fresh
and pass. Whichever job finishes first writes its ABI-specific
`better-sqlite3` binary to the shared cache key.
- **Warm run (all subsequent runs):** all three jobs restore from the
same cache entry. Only the job whose Node version matches the cached
binary passes. The other two fail.

This explains the timing: failures started ~May 19 after the
`setup-node` v4→v6 and `pnpm/action-setup` v4→v6 dependabot bumps (May
15, PRs #4857/#4858) reset the cold cache. The first warm run after that
was broken for whichever two Node versions didn't win the write race.

This is a [known upstream bug in
setup-node](actions/setup-node#1171) (issue
#1171, fix pending in PR #1172, not yet in any release).

### Fix

Replace `cache: "pnpm"` in `setup-node` with a manual `actions/cache`
step that scopes the key to the Node.js version:

```
key: ${{ runner.os }}-pnpm-store-${{ matrix.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}
```

Each Node version now has its own isolated pnpm store cache entry. An
ABI-137 binary cached by a Node 24 job can never be served to a Node 20
or 22 job.

The step uses `$GITHUB_OUTPUT` (scoped step output) instead of
`$GITHUB_ENV` per GitHub's security hardening guide.

## Test plan

### Local reproduction (primary evidence)

`better-sqlite3` uses classic ABI (`NODE_MODULE_INIT`, not N-API), so
its binaries are Node-version-specific. With a Node 24 binary in place,
switching to Node 22 without reinstalling reproduces the exact CI
failure:

```
# Binary compiled under Node 24 (ABI 137) — works fine:
$ node --version && node -e "new (require('better-sqlite3'))(':memory:').prepare('SELECT 1').get()"
v24.5.0
{ '1': 1 }

# Same binary, switched to Node 22 (ABI 127) without reinstalling — fails:
$ node-22 -e "new (require('better-sqlite3'))(':memory:')"
Error: The module was compiled against a different Node.js version using
NODE_MODULE_VERSION 137. This version of Node.js requires NODE_MODULE_VERSION 127.
Please try re-compiling or re-installing the module.
```

This is exactly what the shared cache was doing to Node 20/22 jobs:
handing them a binary compiled for a different ABI.

### CI validation

Two runs on this PR confirm the fix end-to-end:

1. **Cold-cache run**
([26185670340](https://github.com/CopilotKit/CopilotKit/actions/runs/26185670340)):
all three jobs install fresh, each writes its own per-version cache
entry, all pass.

2. **Warm-cache run**
([26187495270](https://github.com/CopilotKit/CopilotKit/actions/runs/26187495270)):
each job restores from its own per-version cache entry — the exact
scenario that was previously broken. All pass, with install times
dropping from ~22s (cold, downloading) to 7–10s (warm, linking from
store), confirming real cache hits were served.

| Job | Result | Cache restore | Install |
|-----|--------|--------------|---------|
| unit (20.x) | ✅ pass | 12s (hit) | 8s |
| unit (22.x) | ✅ pass | 12s (hit) | 7s |
| unit (24.x) | ✅ pass | 14s (hit) | 10s |
pull Bot pushed a commit to TheRakeshPurohit/CopilotKit that referenced this pull request May 20, 2026
@onsclom
fix(ci): rebuild better-sqlite3 after pnpm cache restore to fix Node …
193629a
…ABI mismatch

The pnpm store cache key used by setup-node does not include the Node.js
version, so a cache entry written by a Node 24 job contains an ABI-137
better-sqlite3 binary. When Node 20 (ABI 115) or Node 22 (ABI 127) jobs
restore from the same cache key they get the wrong binary and all
sqlite-runner tests fail with "Module did not self-register".

Adding `pnpm rebuild better-sqlite3` after install re-runs prebuild-install
for the active Node version, downloading the correct prebuilt binary and
overwriting whatever ABI was in the restored cache.

Root cause first appeared after the setup-node v4→v6 and pnpm/action-setup
v4→v6 bumps (May 15, PRs CopilotKit#4857/CopilotKit#4858) reset the cold cache, allowing a
Node 24 binary to poison the shared store entry.

This branch was successfully deployed

1 active deployment
Preview – docs — 51e2e0a8 Deployed May 15, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@claude claude[bot] claude[bot] left review comments
@tylerslaton tylerslaton Awaiting requested review from tylerslaton tylerslaton is a code owner
@jpr5 jpr5 Awaiting requested review from jpr5 jpr5 is a code owner
@ranst91 ranst91 Awaiting requested review from ranst91
@marthakelly marthakelly Awaiting requested review from marthakelly
@mme mme Awaiting requested review from mme mme is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Abubakar-01 @samjulien
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.