Skip to content

docs: refresh v2 SDK reference - #6388

Merged
tylerslaton merged 2 commits into
mainfrom
docs/showcase-sdk-reference-20260805
Sep 18, 2026
Merged

tylerslaton merged 2 commits into
mainfrom
docs/showcase-sdk-reference-20260805

Conversation

@AlemTuzlak

@AlemTuzlak AlemTuzlak commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refresh the v2 SDK reference against current main, preserving the existing three-page scope. Merge main into this branch without rewriting its history.

Why

The original reference update predates the explicit distinction between the v1 CopilotKit compatibility wrapper and v2 CopilotKitProvider, newer agent-ID defaults, and Inspector changes.

How

  • Use CopilotKitProvider in v2 setup and error-handler examples, while retaining the legacy wrapper's public-key requirement for onError.
  • Document current provider props, dynamic headers, debug verbosity, and localhost-only Inspector availability; remove the obsolete inspectorDefaultAnchor addition.
  • Preserve main's thread-scoped useAgent documentation, add an example and headless imports, and clarify provider agent-ID fallback and throttle overrides.
  • Describe the main and headless import surfaces and their provider limitations.

Validation: all three pages compile as MDX; documented provider prop names were checked against current TypeScript interfaces; git diff --check against current main passed. Focused validation ran through Nx. No full docs build was run. The merge-triggered broad package hook failed; its unrelated autoformat/lockfile changes were reverted, and lint/lockfile/package hooks were excluded for this docs-only merge. Binary, plugin-skill, Intelligence naming, and commit-message hooks remain enabled.

Summary by CodeRabbit

  • Documentation
    • Updated provider setup guidance for CopilotKitProvider, including authentication tokens, dynamic headers, agent configuration, generative UI, throttling, debugging, and error handling.
    • Clarified v2 and headless import paths, agent ID resolution, thread-scoped options, and private proxied agent usage.
    • Documented that the legacy CopilotKit component serves as a v1 compatibility wrapper.
    • Expanded API reference examples and clarified inspector and throttling behavior.

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

All 42 services digest-pinned.

Run 2026-09-16 10:31:51 PDT — 0 finding(s).

