Commit Graph

6618 Commits

Author SHA1 Message Date
Jordan Ritter 93e3993cf9 chore: update CODEOWNERS default reviewers (#3920)
## Summary
- Update default CODEOWNERS reviewers to: @tylerslaton @jpr5 @ranst91
@marthakelly @mme
- Remove @arielweinberger, @ataibarkai, and @suhasdeshpande from
reviewers
- Update showcase path-specific rule to match the new reviewer list
2026-04-14 17:07:21 -07:00
Jordan Ritter 580a3e9214 fix: langgraph-python starter agent — permissions, imports, and tools.py naming collision
Root causes (verified locally with docker build + run):
1. PermissionError: non-root user can't write .langgraph_api dir — fix: chown -R app:app /app
2. ImportError: relative imports fail in langgraph_cli context — fix: absolute imports
3. ValueError: tools.py and tools/ directory collision — fix: rename to tool_wrappers.py

Tested: docker run returns {"status":"ok","agent":"ok"}
2026-04-14 17:06:02 -07:00
Jordan Ritter 0bd59333f7 chore: update CODEOWNERS default reviewers 2026-04-14 16:35:14 -07:00
Jordan Ritter aff9350f17 fix: pass toolCallId to useRenderTool render components (#3741) 2026-04-14 16:24:45 -07:00
Jordan Ritter d534ccc7a0 fix: call onChange("") after send in controlled input mode (#3593) 2026-04-14 16:24:28 -07:00
Jordan Ritter e01d510a7a fix(sdk-python): serialize Pydantic Context and Tool objects to dicts in LangGraphAGUIAgent (#3690) 2026-04-14 16:23:52 -07:00
Jordan Ritter 78c65a8a38 fix: ensure tool_result and tool_use messages stay paired after token trimming (#2450) 2026-04-14 16:23:34 -07:00
Jordan Ritter 97acd2e4d9 fix: add Zod v4 compatibility for schema-to-JSON conversion
Detect Zod v4 schemas by checking for a toJSONSchema() method on the
schema object. When present, call it directly instead of routing through
zod-to-json-schema (which cannot handle Zod v4 internals).

Priority order:
1. Standard JSON Schema V1 (~standard.jsonSchema.input)
2. Zod v4 native (schema.toJSONSchema())
3. Zod v3 fallback (injected zodToJsonSchema)

Removes the dead vendor === "zod4" check (Zod v4 reports "zod") and
the _def duck-typing fallback (unnecessary with toJSONSchema detection).

Closes #3636
2026-04-14 16:15:58 -07:00
Jordan Ritter 4320b78024 fix: pin langgraph versions to prevent runtime crashes (#3918)
Pin langgraph-api to <0.8.0 to prevent langgraph_runtime.database import
failure in fresh Docker builds.
2026-04-14 16:12:31 -07:00
Jordan Ritter a7cf38211c fix: add configurable maxInputTokens to OpenAI and Anthropic adapters (#2405) 2026-04-14 16:11:39 -07:00
Jordan Ritter ae7e189e50 fix: pin langgraph versions to prevent breaking API changes 2026-04-14 16:09:53 -07:00
Jordan Ritter 626b86c23b feat: fill QA checklists with real test steps, add test coverage matrix
Replace TODO placeholders in all 73 QA checklist files across 17 showcase
packages with specific, actionable test steps derived from reading the
actual demo page source code. Each checklist now references real
data-testid selectors, hook names, expected UI states, and interaction
flows.

Add showcase/QA-COVERAGE.md with a comprehensive matrix showing coverage
across manual QA, Vitest unit tests, Playwright E2E (smoke and interaction),
per-package E2E, aimock fixtures, and CI automation for all 9 demos plus
the Sales Dashboard starter hero.
2026-04-14 16:06:58 -07:00
Jordan Ritter 87c6850850 fix: add agent_server.py to all Python starters (#3916)
## Summary

- All non-langgraph Python starters were broken because they tried to
run `uvicorn agent.<module>:app` but those modules don't export a
FastAPI `app` — the demo packages use `agent_server.py` as the FastAPI
wrapper
- Copies `agent_server.py` from each demo package into the starter root,
rewriting `from agents.` to `from agent.` for the starter directory
layout
- Updates all non-langgraph Python `devScript` entries to use
`agent_server:app`
- Updates `Dockerfile.python` template to `COPY agent_server.py` and
`getEntrypointBlock()` to use `agent_server:app`
- Fixes `langgraph-fastapi` to use `langgraph_cli dev` like
`langgraph-python` (it was incorrectly configured as a uvicorn-based
starter when it actually uses a langgraph.json graph config)
- All starters regenerated, `--check` mode passes, 537 tests pass

## Test plan

- [x] `npx tsx generate-starters.ts --check` passes
- [x] `nx test @copilotkit/showcase-scripts` — 537 tests pass
- [ ] Deploy a non-langgraph Python starter (e.g. pydantic-ai) to
Railway and verify it starts
2026-04-14 15:56:08 -07:00
Jordan Ritter a46218557c fix: add remarkPlugins/rehypePlugins passthrough support (#2296) 2026-04-14 15:55:08 -07:00
Jordan Ritter bcea46771b fix: handle urlTransform=null correctly in Markdown component
The truthiness check swallowed null, which is a valid value in
react-markdown that explicitly disables the default URL sanitizer.
Changed to an explicit undefined check.
2026-04-14 15:53:40 -07:00
Jordan Ritter 0c4383d74c fix: add satisfies constraint and improve test coverage for onAfterRequest
- Add `satisfies OnAfterRequestOptions` for compile-time type safety (consistent with onBeforeRequest)
- Replace `(m: any)` casts with type predicates and explicit `as unknown as Message[]`
- Add TODO comment for hardcoded empty properties
- Expand test to verify all 6 fields of OnAfterRequestOptions
- Add edge case tests for undefined messages and missing threadId/runId
2026-04-14 15:48:12 -07:00
Jordan Ritter 8aa369b58f fix: preserve nullable semantics and add Zod support for null-union types
- Mark parameters as optional when null is present in the type union
- Add matching null-union handling to convertJsonSchemaToZodSchema
- Add 7 tests covering null-union edge cases for both converters
2026-04-14 15:47:40 -07:00
Jordan Ritter f403105ad9 fix: only set hasReceivedContent for processed content blocks
Move hasReceivedContent flag inside each content block type handler
so that skipped unknown tool_use blocks do not prevent the fallback
response mechanism from activating. Add tests for unknown tool
skipping behavior.
2026-04-14 15:47:27 -07:00
Jordan Ritter 9952fb1d82 fix: update test expectations for agent_server:app devScripts 2026-04-14 15:45:21 -07:00
Maxim 5058d195cc refactor: test hygiene for web-inspector spec
Extract shared helpers to reduce duplication and centralize unavoidable
casts. Add simulateSetState to mock controller to eliminate double-casts
in the new onStateChanged test. Promote mockClipboard to describe scope
to remove navigator clipboard cast in assertion. Add try/catch error
handling to syncAgentMessages and syncAgentState.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 00:43:49 +02:00
Jordan Ritter e3e8edcd42 fix: remove invalid secrets reference in deploy workflow step conditions 2026-04-14 15:41:52 -07:00
Jordan Ritter 59c073c610 fix: add agent_server.py to all Python starters, matching demo packages
Python starters were trying to run uvicorn with agent.<module>:app but
those modules don't export a FastAPI app. The demo packages use
agent_server.py as the FastAPI wrapper, so starters need it too.

Changes:
- Copy agent_server.py from each demo package into starter root,
  rewriting "from agents." to "from agent." for the starter layout
- Update all non-langgraph Python devScripts to use agent_server:app
- Update Dockerfile.python to COPY agent_server.py for non-langgraph
- Update getEntrypointBlock() generic Python to use agent_server:app
- Make langgraph-fastapi use langgraph_cli dev like langgraph-python
  (it was incorrectly configured as a uvicorn-based starter)
- Regenerate all starters
2026-04-14 15:41:34 -07:00
Jordan Ritter 4bd57af65d test: add tests for array content normalization in TOOL_CALL_RESULT
Cover the MCP adapter scenario where content arrives as an array of
{type:"text", text:string} objects, and verify non-text parts are
filtered out during normalization.
2026-04-14 15:41:25 -07:00
Jordan Ritter 10edf630f6 fix: clean Slack alert formatting across showcase workflows (#3914)
## Summary

- **drift-detection**: Split inline payload into `jq`-built file +
`payload-file-path`; sanitize playwright output (strip ANSI, head -3,
cap 200 chars)
- **starter-smoke**: Replace `toJSON(format(...))` double-encoding with
`jq` payload builder
- **showcase_deploy**: Replace 300-char inline ternary with readable
shell conditional + `jq`

All three workflows now use the same pattern: build a sanitized JSON
file with `jq -n`, then reference it via `payload-file-path`. This
eliminates raw `%0A` in Slack messages, unformatted stack traces, and
double-encoded JSON.

## Test plan

- [ ] Trigger `showcase_drift-detection.yml` manually — verify Slack
alert formats correctly on failure
- [ ] Trigger `starter-smoke.yml` manually — verify Slack alert on a
known-failing starter
- [ ] Trigger `showcase_deploy.yml` with `service: shell` — verify
deploy notification renders cleanly
- [ ] Confirm no `%0A` or raw escape sequences appear in any Slack
message
2026-04-14 15:38:07 -07:00
Jordan Ritter 886ce96f54 fix: remove test-integration-tmp from starter-smoke (lost in merge) (#3915)
The #3899 merge only applied the deploy workflow change, not the
starter-smoke change. This line causes a guaranteed failure on every PR.
2026-04-14 15:37:56 -07:00
Jordan Ritter 8a013f9a08 fix: remove test-integration-tmp from starter-smoke matrix (lost in #3899 merge) 2026-04-14 15:37:21 -07:00
Jordan Ritter 6e66ea626b fix: clean Slack alert formatting across showcase workflows
Use jq to build JSON payloads safely and payload-file-path to avoid
inline multiline content. Limits error context to 3 lines, strips ANSI
codes, and caps field length at 200 chars.

- drift-detection: split payload build from post, sanitize playwright output
- starter-smoke: replace toJSON(format(...)) double-encoding with jq
- showcase_deploy: replace 300-char inline ternary with readable shell conditional
2026-04-14 15:33:41 -07:00
Jordan Ritter 203e0adc9c fix: align langgraph-python starter with working demo package layout (#3907)
## Summary

- The langgraph-python starter crashes on Railway because `langgraph_cli
dev --config agent/langgraph.json` can't resolve module paths when
agents live in `agent/` with `dependencies: ["."]` pointing to `/app`
- Restructured starter to match the demo package's **proven working
layout**: agents in `src/agents/`, `langgraph.json` at project root,
entrypoint referencing root config
- Templatized `Dockerfile.python` with `{{AGENT_DIR}}` and
`{{DOCKER_EXTRA_COPY}}` variables so the generator handles different
agent directory structures
- Updated tests to use framework `agentDir` instead of hardcoding
`"agent"`
- All 17 starters regenerated, 518 tests passing

## Test plan

- [ ] Deploy langgraph-python starter to Railway — should return 200
like the demo package
- [ ] Verify other Python starters still build/deploy (Dockerfile
template changed for all)
- [ ] `npx tsx generate-starters.ts --check` passes
- [ ] All vitest suites pass: generate-starters.test.ts (248) +
starter-consistency.test.ts (270)
2026-04-14 15:29:03 -07:00
Jordan Ritter 80ee51dc46 fix: wider starter hero section, sticky renderer selector above sidebar (#3913)
## Summary

- Shell: starter section breaks out to `max-w-[90rem]` (1440px) while
header/demos stay at `max-w-5xl` (1024px) — gives the dashboard +
sidebar room to breathe
- Starter: renderer selector bar gets `sticky top-0 z-[60]` — stays
visible and clickable above the CopilotKit sidebar (z-50)
- All 17 starters regenerated with sticky header
2026-04-14 15:28:52 -07:00
Jordan Ritter 665c312372 fix: harden deploy pipeline — independent concurrency, post-deploy health checks (#3908)
## Summary

- **Fix concurrency group**: Manual dispatches targeting different
services no longer cancel each other. Push events still cancel stale
deploys (same group), but `workflow_dispatch` runs for different
services get unique groups and run independently.
- **Add post-deploy health check**: After Railway deploy, polls the
service health endpoint (6 attempts over ~90s). Non-blocking for
sleep-on-idle services but logs clearly for visibility.
- **Enhance Slack notification**: Now includes service count and names
in both success and failure messages, plus guards against empty webhook
secret.
2026-04-14 15:26:54 -07:00
Jordan Ritter c8b5bfd890 fix: wider starter hero section, sticky renderer selector above sidebar 2026-04-14 15:26:24 -07:00
Jordan Ritter 8f2fb0da82 fix: mock navigator in clipboard test for Node 20 compatibility 2026-04-14 15:18:30 -07:00
Jordan Ritter 24f5886a94 fix: format 2026-04-14 15:12:40 -07:00
Jordan Ritter 1855ea11c2 fix: format 2026-04-14 15:12:10 -07:00
Jordan Ritter afc36a3da9 fix: mock navigator in clipboard test for Node 20 compatibility 2026-04-14 15:11:35 -07:00
Maxim df199123da fix: inspector syncs state on direct agent.setState()
When using selfManagedAgents, calling agent.setState() directly only
fires onStateChanged — the inspector subscribed to onStateSnapshotEvent
(pipeline-only) but not onStateChanged, leaving the "Current State"
panel permanently stale. Add onStateChanged handler mirroring the
existing onMessagesChanged pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 00:08:53 +02:00
Jordan Ritter f169af188d fix: responsive iframe height and scrollable starter content (#3910)
## Summary

- Starter globals.css: `overflow: hidden` → `overflow: auto` so
dashboard content scrolls inside the iframe
- Shell iframe: fixed `600px` → `min(80vh, 900px)` for responsive
scaling with viewport

The "Add a deal" button and CopilotKit sidebar were getting cut off in
the 600px iframe.
2026-04-14 15:08:10 -07:00
Jordan Ritter 8ca2b38557 fix: responsive iframe height and scrollable starter content 2026-04-14 15:07:00 -07:00
Jordan Ritter 3a79f8a6eb chore: add changeset for debug mode feature 2026-04-14 14:58:54 -07:00
Jordan Ritter 39b4ea6ecc docs: clarify client-side debug prop behavior
Updated JSDoc and troubleshooting docs to accurately describe that
the client-side debug prop forwards config to the AG-UI transport
layer, not CopilotKit's own logging. Removed fabricated console.debug
output examples that don't exist.
2026-04-14 14:58:44 -07:00
Jordan Ritter 295a1e609e fix: sync debug prop changes at runtime in CopilotKitProvider
debug was only read at construction time. Added setDebug() to
CopilotKitCore and added it to the provider's prop-sync useEffect
so runtime changes to the debug prop take effect.
2026-04-14 14:58:33 -07:00
Jordan Ritter fde4e0b424 fix: cache pino debug logger on runtime instead of creating per-request
createLogger() was called on every request when debug was enabled,
instantiating a new pino + pino-pretty stream each time. Now creates
a single logger in the runtime constructor and passes it to handlers.
Added test verifying pre-created logger is reused.
2026-04-14 14:58:22 -07:00
Jordan Ritter 6689de4522 fix: thread debug config through to ProxiedCopilotRuntimeAgent
Debug config was silently dropped because ProxiedCopilotRuntimeAgentConfig
had no debug field. Now stores it in the constructor, resolves it in
AgentRegistry before passing, and clone() preserves it. Added 6 tests
verifying the full threading chain.
2026-04-14 14:58:09 -07:00
Jordan Ritter 971a8165aa fix: default verbose to false when debug: true to prevent PII exposure
When users pass the boolean shorthand `debug: true`, verbose previously
defaulted to true, logging full event payloads including user messages,
tool args, and state snapshots. Now defaults to false — users must
explicitly opt in with `debug: { verbose: true }`.
2026-04-14 14:57:22 -07:00
Jordan Ritter 44dec7c72e fix: harden deploy pipeline — independent concurrency, post-deploy health checks 2026-04-14 14:44:44 -07:00
Jordan Ritter 695c945d3e fix: align langgraph-python starter with working demo package layout
The langgraph-python starter crashes on Railway because of a directory
structure mismatch: agents were in agent/ with langgraph.json inside
agent/, causing langgraph_cli to fail resolving module paths.

Match the demo package's working layout:
- Move agents from agent/ to src/agents/ (same as demo)
- Put langgraph.json at project root (same as demo)
- Point entrypoint at root langgraph.json instead of agent/langgraph.json
- Templatize Dockerfile.python with AGENT_DIR and DOCKER_EXTRA_COPY vars
- Skip langgraph.json path rewriting when agentDir matches agentSourceDir
- Update tests to use framework agentDir instead of hardcoding "agent"

Regenerate all 17 starters.
2026-04-14 14:37:37 -07:00
Jordan Ritter 09385779c9 fix: format showcase_deploy.yml (#3903)
Remove trailing blank line from `showcase_deploy.yml` to fix `oxfmt
--check` failure in `static/quality` CI.
2026-04-14 14:35:42 -07:00
Jordan Ritter 2438896409 fix: respect user expand/collapse intent in reasoning message (#3897)
## Summary

- **Component bug fix:** `CopilotChatReasoningMessage` auto-collapse
`useEffect` unconditionally called `setIsOpen(false)` when streaming
ended, overriding any manual expand/collapse the user had performed.
Added a `userToggledRef` that tracks explicit clicks so the effect only
auto-collapses when the user hasn't interacted.
- **Flaky test fix:** `CopilotChat.e2e.test.tsx` reasoning toggle test
used `fireEvent.click` without `act()`, causing React 18 to defer the
state update through its scheduler. This raced with `waitFor` polling on
slow CI runners (Node 20.x/22.x), producing nondeterministic failures
across multiple PRs.

## Test plan

- [x] Existing reasoning message tests pass with both fixes applied
- [x] Pre-commit hooks (lint, format, test, build) pass
- [ ] Verify intermittent CI failures on unit (20.x/22.x) no longer
reproduce

Note: This fixes the intermittent unit test failures that have been
appearing across multiple unrelated PRs.
2026-04-14 14:35:38 -07:00
Jordan Ritter c57ec88d5c fix: idempotent adduser in Dockerfile templates + regenerate starters (#3906)
Makes groupadd/useradd idempotent with || true in all 4 Dockerfile
templates. Regenerates all 17 starters.
2026-04-14 14:34:23 -07:00
Jordan Ritter 1e0de53a25 fix: add null check for navigator.clipboard across all copy-to-clipboard calls (#2114) (#3813)
Fixes #2114

Red-green tested locally.
2026-04-14 14:31:13 -07:00