copilotkit-debug

A troubleshooting guide for CopilotKit, a toolkit that connects user interfaces to software agents, including their runtime and streamed responses.

In plain words
What is it for?
Use it to check package versions and runtime settings, diagnose streaming and cross-origin-request problems, and trace communication between CopilotKit frontends and agents.
Why use it?
It provides a way to investigate connection failures, missing responses, broken tool calls, voice transcription problems, package-version mismatches, and malformed events.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/copilotkit/copilotkit/copilotkit-debug
Any agent
npx skills add CopilotKit/CopilotKit --skill copilotkit-debug
Clone the repo
git clone --depth 1 https://github.com/CopilotKit/CopilotKit

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,511 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.01511
Opus 5 $0.00021 $0.00756
Sonnet 5 $0.00008 $0.00302
Haiku 4.5 $0.00004 $0.00151

Measured 2d ago against content hash 2a98c058711e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

copilotkit-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/copilotkit-debug/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CopilotKit Debugging Skill

When to Use

Invoke this skill when:

  • The CopilotKit runtime is unreachable or returning errors
  • Agents fail to connect, respond, or stream events
  • Frontend tools are not executing or returning results
  • Transcription (voice) is failing
  • Version mismatch errors appear between packages
  • AG-UI SSE events are malformed or missing
  • CORS errors block browser requests to the runtime

Diagnostic Workflow

Step 1: Gather Information

Before proposing any fix, collect:

  1. Package versions -- Run npm ls @copilotkit/runtime @copilotkit/react-core @copilotkit/core @ag-ui/client (or the v1 equivalents). Version mismatches between runtime and React packages are a common root cause.
  2. Runtime mode -- Is this SSE mode (CopilotSseRuntime) or Intelligence mode (CopilotIntelligenceRuntime)? Check the runtime constructor.
  3. Transport configuration -- What is runtimeUrl set to on the CopilotKit provider (from @copilotkit/react-core/v2)? Does it match the basePath in createCopilotRuntimeHandler?
  4. Agent type -- Is the agent a BuiltInAgent, LangGraphAgent, A2AAgent, or custom AbstractAgent?
  5. Error messages -- Collect the exact error from browser console and server logs. CopilotKit uses structured error codes (see references/error-patterns.md).
  6. Browser network tab -- Check the /info request (runtime discovery), the /agent/:id/run SSE stream, and any CORS preflight failures.

Step 2: Check Logs and Error Codes

CopilotKit has three error code systems:

  • V1 error codes -- Legacy error codes from the v1 runtime layer (@copilotkit/runtime). Codes like NETWORK_ERROR, AGENT_NOT_FOUND, API_NOT_FOUND. Still surfaced in some contexts since @copilotkit/* packages wrap v2 internally.
  • V2 CopilotKitCoreErrorCode -- Used by @copilotkit/core. Codes like runtime_info_fetch_failed, agent_connect_failed, agent_run_failed.
  • TranscriptionErrorCode -- Used by both v1 and v2 for voice transcription. Codes like service_not_configured, rate_limited, auth_failed.

Read the full file on GitHub · 122 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 122 lines · 42 tokens per session scan A 2a98c058711e

Subscribe to this mod's changes

copilotkit-debug is a skill published in the GitHub repository CopilotKit/CopilotKit (37,138 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 1,511 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cost-efficiency-analyzer

Analyzes cost structure, cost efficiency, and expense management from P&L data. Use when the user asks about costs, expenses, COGS, operating expenses, cost ratios, cost control, spending efficiency, margin compression from cost side, or wants to understand where money is going. Also use for "are we spending too…

awslabs/agentcore-samples · 98 tokens

multi-quarter-trend-analysis

Analyzes financial trends across multiple quarters by comparing P&L metrics over time. Use when the user wants to see trends, patterns, trajectories, or directional movement across 3 or more quarters. Also use for "how are we trending", "show me the trend", "track performance over time", "quarter over quarter…

awslabs/agentcore-samples · 82 tokens

executive-financial-briefing

Generates a concise executive-level financial briefing or summary suitable for a CEO, CFO, or board presentation. Use when the user asks for a summary, briefing, executive summary, board update, financial overview, financial health check, or "how is the business doing". Covers the full P&L picture in one page. Also…

awslabs/agentcore-samples · 95 tokens

sector-rotation

Identify which market sectors to overweight or underweight based on current macro conditions and sector performance data.

awslabs/agentcore-samples · 22 tokens

trend-analysis

Analyze price and volume trends for one or more stocks to determine momentum direction and key technical levels.

awslabs/agentcore-samples · 21 tokens

kirocrew-app-dev

Build, package, and publish KiroCrew external apps. Covers app.json manifest, UI components, crons, skills, self-healing install, git publishing, and common pitfalls.

kirodotdev/KiroCrew · 43 tokens