Files
Maximiliano Korp 164b53ebcb fix(channels): isolate factory-returned agents; drop per-run lock/runner keys
Keeps the isolation fix and removes the concurrency mechanism, which two
landings on main superseded while this branch was open.

Isolation (kept, narrowed):
- Clone the result of an `agent: (threadId) => ...` factory as well as the
  singleton config. #6256 already isolated the singleton path; a factory
  returning a shared instance was still handed to every turn un-isolated,
  carrying the previous turn's messages and lifecycle flags and serializing
  those turns behind one identity key in DeliveryAdapter.acquireAgent.
- Reset `isRunning` / `abortController` on the clone as hygiene. Documented as
  such: `runAgent` reassigns `abortController` before every run, so an
  inherited aborted controller cannot by itself kill a follow-up turn.
- Drop the `activeRunDetach$` / `activeRunCompletionPromise` resets. `clone()`
  copies a fixed field list that excludes both, so they were always undefined.
- Document that `AbstractAgent.prototype.clone()` drops subclass-declared
  fields silently, and correct the clone() error text: a factory no longer
  bypasses cloning, so it is not an escape hatch.

Concurrency mechanism (removed):
- Restore `runner.run/stop({ threadId: canonicalThreadId })`.
  IntelligenceAgentRunner does not use this as a local map key; it sends it as
  `thread_id` when joining `ingestion:<runId>`, and the gateway resolves it
  against `cpki.threads`, so a `<threadId>::<runId>` value fails the join with
  `thread_not_found`. Added a regression guard asserting the canonical id.
- Restore the unprefixed product thread lock. The gateway derives this same key
  in four places and reads its value as "which run is active on this thread".
  It is also the only mutual exclusion spanning runtime replicas, since
  DeliveryTransport's per-thread admission gate (#6257) is instance state.

Also:
- Forward `lockKeyPrefix` on cleanup in both the channel path and
  handlers/intelligence/run.ts, so a configured prefix releases the key it
  acquired instead of leaking it.
- Collapse the four copy-pasted clone-patching test scaffolds into one
  `patchAgentAndClones` helper.
2026-07-30 14:08:31 -07:00
..
2026-04-10 23:38:59 +00:00
2026-07-28 17:48:23 -07:00

CopilotKit - Runtime

banner

✨ Why CopilotKit?

  • Minutes to integrate - Get started quickly with our CLI
  • Framework agnostic - Works with React, Next.js, AGUI and more
  • Production-ready UI - Use customizable components or build with headless UI
  • Built-in security - Prompt injection protection
  • Open source - Full transparency and community-driven
class-support-ecosystem

🧑‍💻 Real life use cases

Deploy deeply-integrated AI assistants & agents that work alongside your users inside your applications.

headless-ui

Documentation

To get started with CopilotKit, please check out the documentation.

Analytics & Privacy

CopilotKit uses Scarf for anonymous usage analytics to help improve the product. Scarf handles all privacy compliance and does not store raw IP addresses. This helps us understand how CopilotKit is being used and prioritize improvements.

Opting Out

To disable analytics, set the environment variable:

export COPILOTKIT_TELEMETRY_DISABLED=true

Or use the DO_NOT_TRACK standard:

export DO_NOT_TRACK=1