Skip to content

Commit 85dbf25

Browse files
authored
Merge branch 'main' into fix/always-emit-assistant-message
2 parents b82e13d + cd3299b commit 85dbf25

1,570 files changed

Lines changed: 134041 additions & 22905 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/debug-mode.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@copilotkit/shared": minor
3+
"@copilotkit/runtime": minor
4+
"@copilotkit/react-core": minor
5+
"@copilotkit/core": minor
6+
---
7+
8+
feat: add debug mode to runtime and client
9+
10+
Add `debug` option to `CopilotRuntime` constructor and `<CopilotKit>` provider for detailed event pipeline logging. Server-side uses Pino structured logger; client-side passes config through to AG-UI transport. Accepts `true` for default output or a granular config: `{ events, lifecycle, verbose }`.

.changeset/empty-mails-applaud.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@copilotkit/runtime": patch
3+
---
4+
5+
fix: preserve jsonSchema structure in MCP tool parameter extraction

.changeset/five-avocados-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@copilotkit/react-core": patch
3+
---
4+
5+
fix: pass toolCallId to useRenderTool render components

.changeset/little-pears-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@copilotkit/react-ui": patch
3+
---
4+
5+
fix: pass urlTransform prop through to ReactMarkdown

.claude/docs/architecture.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,47 @@ Multiple agents can be registered in a single `CopilotRuntime`. Each agent gets
6767
### Middleware
6868

6969
`CopilotRuntime` supports `beforeRequestMiddleware` and `afterRequestMiddleware` for cross-cutting concerns like authentication, logging, and request/response transformation.
70+
71+
## Debug Mode
72+
73+
CopilotKit includes a built-in debug mode for both the runtime and client that provides detailed logging of the AG-UI event pipeline.
74+
75+
### Enabling Debug Mode
76+
77+
**Runtime (server-side):**
78+
79+
```ts
80+
const runtime = new CopilotRuntime({
81+
debug: true, // Full debug output with Pino structured logging
82+
});
83+
```
84+
85+
**Client (React):**
86+
87+
```tsx
88+
<CopilotKit debug={true} runtimeUrl="...">
89+
{children}
90+
</CopilotKit>
91+
```
92+
93+
### Granular Configuration
94+
95+
Both accept a config object for fine-grained control:
96+
97+
```ts
98+
debug: {
99+
events: true, // Log every event emitted/received (default: true)
100+
lifecycle: true, // Log request/run lifecycle (default: true)
101+
verbose: false, // Log full payloads vs summaries (default: false in object form, true in boolean form)
102+
}
103+
```
104+
105+
### What Gets Logged
106+
107+
**Runtime:** Agent run started, SSE stream opened/completed/errored, every AG-UI event emitted (with Pino structured logger).
108+
109+
**Client:** The debug configuration is forwarded to the AG-UI transport layer (`transformChunks`). CopilotKit itself does not currently emit client-side `console.debug` calls — the flag configures the underlying AG-UI event pipeline for transport-level debug output.
110+
111+
### Architecture
112+
113+
The `DebugConfig` type and `resolveDebugConfig()` normalizer live in `@copilotkit/shared`. The runtime and client toggles are independent — enabling one does not affect the other.

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,22 @@
66
*.mp4 filter=lfs diff=lfs merge=lfs -text
77
*.webm filter=lfs diff=lfs merge=lfs -text
88