BenTaylorDev added a commit that referenced this pull request Sep 10, 2026
…e reference (#7025)

## Summary

The React Native `useAgent` reference page still documents the
pre-`1.64.2` hook. Parameters list only `agentId` and `updates`, and the
signature returns `{ agent: AbstractAgent }` with no `isReady`.

React Native re-exports react-core's `useAgent` verbatim
(`packages/react-native/src/headless.ts:53`, re-exporting from
`@copilotkit/react-core/v2/headless`), so it is the same hook with the
same props. The page is simply stale.

This adds:

- `threadId`, `runtimeAgentId` and `throttleMs` parameters
- the `isReady` return value, and `isReady` in the signature
- the `@copilotkit/react-native/headless` import note
- the two valid option shapes, and a thread-scoped example
- `Optional Throttling`, `Readiness` and `Thread Scoping` behavior
bullets

Content mirrors #6388, which makes the equivalent changes to the React
page, so the two pages stay consistent. No overlap in files.

Docs only. No source or public API change.

## Context

Reported by a community user in #6125 for the React page: the
thread-scoping API shipped in `v1.64.2` (#6141) and the Vue mirror in
`v1.68.0` (#6234), but the docs site was never updated. #6388 covers the
React page; this covers React Native.

## Testing

Verified against a live `next dev` render of shell-docs on `origin/main`
(`35c1e801ae`), with the edited page in place.

**1. MDX compiles with the real compiler** (`@mdx-js/mdx` from
`showcase/shell-docs/node_modules`, the untouched pages as controls):

```
OK    .../worktrees/docs-rn-useagent/.../react-native/hooks/useAgent.mdx   <- edited
OK    .../showcase/shell-docs/.../react-native/hooks/useAgent.mdx          <- control
OK    .../showcase/shell-docs/.../hooks/useAgent.mdx                       <- control
exit=0
```

**2. Component tags balance** (no unclosed `<PropertyReference>`, which
renders as silently swallowed content):

```
open: 23 close: 23 self-closing: 0
BALANCED
fences: 20 (even=ok)
```

**3. Page serves 200 and renders the new content** (`next dev`, port
3003):

```
200  /reference/react-native/hooks/useAgent

threadId: 17      runtimeAgentId: 10     throttleMs: 5      isReady: 17
Thread-scoped Agent: 2                   Thread Scoping: 2
react-native/headless: 2                 preview-: 2

error markers: (none)
```

No `Unhandled Runtime Error`, `Build Error`, `Failed to compile`, or
error overlay in the served HTML.

**4. Prop descriptions actually render**, checked against the untouched
React page as a negative control. The new text is present on the edited
page and correctly absent on the React page, which is what #6388 adds:

```
=== react-native (edited) ===
  ID of the agent to retrieve                   PRESENT
  Controls which agent changes trigger          PRESENT
  Thread ID for a private proxied agent         PRESENT
  Unique identifier for the agent instance      PRESENT
=== react (untouched control) ===
  Thread ID for a private proxied agent         absent
```

Not run: `showcase/shell-docs` `npm run dev` via its `predev` script
fails in this environment on a pre-existing missing `js-yaml` in
`showcase/harness`, unrelated to this change. I ran `next dev` directly
instead, which is why the generators (registry, search index) did not
run. Those generate demo and search content, not reference pages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Expanded `useAgent` reference documentation to cover shared and
thread-scoped agent resolution.
- Documented private proxied agents, headless imports, required option
combinations, and runtime/type validation.
- Added guidance for readiness states, provisional agents, connection
failures, and thread-scoped usage.
- Documented the `isReady` return value and `throttleMs` configuration
for controlling update frequency.
- Clarified agent ID resolution, including provider-level configuration
and default fallback behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@BenTaylorDev BenTaylorDev 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.

Reviewed against current origin/main. Content is accurate and I confirmed the substantive claims against source. Three things before it can land.

1. Blocker: inspectorDefaultAnchor no longer exists. Removed from react-core by b53fa8f1ea ("refactor(inspector): consolidate framework integration"), from both the provider and the bundled skill doc. It existed when you branched, so this is drift, not an error. Drop that <PropertyReference>.

2. Rebase needed, one conflict. The branch is behind main and CopilotKit.mdx conflicts in the onError paragraph. Your side is the correct one: onError is a plain copilotkit.subscribe({ onError }) with no publicApiKey gate (packages/react-core/src/v2/providers/CopilotKitProvider.tsx:869-882), so main's current "Requires publicApiKey" text is wrong and your rewrite fixes it. Main only renamed the product in that sentence, which is what produced the conflict. index.mdx auto-merges.

3. agentId resolution order is missing a step. The page says explicit agentId, then chat configuration, then "default". The hook resolves agentId ?? chatConfig?.agentId ?? providerAgentId ?? DEFAULT_AGENT_ID (use-agent.tsx:203-208), so the provider-level agentId sits between the chat configuration and the default. As written it reads as though <CopilotKitProvider agentId> is ignored.

Verified correct, no action needed: the headers function overload (CopilotKitProvider.tsx:131); licenseToken, selfManagedAgents, agents__unsafe_dev_only, openGenerativeUI, defaultThrottleMs and debug all exist on main and none were already documented; the headless-entry export list, including useRenderToolCall being exported (headless.ts:80) while useDefaultRenderTool, CopilotChat, CopilotPopup and CopilotSidebar are not; and the useAgent thread-scoping content.

Note that CI on this PR ran on 2026-08-05 against the old base, so it is not evidence about current main.

Context: a user hit the stale useAgent page in #6125. #7025 covered the React Native copy of that page and has merged. It mirrors your changes with no file overlap, and it already carries the fix for item 3.

pull Bot pushed a commit to TheRakeshPurohit/CopilotKit that referenced this pull request Sep 10, 2026
…e reference

The React Native `useAgent` reference page still described the pre-1.64.2
hook: parameters listed only `agentId` and `updates`, and the signature
returned `{ agent: AbstractAgent }` with no `isReady`.

React Native re-exports react-core's `useAgent` verbatim from
`@copilotkit/react-core/v2/headless`, so the page was documenting props the
hook no longer has alone. Add `threadId`, `runtimeAgentId` and `throttleMs`,
add the `isReady` return value, note the headless entry point, and describe
the two valid option shapes. Mirrors the React page changes in CopilotKit#6388 so the
two stay consistent.

Reported for the React page in CopilotKit#6125.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6697c254-25d5-48d0-a5ea-094943504a80

📥 Commits

Reviewing files that changed from the base of the PR and between 7be27b9 and 9e44284.

📒 Files selected for processing (3)
  • showcase/shell-docs/src/content/reference/components/CopilotKit.mdx
  • showcase/shell-docs/src/content/reference/hooks/useAgent.mdx
  • showcase/shell-docs/src/content/reference/index.mdx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The reference documentation updates v2 provider setup, provider props, import surfaces, runtime behavior, and useAgent configuration and examples.

Changes

V2 Documentation

Layer / File(s) Summary
Provider component reference
showcase/shell-docs/src/content/reference/components/CopilotKit.mdx
Documents licenseToken, dynamic headers, agent registration options, generative UI settings, throttling, debugging, and inspector behavior.
Provider setup and import surfaces
showcase/shell-docs/src/content/reference/index.mdx
Updates setup examples to CopilotKitProvider, documents provider props and runtime options, and adds v2 and headless import surfaces.
useAgent behavior and examples
showcase/shell-docs/src/content/reference/hooks/useAgent.mdx
Documents thread-scoped validation, headless imports, agentId resolution, throttling, and a thread-scoped agent example.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 9e442

The updated v2 reference documentation aligns with the supplied SDK contracts, with no concrete merge-blocking documentation defect identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: refreshing the v2 SDK reference documentation.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/showcase-sdk-reference-20260805

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026

Copy link
Copy Markdown
@copilotkit/a2ui-renderer

pnpm add https://pkg.pr.new/@copilotkit/a2ui-renderer@6388

@copilotkit/agentcore-runner

pnpm add https://pkg.pr.new/@copilotkit/agentcore-runner@6388

@copilotkit/angular

pnpm add https://pkg.pr.new/@copilotkit/angular@6388

@copilotkit/channels

pnpm add https://pkg.pr.new/@copilotkit/channels@6388

@copilotkit/channels-core

pnpm add https://pkg.pr.new/@copilotkit/channels-core@6388

@copilotkit/channels-discord

pnpm add https://pkg.pr.new/@copilotkit/channels-discord@6388

@copilotkit/channels-intelligence

pnpm add https://pkg.pr.new/@copilotkit/channels-intelligence@6388

@copilotkit/channels-slack

pnpm add https://pkg.pr.new/@copilotkit/channels-slack@6388

@copilotkit/channels-teams

pnpm add https://pkg.pr.new/@copilotkit/channels-teams@6388

@copilotkit/channels-telegram

pnpm add https://pkg.pr.new/@copilotkit/channels-telegram@6388

@copilotkit/channels-ui

pnpm add https://pkg.pr.new/@copilotkit/channels-ui@6388

@copilotkit/channels-whatsapp

pnpm add https://pkg.pr.new/@copilotkit/channels-whatsapp@6388

@copilotkit/core

pnpm add https://pkg.pr.new/@copilotkit/core@6388

@copilotkit/intelligence-langgraph

pnpm add https://pkg.pr.new/@copilotkit/intelligence-langgraph@6388

@copilotkit/intelligence-mastra

pnpm add https://pkg.pr.new/@copilotkit/intelligence-mastra@6388

@copilotkit/mcp-apps-renderer

pnpm add https://pkg.pr.new/@copilotkit/mcp-apps-renderer@6388

@copilotkit/react-core

pnpm add https://pkg.pr.new/@copilotkit/react-core@6388

@copilotkit/react-native

pnpm add https://pkg.pr.new/@copilotkit/react-native@6388

@copilotkit/react-textarea

pnpm add https://pkg.pr.new/@copilotkit/react-textarea@6388

@copilotkit/react-ui

pnpm add https://pkg.pr.new/@copilotkit/react-ui@6388

@copilotkit/runtime

pnpm add https://pkg.pr.new/@copilotkit/runtime@6388

@copilotkit/runtime-client-gql

pnpm add https://pkg.pr.new/@copilotkit/runtime-client-gql@6388

@copilotkit/sdk-js

pnpm add https://pkg.pr.new/@copilotkit/sdk-js@6388

@copilotkit/shared

pnpm add https://pkg.pr.new/@copilotkit/shared@6388

@copilotkit/sqlite-runner

pnpm add https://pkg.pr.new/@copilotkit/sqlite-runner@6388

@copilotkit/voice

pnpm add https://pkg.pr.new/@copilotkit/voice@6388

@copilotkit/vue

pnpm add https://pkg.pr.new/@copilotkit/vue@6388

@copilotkit/web-components

pnpm add https://pkg.pr.new/@copilotkit/web-components@6388

@copilotkit/web-inspector

pnpm add https://pkg.pr.new/@copilotkit/web-inspector@6388

commit: 9e44284

@tylerslaton
tylerslaton merged commit a524020 into main Sep 18, 2026
37 of 38 checks passed
@tylerslaton
tylerslaton deleted the docs/showcase-sdk-reference-20260805 branch September 18, 2026 17:17
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.

3 participants