Repository navigation
fix(runtime): keep Trajectory capture running when Learning Space assignment fails - #7770
Conversation
0.2.1 is the release of ag-ui-protocol/ag-ui#2969 (per-session endpoint factory). Replaces the preview archive pin and drops its temporary validate-pins override.
…del calls (#7664) Forwards a probe's mock and diagnostic headers onto Google Antigravity's model calls ([PNI-576](https://linear.app/copilotkit/issue/PNI-576)). Pins `ag-ui-antigravity==0.2.1`, the release of ag-ui-protocol/ag-ui#2969 (per-session endpoint factory). The preview archive pin used while 0.2.1 was unreleased has been replaced, and its temporary `validate-pins` override removed. ## Problem Google's Go harness, not the Python agent, makes Antigravity's model calls, so the probe's `X-AIMock-Strict`, `x-test-id` and `x-diag-*` headers stopped at the agent hop. A fixture miss therefore proxied to the real provider instead of failing, and the harness could only match a run's model calls in aimock's journal by integration, not by run. ## Change - **`endpoint` is passed to the adapter as a callable** (ag-ui#2969). It's resolved per session, inside the conversation's first request, where `HeaderForwardingHTTPMiddleware` has captured the inbound headers. - **New `aimock_headers()`** forwards `x-aimock-*`, `x-test-id` and `x-diag-*` when present, and always sets this package's `x-aimock-context`, which can't be overridden by the request. Other `x-*` headers (`x-forwarded-for`, …) aren't forwarded, and plain demo traffic is never made strict. - **The two Python-side Gemini calls** (`subagents.py`, `a2ui_dynamic.py`) use the same headers. - **`PARITY_NOTES.md`** "LLM path" is rewritten to match. Remaining limit: headers are fixed per conversation (the SDK sets the model config when a conversation starts). Probes use a fresh thread per conversation, so per-run correlation holds. ## Verification - **Package Python tests:** 67 pass against the released 0.2.1 (fresh venv), including 5 new ones for `aimock_headers()` and the callable endpoint. - **`validate-pins`:** google-antigravity `[OK]`, repo FAIL count at the baseline of 26. - **Real agent server + aimock in `--proxy-only` with an unreachable provider:** a probe-style request's model call carried strict, test and diagnostic headers, and dropped `x-forwarded-for`. A strict miss got 503 with no proxy attempt; a non-strict miss still proxied. - **Local isolated stack (image built with the preview pin, same code as 0.2.1; aimock on staging's strict rule):** google-antigravity D6 **39/39 green**. All 146 model calls carried `X-AIMock-Strict: true`, `x-test-id` and `x-diag-run-id`, with zero fixture misses.
The prod serviceInstance now exists on Railway (ad2c3bc8, pinned to the staging-tested digest, /api/health 200). Add its prod env block to the SSOT, regenerate railway-envs.generated.json and the promote dropdown, record the new (service, env) pair in the golden fixture, and update the prod-scope counts in the redeploy and image-ref gate tests. Refs PNI-577.
## What Registers the new **google-antigravity production** Railway instance in the showcase SSOT, following `showcase/RAILWAY.md` → "Promoting a Staging-Only Integration to Production", step 2–3. The instance itself is already provisioned (out-of-band, as RAILWAY.md prescribes): | | | |---|---| | instance | `ad2c3bc8-7006-4ac6-b6f5-1f34e35a5b98` | | domain | `showcase-google-antigravity-production.up.railway.app` | | image | `showcase-google-antigravity@sha256:2ab98357…` (same digest staging passes D5/D6 39/39 on) | | health | `/api/health` → 200 | | config | mirrors google-adk prod; `GOOGLE_GEMINI_BASE_URL` → prod aimock (promoted today with the Antigravity fixtures) | ## Changes - `railway-envs.ts`: add the `prod` env block; drop the "staging-only" comment. - Regenerated: `railway-envs.generated.json`, `showcase_promote.yml` service dropdown (`google-antigravity` is now a promote target). - Golden fixture: the new `(showcase-google-antigravity, prod)` pair — intentional behavior change. - Tests: prod-scope counts in `redeploy-env.test.ts` (41 → 42) and `verify-railway-image-refs.test.ts` (42 → 43); stale "staging-only" wording removed. ## Verification - `emit-railway-envs-json.ts --check` and `sync-promote-service-options.ts --check`: up to date - `verify-railway-image-refs.ts`: ✓ 86 env-scoped instances verified (0 skipped) - `nx run @copilotkit/showcase-scripts:test`: 87 files, 2666 tests pass After merge, the prod harness picks the instance up and the D6 column fills on the next hourly tick. Refs PNI-577 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Google Antigravity is now available in both production and staging, expanding access beyond staging. Its production deployment includes a public endpoint and health monitoring, making the service accessible and monitored in both environments. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
The production instance is provisioned, registered in the Railway SSOT and green on its production probes (PNI-577), so flip the manifest to deployed: true. The public catalog lists the integration and its demo links resolve to the production backend. Docs stay unpublished (docs_mode: hidden). Refs PNI-578.
## What Marks **google-antigravity** as `deployed: true` so the public showcase catalog lists it. The production backend went live in PNI-577 (#7673) and all of its production probes are green. Docs stay unpublished: `docs_mode` remains `hidden`. Same shape as the CrewAI conversational flows go-live (d04643c): the manifest flip plus PARITY_NOTES. ## Changes - `manifest.yaml`: `deployed: false` → `true`. `docs_mode: hidden` is unchanged. - `PARITY_NOTES.md`: - **Operational** now describes the staging and production instances. - **Documentation** records that docs stay hidden, and that the landing record's live links and `liveDemos` should be filled in when the docs surface lands, before `docs_mode` changes. `registry.json` is generated at build time (gitignored), so it has no committed diff. ## Verification - Ran `generate-registry.ts` locally. The entry is `deployed=true`, `docs_mode=hidden`, `backend_url=https://showcase-google-antigravity-production.up.railway.app`, with 37 demos. - All 36 routed demo links return **200** on the production backend. The 37th, `cli-start`, is a copy-paste command card, not a page. - With `docs_mode: hidden`, shell-docs keeps the framework out of its selector, search, sitemap and LLM routes, and `docs.copilotkit.ai/google-antigravity/*` returns 404 as intended. The public catalog (`showcase/shell`) does not render docs links. - Tests: `nx run @copilotkit/showcase-scripts:test` 2666 passed; `showcase/shell` vitest 241 passed. ## Known gap (not changed here) The `cli-start` card advertises `npx copilotkit@latest init --framework antigravity`, but the published CLI (copilotkit 4.25.0) has no `antigravity` framework yet. That entry lives in the Intelligence repo. langroid and ms-agent-harness-dotnet are already live with the same gap. Refs PNI-578 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Google Antigravity is now marked as deployed and listed in the public showcase catalog. * **Documentation** * Documentation for the integration remains unpublished while its documentation surface is hidden. Showcase guidance now points to updating the landing page’s features and live demos when documentation becomes available. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do? Moves CopilotKit from `@ag-ui/core` / `@ag-ui/client` / `@ag-ui/encoder` / `@ag-ui/proto` **1.0.1 to 1.0.2** (published to npm on 2026-10-05, AG-UI `release/2026-10-05`). Only these four packages change. `@ag-ui/langgraph`, `@ag-ui/a2ui-middleware`, `@ag-ui/mcp-*` etc. are untouched. ### Why - **Null tolerance for .NET hosts.** The 1.0.2 client accepts `null` for more optional fields. Microsoft Agent Framework .NET 1.23 sends these, and without this bump its streams fail validation in CopilotKit. ag-ui-protocol/ag-ui#2957 - **Two client bug fixes** (ag-ui-protocol/ag-ui#2959): - events emitted before an agent's error now reach `onEvent` / `onRunErrorEvent` - a failure while cleaning up the HTTP stream no longer hides the original error Published CopilotKit 1.77.0 pins these exactly at `1.0.1`, so consumers can't pick the fixes up until a release that includes this PR. ### Bumped sites (exact `1.0.1` changed to exact `1.0.2`, same style as before) Published packages (`packages/*`): `runtime` (client, core, encoder), `react-core` (client, core), `core` (client, core devDep), `shared` (client, core devDep), `angular`, `vue`, `react-native`, `web-inspector`, `mcp-apps-renderer` (devDep), `agentcore-runner`, `sqlite-runner`, `demo-agents`, `channels-core`, `channels-discord`, `channels-intelligence`, `channels-slack`, `channels-teams`, `channels-telegram`, `channels-whatsapp`. Workspace tools and examples: `tools/runtime-conformance`, `examples/canvas/mastra-pm`, `examples/showcases/generative-ui-playground`, `examples/v2/{react/demo, vue/demo, vue/storybook, angular/demo, angular/storybook, angular/demo-server}`. Docs (second commit): 17 `npm install @ag-ui/[email protected]` / `@ag-ui/[email protected]` lines across 16 `showcase/shell-docs` `.mdx` files now install 1.0.2. `ag-ui-install-pin.test.ts` requires docs installs to match the version `packages/runtime` pins. Note: until a CopilotKit release ships with this PR, a user who follows these docs next to published `@copilotkit/[email protected]` (which pins 1.0.1) gets two copies of `@ag-ui/client`. Merge this close to the release, or hold the docs commit until then. Standalone example: `examples/integrations/antigravity` (deps and `overrides`, with a targeted `package-lock.json` update of only the four `@ag-ui/*` entries). **Left as is:** - `packages/shared` peer `@ag-ui/core: ">=0.0.48"` and `packages/mcp-apps-renderer` peer `@ag-ui/client: ">=0.0.59"`. Both ranges already allow 1.0.2. - `showcase/integrations/google-antigravity`. It installs published `@copilotkit/*@1.76.0` from npm, which pin `@ag-ui/[email protected]`, and it has no `overrides`. Bumping it would install two copies of `@ag-ui/client` (1.0.2 at the top level, 1.0.1 nested under each `@copilotkit/*`). Bump it after a CopilotKit release that includes this PR. - `showcase/shell-docs/.../cookbook/jev-generative-ui.mdx`. It pins `@copilotkit/[email protected]` together with its own matching `@ag-ui` set, and `ag-ui-install-pin.test.ts` exempts lines like that. - Other examples and showcases pinned to `0.0.x`. They weren't on 1.0.1 and are out of scope. - The root `package.json` has no `@ag-ui/*` devDeps or `pnpm.overrides`. ### Lockfile `pnpm-lock.yaml` was regenerated with `pnpm install --lockfile-only` (pnpm 10.33.4, Node 22). `.npmrc` already lists the four packages under `minimum-release-age-exclude`, so the 24h release-age gate didn't block 1.0.2 and no settings were relaxed. `pnpm install --frozen-lockfile` passes. Side effects of re-resolving the changed importers: - `@ag-ui/[email protected]` (only used by `examples/showcases/generative-ui-playground`) declares `@ag-ui/client: ">=0.0.40"`. It now dedupes to 1.0.2 instead of a separate 0.0.42, so all 0.0.42 entries are gone from the lockfile. - `vue-component-type-helpers` 3.3.11 changed to 3.3.12. `@storybook/vue3` depends on it as `latest`, so it re-resolves whenever `examples/v2/vue/storybook` changes. No changeset: the repo has no `.changeset/`, and the previous bump (1.0.1, #7270) didn't use one either. ## Verification (local, Node 22.20.0, pnpm 10.33.4) - `pnpm install --frozen-lockfile` passes. `packages/{runtime,react-core,core,shared}/node_modules/@ag-ui/client` resolves to 1.0.2. - `pnpm build --skip-nx-cache`: all 31 package projects pass. - `nx run-many -t check-types --projects='packages/**'` (native runtimes excluded): all 32 projects pass. - `vitest run src/lib/__tests__/ag-ui-install-pin.test.ts` in `showcase/shell-docs` passes after the docs commit. - `pnpm test --skip-nx-cache`: all 32 package projects pass, including runtime, core, react-core and shared, which exercise the AG-UI client. - The lefthook `test-and-check-packages` pre-commit (test + publint + attw across 39 projects) passed everything except `runtime-ruby:test` (local system Ruby 2.6 is missing the `websocket` gem) and `runtime-dotnet:test` (ASP.NET Core 8 isn't installed locally). Neither is affected by this change. Because those two fail only for environment reasons, the commit was made with `--no-verify`. Commitlint was run by hand and passes. - `npm ci --dry-run` and `npm ls @ag-ui/client` in `examples/integrations/antigravity` show a single deduped `@ag-ui/[email protected]`. Nothing was released or published. ## Related PRs and Issues - Linear: PNI-551 - ag-ui-protocol/ag-ui#2957 - ag-ui-protocol/ag-ui#2959 - Previous bump: #7270 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated AG-UI dependencies from version 1.0.1 to 1.0.2 across packages and examples. * **Documentation** * Updated installation instructions and quickstarts to use AG-UI version 1.0.2. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
A platform 401/403 rejects the runtime's own API key (e.g. after a rotation), which the user and browser cannot fix. Forwarding it told the client the user was unauthorized; map it to 502 like other upstream faults. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The browser's /client sockets (agent runs, threads, memory) all come from ɵphoenixSocket$ and kept Phoenix's 30s heartbeat, so behind a 30s proxy idle timeout they still dropped and rejoined mid-run. Default them to 15s, matching the runner socket; callers can override. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ntime key
The platform answers a user denied an action (e.g. a write to read-only
memory) with 403, which the client must see; the shared conformance case
access.memory-read-only-writes broke when 403 became 502. A runtime
credential rejection is 401 ("Bad project key"), so only 401 maps to 502.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed-out renewals - Measure the lock deadline from when the acquire/renew request was sent, not when the response arrived: the platform starts the TTL when it handles the request, so a slow response let the runtime outlive the lock. - Treat a nonpositive initial lifetime as already expired instead of falling back to the configured TTL, never renew past the safety cutoff, and renew right away when the interval would run past it. - Abort a renewal that times out so it never overlaps its retry; the signal reaches fetch through ɵrenewThreadLock. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Resolve a group's key through rowRenderKeys for both its React key and its state key, so a backend renaming the group's first message mid-stream (lc_run-- to resp_) no longer remounts the wrapper or drops its state. - Give each group one cached setState, pruned with its state, so wrappers that depend on it in an effect or memo do not re-run every render. - Mention groupMessages in the dev warning when children disables virtualization. - Docs: the example keeps assistant text out of collapsed tool groups, key advice matches the rename behaviour, and the threshold wording says it counts the messages in the returned rows. - Test that an opened group stays open after scrolling out of a virtualized thread and back, with a scroll helper whose virtual window really moves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on read (#7430) ## The bug `GET /threads/:id/events`, `/messages` and `/state` wrap the platform call in one catch-all. The platform's answer for a conversation that has not been spoken in yet is specific and typed — **404, category `not_found`, explicitly not retryable** — and the runtime flattens it into a logged error plus a generic **500**. A thread with no events is the opening state of *every* conversation, and a freshly mounted chat asks for all three. So the runtime produces a server error on every new chat, as a matter of course. ``` GET /api/copilotkit/threads/<fresh-id>/events → 500 Failed to fetch thread events (platform said: 404 THREAD_NOT_FOUND) ``` ## Why it is worth fixing Not the log noise. **The noise is indistinguishable from a real fault.** Found while demoing this repo's showcase app: a genuinely failing run and a perfectly normal empty chat produced the same red error badge. The badge had been on all evening, so it carried no signal, and a real break went unnoticed twice — once for about twenty minutes. ## The change The three read catch blocks now route through the status mapping the memory handlers already had: client-actionable 4xx (404, 409, 422, …) forwarded verbatim, platform 5xx as `502`, non-platform as `500`. A fresh thread's read now answers **404**, the platform's own typed answer, instead of a generic 500. That mapper moves to `handlers/shared/platform-error.ts`, so both handlers share one copy instead of two that would drift. A platform **401** is the exception and also surfaces as `502`. It rejects the runtime's own credentials (e.g. a rotated API key, `"Bad project key"`), not the end user, so forwarding it would tell the browser the user is unauthenticated for a fault only the server can fix. A platform **403** stays forwarded: the platform uses it to deny the user an action (e.g. a write to read-only memory), which the client must see, and the shared `access.memory-read-only-writes` case asserts it. Because the memory handlers share the mapper, they get the same treatment. ### Why not an empty result An earlier revision answered the 404 with `{ events: [] }` / `{ messages: [] }` / `{ state: null }`. That broke the shared `access.thread-identity-*-messages` conformance cases. The platform deliberately answers **another user's** thread with the same 404 as a missing one, so that a caller cannot learn which threads exist. The runtime cannot tell the two apart, and an empty 200 turned a foreign-thread read into a success. Forwarding the 404 keeps that contract and matches what the native runtimes already return. If the empty-chat noise should go away entirely, the place to do it is the client, which knows it just created the thread. ## Tests Read paths forward a platform 404 as 404; a platform 5xx surfaces as 502; a platform 401 surfaces as 502 while a 403 is forwarded; a non-platform throw stays 500. - `@copilotkit/runtime` test and check-types: 193 files / 2739 tests passed. - Full TypeScript conformance suite (`run.mjs -- node tools/runtime-conformance/typescript-driver.mjs`): 132 cases passed, 0 failed, including both `access.thread-identity-*-messages` cases. - `runtime-conformance` test and lint: passed. `oxfmt` clean; `oxlint` 0 errors. ## Related Independent of #7352, but found in the same session — both are cases of the runtime reporting an expected state as a failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Thread event, message, and state reads now preserve platform 404 responses instead of returning a generic 500. * Platform errors with client-actionable statuses from 400 through 499, except 401, retain their status. Platform 401 and other platform errors return 502; unexpected non-platform errors return 500. * Memory-related errors now follow the same status-code handling. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…om the feed (refs PE-430)
…e workbench (refs PE-430)
…ync builders) (#7510) ## What does this PR do? The `headers` option now accepts a record, a sync builder, or an async builder. A builder runs **when each request is sent**, not when the provider renders. **The bug on `main`:** a sync builder ran during the provider's render. So if a token rotated without a provider re-render, CopilotKit kept sending the old token. For example, Clerk tokens live for 60 seconds, and typing in the chat input doesn't re-render the provider. After about a minute idle, the next run got a 401. Intelligence makes this worse, because thread refetches and realtime reconnects run without any user action, including in background tabs. There was also no way to pass an async `getToken()` at all (#1937, #2159). Measured with the real `@copilotkit/react-core` v2 build in jsdom, sending real HTTP requests to a local runtime that rejects tokens older than 60 s, after a real 65 s idle with no provider re-render: | Request after 65 s idle | `main` | this branch | |---|---|---| | Send a message (run) | **401**, token 65,053 ms old | 200, token 3–4 ms old | | `useThreads().renameThread()` (via `ɵruntimeFetch`) | **401**, token 65,051 ms old | 200, token 4–6 ms old | ### How it works - **Core** (`@copilotkit/core`): a `HeaderSourceResolver` owns the headers source. - It resolves synchronously for a record or a sync builder, so static and sync users gain no extra `await`. - For an async builder, concurrent requests share one in-flight call. A generation counter makes sure a call started before `setHeaders()` is never reused after it. - New public API: `resolveHeaders()`, `CopilotKitHeadersSource`, `CopilotKitHeaderResolutionError`, and the error code `HEADER_RESOLUTION_FAILED`. - `ɵruntimeFetch` adds the current headers when each request is sent, before the runtime watchdog is armed and before the single-route rewrite. The request's own `Content-Type`/`Accept` still win, and core headers still beat an agent's own headers (#5635 precedence). - `/info`, inspector metadata, runs, connects, stop requests and `/suggest` all resolve current headers. - **React v2** `CopilotKitProvider` and **`<CopilotKit>`** (also the main v2 export): the provider hands core one stable builder and never calls it during render. `<CopilotKit>` accepts async builders too. The one exception is the legacy v1 GraphQL `CopilotTask` path: it doesn't await an async builder, and it logs a one-time dev warning. - **Vue** and **Angular** (Angular accepts a builder for the first time), **web-inspector**, **react-textarea** (a dead render-time headers read was removed), and the **docs**. - **Out of scope:** React Native is unchanged (sync builder, evaluated at render); a follow-up issue will cover it. Cross-origin agent headers (#5635) are unchanged, and the docs now warn about them. ### Behavior changes 1. **A sync builder now runs once per request**, not once per provider render. 2. **A new token from a builder doesn't fire `onHeadersChanged`** and doesn't refetch threads or inspector metadata. Only `setHeaders()` or a new source does. 3. **`setHeaders()` with an equal record is a no-op**, and so is passing the same builder function again. 4. **User switch with a builder:** re-rendering the provider no longer reloads the thread list or re-subscribes realtime, because the builder's identity is stable. On a user switch, remount the provider (for example `key={userId}`), or call `setHeaders` with a new function or a record. The docs say this. Commit 9a69623 carries a `BREAKING CHANGE:` footer, so this lands under Breaking Changes in the release notes. 5. **Fail closed:** if a builder throws or rejects, or returns something that isn't an object (for example `() => token && {...}` before sign-in), the request is not sent. `onError` receives `header_resolution_failed` once per failed call. A header failure replaces the `AGENT_RUN_FAILED`/`AGENT_CONNECT_FAILED` that used to follow. A sync builder that threw used to crash render; now it fails closed. A header failure on `/info` sets the runtime status to Error and logs a warning that names headers. 6. **`copilotkit.headers`** is the last resolved value. With a builder it is `{}` until the first request. Angular's `headers()` signal follows source changes only (`{}` for a builder); use `core.resolveHeaders()` instead. 7. **A proxied runtime agent's `agent.headers` no longer contains core headers.** They are added at send time. Three existing tests (two #5635 remote-agent tests and one registered-proxy test) now assert on the request instead of on the field. 8. **Stop requests** and provisional proxies (React, Vue, Angular) now go through `ɵruntimeFetch` (stop requests are marked non-critical). 9. **v1 `copilotApiConfig.headers`** is a lazy getter, so a sync builder runs when `CopilotTask.run` reads it. 10. **`CpkThreadInspector.headers`** is deprecated in favor of `resolveHeaders`, and still works as a fallback. 11. **Angular `updateRuntime({ headers })`** now applies the license-key default to the new headers, as construction always did. Passing the same builder again is a no-op. 12. **Type widenings:** `CopilotKitCoreConfig.headers`, Angular `CopilotKitConfig.headers`, and the `headers` prop on `CopilotKitProvider`, Vue and `<CopilotKit>`. `resolveHeaders()` returns a read-only record. ### Follow-ups - #7511: `HEADER_RESOLUTION_FAILED` has no agent or thread context. - #7512: React `use-agent` re-applies headers on value changes instead of the generation. - #7513: React Native parity. - #7514: core headers reach user-supplied agents on other origins (#5635 behavior, documented here). - #7515 (stacked on this PR): moves the hand-written v1 `CopilotKit` docs notes into the JSDoc they're generated from, and deletes an orphaned auto-generated snippet. ## Related PRs and Issues - Closes #1937 - Supersedes #6291. Thanks to @rodboev: that PR's review is where the StrictMode, identity-churn and sync-timing traps in this design were found. - Related: #2159 (closed as a duplicate of #1937), #3401 / OSS-551 ## Testing Everything below ran on this branch, rebased onto `origin/main` at `b3d1aad2e3`. Each suite also ran on a clean `origin/main` worktree in the same environment. **Unit and integration suites (branch):** | Package | Result | |---|---| | `@copilotkit/core` | 1007 / 1007 pass; `check-types` clean | | `@copilotkit/react-core` | 1771 vitest + 54 node:test pass; `check-types` clean | | `@copilotkit/vue` | 1160 / 1160 pass; `vue-tsc` clean | | `@copilotkit/angular` | 452 pass, 1 skipped (already skipped on main); `check-types` clean | | `@copilotkit/web-inspector` | 794 / 794 pass; `check-types` clean | | `@copilotkit/react-textarea` | 3 / 3 pass; `check-types` clean | - **Compared with `origin/main`:** no failures appear on the branch only. `use-agent-context-timing.e2e` failed once, during a run that overlapped a parallel `pnpm install`. It didn't recur in 2 full runs, 3 isolated runs or 10 runs under load. Its agent isn't an `HttpAgent`, so this change adds no await on its path. - **Mutation checks:** every new test was checked by breaking the mechanism it guards, confirming the test fails, and restoring. Examples: - render-time builder evaluation → the stale-token tests fail; - dropping the generation guard → the in-flight reuse tests fail; - keying on header values → the no-reload tests fail; - a snapshot spread on a `ɵruntimeFetch` site → the removed-key tests fail; - awaiting unconditionally → the sync-timing tests fail. - **Other gates:** - oxlint: 0 errors. On the 49 modified files, warnings go from 58 on `main` to 49. The 12 new files add 4, for 53 in total. - Public API manifest: unchanged. - Release, config-allowlist and static-quality script tests: pass. - shell-docs search index and typecheck: pass. Its suite passes except 3 PNG checks, which fail only because the worktree has LFS pointer files instead of images. - Size: core is 1.19 kB larger minified. The size job is informational. - Angular showcase initial-bundle budget: 1,479,169 raw bytes on the branch vs 1,479,152 on `main` (cap 1,551,287). An earlier push failed this check because `config.ts` imported a value from `@copilotkit/core`, which pulled all of core into the initial bundle. `config.ts` now imports types only, and a test guards it. - **Not run locally:** `check:packages`, `verify:angular-package`, `verify:runtime-package`, `verify:channels-umbrella`, and the web-inspector browser tests. CI covers them. - **Docs:** every edited `.mdx` parses with the repo's `@mdx-js/mdx`. - **Live check:** the table at the top. I re-ran both scenarios on the final head (`71368fea1e`) with the same results: after a 65 s idle with 0 provider re-renders, the run sent a 2 ms-old token (200) and the rename a 5 ms-old token (200). **Review round (9a69623), after merging `origin/main` at `07d4830ade`:** - Trajectory connect and suggestions from a cloned `HttpAgent` now resolve headers at send time. There are two new rows in `core-headers-request-table.test.ts`. - Mutation check: with both source fixes reverted, the two new rows fail (`Expected: "fresh"`, `Received: "stale"`). With the fixes, the table and trajectory files pass: ``` Test Files 3 passed (3) Tests 85 passed (85) ``` - The React thread-context test now sends a request and re-renders after the token change. Mutation check: with `use-threads.tsx` keyed on `JSON.stringify(copilotkit.headers)`, the test fails (`1 failed`). On the PR code, the file passes (`13 passed`). - `nx run-many -t test check-types lint` for core, react-core, react-textarea, vue, angular and web-inspector: `check-types` passes for all six. Two tests timed out under the parallel load (`CopilotThreadsDrawer.ssr`, `MCPAppsUiMessage.e2e`). Both pass when run alone. `vue:lint` reports 166 errors, which also exist on `main`. None of them is on a line this PR adds. ## Checklist - [x] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [ ] "Allow edits by maintainers" is checked (not applicable: this branch is in this repo) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Web providers now accept synchronous and asynchronous header builders, resolving the current headers when requests are sent across runtime requests, agents, threads, transcription, and the Inspector. * Valid public API keys are included by default in request headers. * Changing the header source refreshes relevant thread and Inspector data; token updates from a builder alone do not trigger those refreshes. * Header resolution failures prevent the affected request and report `header_resolution_failed`. * **Documentation** * Updated guidance on header builders and request timing, including React Native’s synchronous-only behavior and the legacy v1 async-builder limitation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…7692) ## What does this PR do? Typing into a captured text field produces one event after a 300 ms pause. Capture records the pending edit before a field commit, focus change, click, submit, navigation, developer event, Enter outside input-method composition, or explicit stop. Checkbox, radio, select, range, and color controls remain immediate. Paired `input` and `change` notifications for one edit produce one record. A later user edit can record the same value again, including after a programmatic reset. Password edits remain redacted and restart the trailing timer even when their recorded values are identical. Composition keeps the latest observed draft pending. Completing composition starts the timer; an explicit action or stop preserves the pending draft even if composition is unfinished. IME candidate-selection Enter does not flush, and a late composing event cannot disable later edits. Background network responses do not interrupt typing. Input timestamps mark when the edit is recorded after debounce or an earlier flush, not the last keystroke. Existing redaction and exclusions still apply at delivery. Core drains pending input before its best-effort final batch on explicit stop. A connection failure discards that edit and reports its dropped count exactly once after reconnect, without replaying the text. Stop remains synchronous and does not guarantee persistence. The earlier heartbeat fix remains: cleanup disables `connect()` on a retired Phoenix socket before disconnecting it. Recovery obtains a fresh grant and creates a new socket; a stopped socket cannot reconnect with a consumed token. ## Validation Review head: `eae815aab263cb7f543d1f7e6a9efc70ef22d3e9`. - **218 Learning tests** and **1,237 Core tests across 89 files** passed, including nine real-Phoenix integration cases. Builds, type checks, and normal commit validation hooks passed. - Seven Chromium checks using trusted browser events failed on the old bundle and passed on the new one: repeated text, password, checkbox, and select edits after reset; Enter-to-send ordering; and unfinished composition followed by stop or a click that preserves focus. - Focused regression tests failed before each implementation change. Mutation checks prove the pagehide test fails without its flush, both collectors' network tests fail if network ends a typing burst, and real Phoenix loses the final edit if the stop drain is removed. The fast Enter-to-send network regression also fails when Enter flushing is removed. Tests cover the 299/300 ms boundary, IME flags, re-redaction at delivery, listener cleanup, and dropped-count reset. - Documentation parses and formatting checks pass. Earlier full-stack expense checks covered typing then change, immediate approval, and stopping before blur through SDK → Runtime → API/gateway → Redis/PostgreSQL; each saved one final input, and immediate approval preserved input → click → outcome. GitHub CI is green on `eae815aab263cb7f543d1f7e6a9efc70ef22d3e9`: **67 checks passed, 3 skipped, none pending or failed**. Package validation, type checks, the Node/React matrix, runtime conformance, and [docs integration tests](https://github.com/CopilotKit/CopilotKit/actions/runs/38000224521/job/114059016960) all passed. This head needed no CI reruns. The CI mirror changes have been removed from this PR's net diff and moved to [CI PR #7758](#7758), covering both PR checks and post-merge builds, including Alpine. Existing signed history is preserved with a forward commit. All ten PR commits are verified and authored by `marthakelly`; the update-from-main merge carries GitHub's signature. ## Related PRs and Issues [Intelligence #1726](https://github.com/CopilotKit/Intelligence/pull/1726) contains the viewer and happy-path video. That recording uses SDK feature head `5315b3d`; the new regression evidence above covers this follow-up. Debouncing belongs to SDK capture; the viewer displays the events it receives. Apps need an SDK release containing these changes—updating the Intelligence frontend alone does not change capture frequency. ## Checklist - [x] I have read the Contribution Guide. - [x] Capture timing and stop behavior are documented in the Learning README and Captured data reference. - [x] No public API, package version, or generated changelog was changed.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ent fails A selector error, timeout, or invalid result, or a selected Space that does not exist, used to stop Trajectory capture for the user. A typo in a Space ID or a deleted Space would end all capture, with only a generic browser warning. Capture now continues without assignments, and the Runtime logs which Trajectory and which Space IDs were affected. The Runtime no longer returns LEARNING_CONTAINER_SELECTION_FAILED, so Core no longer needs to treat that code as terminal. Sparse selector arrays now fail validation instead of sending null IDs.
…selector The warning and doc comments said authenticated capture does not assign Learning Containers. With getTrajectoryLearningContainerIds that is no longer true, so they now tell developers to assign Learning Spaces on the server instead.
… capture The docs said a missing Space or a failed selector stops capture. They now describe the new behavior: the Runtime logs the problem and connects the Trajectory without assignments. They also say that a linked Thread's Space does not add the Trajectory, that a membership removed in Intelligence stays removed, and that the browser chooses the Trajectory ID.
If the browser aborted between the first join and the retry, the Runtime still logged an unknown-Space warning before the retry failed. It now stops first. New tests pin down that only LEARNING_CONTAINER_NOT_FOUND triggers the retry, so ownership and validation errors keep their code, and that a failed retry surfaces its own error without another attempt. The docs now say that an unknown Space also drops the Spaces that exist, because Intelligence checks the whole list before writing.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Production Digest-Pinning AuditAll 43 services digest-pinned. Run 2026-10-12 07:24:24 PDT — 0 finding(s). |
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-telegram
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/intelligence-langgraph
@copilotkit/intelligence-mastra
@copilotkit/learning
@copilotkit/mcp-apps-renderer
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
|
Size Change: +36.6 kB (+2.07%) Total Size: 1.8 MB 📦 View Changed
ℹ️ View Unchanged
|
marthakelly
left a comment
There was a problem hiding this comment.
Reviewed f16624d, including the merge resolution and the four follow-up commits on top of #7601. No blocking findings.
The fallback keeps capture running when Space selection fails. A missing Space causes only one retry without assignments; authentication and Trajectory ownership checks still apply, other errors propagate, and an aborted request does not retry. The docs and browser warnings match that behavior.
Validation: 120 focused Runtime tests passed locally, and the Core and React Core test targets passed through Nx. CI has 101 successful checks and 6 skipped checks. The unrelated demo changes introduced during the merge were also checked and are formatting/type-import changes with no functional differences found.
This PR targets the #7601 branch. After merging this follow-up, recheck the combined #7601 against main before landing it.
0953041
into
codex/trajectory-learning-assignment
Follow-up to #7601 for the Learning launch (PE-708).
With #7601, any problem with Space assignment stops Trajectory capture for that user: a typo in a Space ID, a deleted Space, or a selector that throws or times out. The developer only sees a generic browser warning. At launch that is easy to hit, and it costs all capture, not just the assignment.
Changes
ff2befe659: mergesmaininto this branch and resolves theclient.tsconflict. Main's try/catch and network logging around the join request stay as they are.f93a14da6f: assignment problems no longer stop capture.learningContainerIds.LEARNING_CONTAINER_NOT_FOUNDlogs a warning with the IDs, then retries the join once without them.LEARNING_CONTAINER_SELECTION_FAILEDgoes back to main, because the Runtime no longer returns that code.nullIDs.24e625eb88: the browserlearningContainerIdswarning used to say that authenticated capture can't assign Spaces. It now points togetTrajectoryLearningContainerIds.7d7cf974deandf16624d9d0: docs for the new behavior, plus tests showing that onlyLEARNING_CONTAINER_NOT_FOUNDcauses a retry. Ownership and validation errors keep their code, and a request aborted between the two joins stops without retrying.Because of the merge, the diff against
codex/trajectory-learning-assignmentincludes main's changes too. Review the four commits afterff2befe659.Validation (at
f16624d9d0)nx testfor runtime (2952), core (1237), react-core (1876) and learning (218)check-types,build,publint/attw/check-dts,check:public-api-manifestoxfmt --check,pnpm run lint(0 errors)typecheckandtest:ci(500)