9+
# Generated showcase starters — do not edit manually
10+
# Regenerate with: cd showcase/scripts && npx tsx generate-starters.ts
11+
showcase/starters/ag2/** linguist-generated=true
12+
showcase/starters/agno/** linguist-generated=true
13+
showcase/starters/claude-sdk-python/** linguist-generated=true
14+
showcase/starters/claude-sdk-typescript/** linguist-generated=true
15+
showcase/starters/crewai-crews/** linguist-generated=true
16+
showcase/starters/google-adk/** linguist-generated=true
17+
showcase/starters/langgraph-fastapi/** linguist-generated=true
18+
showcase/starters/langgraph-python/** linguist-generated=true
19+
showcase/starters/langgraph-typescript/** linguist-generated=true
20+
showcase/starters/langroid/** linguist-generated=true
21+
showcase/starters/llamaindex/** linguist-generated=true
22+
showcase/starters/mastra/** linguist-generated=true
23+
showcase/starters/ms-agent-dotnet/** linguist-generated=true
24+
showcase/starters/ms-agent-python/** linguist-generated=true
25+
showcase/starters/pydantic-ai/** linguist-generated=true
26+
showcase/starters/spring-ai/** linguist-generated=true
27+
showcase/starters/strands/** linguist-generated=true

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* @arielweinberger @mme @ataibarkai @ranst91 @tylerslaton @suhasdeshpande
1+
* @tylerslaton @jpr5 @ranst91 @marthakelly @mme
22

33
# Showcases — demo team owns these alongside core dev
4-
examples/showcases/ @CopilotKit/demo @arielweinberger @mme @ataibarkai @ranst91 @tylerslaton @suhasdeshpande
4+
examples/showcases/ @CopilotKit/demo @tylerslaton @jpr5 @ranst91 @marthakelly @mme

.github/workflows/publish-release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ jobs:
7474
git config --global user.email "github-actions[bot]@users.noreply.github.com"
7575
git config --global user.name "github-actions[bot]"
7676
77+
- name: Check for pre-existing tags
78+
run: |
79+
SCOPE="${{ steps.meta.outputs.scope }}"
80+
VERSION="${{ steps.publish.outputs.version }}"
81+
if [ "$SCOPE" == "monorepo" ]; then
82+
TAG="v${VERSION}"
83+
else
84+
TAG="${SCOPE}/v${VERSION}"
85+
fi
86+
if git rev-parse "$TAG" >/dev/null 2>&1; then
87+
echo "ERROR: Tag $TAG already exists" >&2
88+
exit 1
89+
fi
90+
7791
- name: Create and push git tag
7892
run: |
7993
SCOPE="${{ steps.meta.outputs.scope }}"
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: "Showcase: Aimock E2E Tests"
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
slug:
9+
description: "Package slug to test (e.g. langgraph-python), or 'all'"
10+
required: false
11+
default: "langgraph-python"
12+
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
issues: write
17+
18+
jobs:
19+
aimock-e2e:
20+
# Only run on PR comments matching /test-aimock, or manual dispatch
21+
if: >
22+
github.event_name == 'workflow_dispatch' ||
23+
(github.event.issue.pull_request && contains(github.event.comment.body, '/test-aimock'))
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 15
26+
27+
steps:
28+
# For issue_comment events, we need to resolve the PR HEAD SHA ourselves
29+
# because the event payload doesn't include pull_request.head.sha
30+
- name: Resolve PR HEAD ref
31+
id: pr-ref
32+
if: github.event_name == 'issue_comment'
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
const { data: pr } = await github.rest.pulls.get({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
pull_number: context.issue.number,
40+
});
41+
core.setOutput('ref', pr.head.sha);
42+
core.setOutput('pr_number', pr.number);
43+
44+
- uses: actions/checkout@v4
45+
with:
46+
ref: ${{ steps.pr-ref.outputs.ref || github.sha }}
47+
48+
- uses: actions/setup-node@v4
49+
with:
50+
node-version: 22.x
51+
52+
- uses: pnpm/action-setup@v4
53+
with:
54+
version: "10.13.1"
55+
56+
- name: Determine slug
57+
id: slug
58+
run: |
59+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
60+
echo "slug=${{ github.event.inputs.slug }}" >> "$GITHUB_OUTPUT"
61+
else
62+
COMMENT="${{ github.event.comment.body }}"
63+
SLUG=$(echo "$COMMENT" | grep -oP '/test-aimock\s+\K\S+' || echo "langgraph-python")
64+
echo "slug=$SLUG" >> "$GITHUB_OUTPUT"
65+
fi
66+
67+
- name: Detect package type
68+
id: pkg-type
69+
run: |
70+
SLUG="${{ steps.slug.outputs.slug }}"
71+
PKG_DIR="showcase/packages/$SLUG"
72+
if [ -f "$PKG_DIR/requirements.txt" ] || [ -f "$PKG_DIR/pyproject.toml" ]; then
73+
echo "has_python=true" >> "$GITHUB_OUTPUT"
74+
else
75+
echo "has_python=false" >> "$GITHUB_OUTPUT"
76+
fi
77+
78+
- name: Start aimock
79+
run: |
80+
npm install -g @copilotkit/aimock@latest
81+
npx aimock --port 4010 --host 127.0.0.1 --fixtures showcase/aimock/feature-parity.json --validate-on-load &
82+
# Wait for aimock to be ready
83+
for i in $(seq 1 20); do
84+
curl -sf http://localhost:4010/ > /dev/null 2>&1 && break
85+
sleep 1
86+
done
87+
curl -sf http://localhost:4010/ || { echo "aimock failed to start"; exit 1; }
88+
89+
- name: Setup Python agent
90+
if: steps.pkg-type.outputs.has_python == 'true'
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: "3.12"
94+
95+
- name: Start Python agent
96+
if: steps.pkg-type.outputs.has_python == 'true'
97+
run: |
98+
SLUG="${{ steps.slug.outputs.slug }}"
99+
cd "showcase/packages/$SLUG"
100+
pip install -r requirements.txt
101+
OPENAI_BASE_URL=http://localhost:4010/v1 OPENAI_API_KEY=test-key python -m uvicorn agent:app --host 127.0.0.1 --port 8000 &
102+
# Wait for agent to be ready
103+
for i in $(seq 1 30); do
104+
curl -sf http://localhost:8000/health > /dev/null 2>&1 && break
105+
curl -sf http://localhost:8000/ > /dev/null 2>&1 && break
106+
sleep 2
107+
done
108+
109+
- name: Install package dependencies
110+
run: |
111+
SLUG="${{ steps.slug.outputs.slug }}"
112+
cd "showcase/packages/$SLUG"
113+
pnpm install
114+
115+
- name: Start dev server
116+
run: |
117+
SLUG="${{ steps.slug.outputs.slug }}"
118+
cd "showcase/packages/$SLUG"
119+
OPENAI_BASE_URL=http://localhost:4010/v1 \
120+
OPENAI_API_KEY=test-key \
121+
AGENT_URL=http://localhost:8000 \
122+
pnpm dev &
123+
# Wait for dev server
124+
for i in $(seq 1 30); do
125+
curl -sf http://localhost:3000 > /dev/null 2>&1 && break
126+
sleep 2
127+
done
128+
curl -sf http://localhost:3000 || { echo "Dev server failed to start"; exit 1; }
129+
130+
- name: Install Playwright
131+
run: |
132+
cd "showcase/packages/${{ steps.slug.outputs.slug }}"
133+
npx playwright install chromium --with-deps
134+
135+
- name: Run Playwright tests
136+
run: |
137+
SLUG="${{ steps.slug.outputs.slug }}"
138+
cd "showcase/packages/$SLUG"
139+
BASE_URL=http://localhost:3000 npx playwright test --reporter=list
140+
env:
141+
CI: "true"
142+
OPENAI_BASE_URL: http://localhost:4010/v1
143+
OPENAI_API_KEY: test-key
144+
145+
- name: Upload test artifacts
146+
if: always()
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: playwright-report-${{ steps.slug.outputs.slug }}
150+
path: showcase/packages/${{ steps.slug.outputs.slug }}/playwright-report/
151+
retention-days: 7
152+
if-no-files-found: ignore
153+
154+
- name: Post result to PR
155+
if: github.event_name == 'issue_comment' && always()
156+
uses: actions/github-script@v7
157+
with:
158+
script: |
159+
const status = '${{ job.status }}' === 'success' ? '✅' : '❌';
160+
const slug = '${{ steps.slug.outputs.slug }}';
161+
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
162+
await github.rest.issues.createComment({
163+
owner: context.repo.owner,
164+
repo: context.repo.repo,
165+
issue_number: context.issue.number,
166+
body: `${status} **Aimock E2E Tests** (\`${slug}\`): ${{ job.status }}\n\n[View run](${runUrl})`
167+
});

0 commit comments

Comments
 (0)