Skip to content

feat(agents): dynamic agents as a real Lifecycle capability - #2250

Open
mattzcarey wants to merge 1 commit into
mainfrom
feat/dynamic-agents-capability
Open

feat(agents): dynamic agents as a real Lifecycle capability#2250
mattzcarey wants to merge 1 commit into
mainfrom
feat/dynamic-agents-capability

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What this does

After #2193, dynamic agents (facets) were still an Agent-owned facade: DynamicAgentsInternal took a ~40-member DynamicAgentHostPort, Agent passed this as the host and kept ~20 _cf_* RPC entry points, and four hot paths bypassed the capability runner on purpose. Nothing could install dynamic agents on a plain Durable Object.

This PR makes DynamicAgents a real Lifecycle capability, migrates Agent (and Think / AIChatAgent through it) onto it with no observable behavior change, and ships a plain-DO example.

1. DynamicAgents at agents/dynamic-agents

export class Workspace extends DurableObject<Env> {
  readonly children = new DynamicAgents({ onBeforeChild });
  readonly lifecycle = Lifecycle.install(this).use(this.children);

  _cf_lifecycle(envelope: LifecycleRouteEnvelope) {
    return this.lifecycle.route(envelope);
  }

  async open(name: string) {
    const notebook = await this.children.get(Notebook, name);
    return notebook.listNotes();
  }
}
  • Spawns, supervises, and addresses children: get / abort / delete / has / list; identity as isChild / name / parentPath / selfPath; from inside a child, parent(Cls), deleteSelf(), broadcast(), keepAlive(), holdLease() / releaseLease().
  • Claims /sub/{class}/{name}/... HTTP requests (onRequest) and WebSocket upgrades (onWebSocketUpgrade) after the onBeforeChild gate, so the runner bypasses are gone. Options are policy only: onBeforeChild, checkLeases, keepAliveIntervalMs.
  • Owns its state: the cf_agents_sub_agents registry, the cf_agents_facet_runs lease index, root-held keep-alive tokens, and its own keep-alive / lease-sweep Lifecycle jobs.
  • Provides the route transport (provideRouteTransport) that Scheduler and Tasks use to reach the root, walking the tree one hop at a time over the hosts' single _cf_lifecycle aperture. All cross-object traffic is a discriminated DynamicAgentRouteMessage union; bridges ride by reference as RpcTargets.
  • A child's sockets stay on the root under DynamicAgents' own attachment namespace and are bridged into the child's WebSockets capability, whose handlers, getConnections(), and connection.setState() see them like any other connection. Sockets accepted by the previous release (WebSockets __pk + __user._cf_subAgentOuterUrl) are recognized and still served.

Every wire- and storage-visible identifier is unchanged: tables, the three identity storage keys, the legacy connection flags, the x-cf-agents-subagent-url header, path-v2 identity strings, route-key format, the ${class}\0${name} facet key, and the pinned console error strings.

2. Lifecycle primitives (the special cases became generic)

  • Bootstrap envelopes: LifecycleRouteEnvelope.bootstrap delivers a message before startup (LifecycleRouteContext.started === false); the capability writes what startup must observe and calls lifecycle.ready(). This is how a fresh child learns its identity before its onStart.
  • Capability-provided transport: DurableObjectCapability.provideRouteTransport(inbound); one provider per Lifecycle. inbound.deliver() is local delivery, queued while starting and flushed inside the input gate. setLifecycleRouteTransport is deleted.
  • Route retirement: LifecycleRoutes.retire() fans out to onRouteRetired; Scheduler and Tasks implement it and lose __DO_NOT_USE_WILL_BREAK__cleanupRoutePrefix.
  • Narrow services: facets, exports, object, waitUntil on LifecycleServices. DurableObjectState is still never handed to a capability.
  • WebSockets accepts bridged:sync / bridged:connect / bridged:message / bridged:close on its route; a routed (child) Lifecycle owns no platform sockets, so there the bridged connections are the only ones.

3. Agent migration

Agent installs new DynamicAgents({ onBeforeChild: this.onBeforeSubAgent, checkLeases, keepAliveIntervalMs }) first in its use() chain and reads identity from it. Deleted: the host port, the DynamicAgents facade class, _isFacet / _facetName / _parentPath, the /sub/ branch of Agent.fetch, the forwarding branches in the onConnect / onMessage / onClose wrappers, _restoreAgentFacetContext, _runFacetInitInvocation, the facet term of _nextHousekeepingWakeMs, and every internal _cf_* facet RPC method (_cf_initAsFacet, _cf_invokeAgentPath, _cf_invokeSubAgent, keep-alive, lease, connection, and WebSocket forwarding entry points). _cf_lifecycle is the only routing aperture. index.ts loses 534 net lines.

subAgent()-family methods, /sub/ URLs, useAgent({ sub }), onBeforeSubAgent, parentAgent(), and getSubAgentByName keep working. Two protected one-liners (_cf_requestTargetsSubAgent, _cf_connectionTargetsSubAgent) stay, deprecated, because published Think / ai-chat releases call them in every onConnect; their now-dead calls are removed from Think and AIChatAgent in this PR.

Behavior deltas: onBeforeSubAgent runs after Lifecycle startup and inside host context; intermediate hops no longer register deep-targeted connections; facet keep-alive holds live on the capability rather than _keepAliveRefs; the x-agents-lifecycle-props header no longer leaks into /sub/ children; the restore_agent_state startup span is gone.

Install order is load-bearing and documented: DynamicAgents first, before capabilities that route to children and before WebSockets. The capability throws at startup, with the one-line snippet, when a host lacks _cf_lifecycle.

4. Example, tests, docs

  • examples/next/dynamic-agents-plain: a Workspace spawns Notebook children on plain DOs, forwards HTTP, bridges WebSockets, gates by registry, with tests.
  • tests/capabilities/dynamic-agents.ts fixtures and tests/dynamic-agents/* suites (spawn and identity, HTTP forwarding and the gate, bridged WebSockets including legacy sockets, teardown and retirement, keep-alive and leases, child schedules through the root); Lifecycle routing primitive tests; a WebSockets bridged-connection probe; tests-d/dynamic-agents-export.test-d.ts.
  • Test fixtures move their fault injection from Agent _cf_* overrides to _cf_lifecycle overrides keyed on payload.type.
  • docs/agents/sub-agents.md gains "On a plain Durable Object"; docs/agents/lifecycle.md documents the transport, bootstrap envelopes, retirement, the new services, and bridged connections. Minor changeset for agents.

Verification

  • packages/agents workers project: 1908 tests / 124 files green (plus the 30 facet-related files rerun after the shim removal: 386 tests)
  • @cloudflare/think: 896 tests; @cloudflare/ai-chat workers: 653 tests
  • examples/next/dynamic-agents-plain: 4 tests
  • Repo: pnpm run typecheck (121 projects), oxfmt --check ., oxlint, sherif, check:exports all clean

Not in this PR

No migration of applications off facet-backed chat sessions; the many-chats topology stays documentation-only (#2193). Facet fault injection in tests still goes through _cf_lifecycle overrides rather than a public seam.


Devin Review

DynamicAgents (agents/dynamic-agents) installs on any plain Durable Object
with Lifecycle.install(this).use(new DynamicAgents()) plus a one-line
_cf_lifecycle routing aperture. It spawns, supervises, and addresses child
Durable Objects, forwards /sub/ HTTP and WebSocket upgrades after an
onBeforeChild gate, owns keep-alive holds and fiber leases as its own jobs,
and provides the route transport Scheduler and Tasks use to reach the root.

Lifecycle gains the primitives this needed: bootstrap envelopes delivered
before startup, a capability-provided route transport with local inbound
delivery queued during startup, routes.retire() fanning out to
onRouteRetired (Scheduler and Tasks implement it), and narrow facets,
exports, object, and waitUntil services. WebSockets accepts bridged:*
route messages so a child's sockets, which live on the root, reach the
child's own handlers and getConnections().

Agent installs the capability itself and drops its facet host port, the
DynamicAgents facade, and every internal _cf_* facet RPC method; only
_cf_lifecycle remains as the routing aperture. Sockets accepted by the
previous release keep reaching their child.

Adds examples/next/dynamic-agents-plain, plain-DO fixtures and suites,
Lifecycle routing and WebSockets bridging tests, and docs.
@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a32dd58

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Minor
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@agent-think

agent-think Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🟡 agents import sizes

Measured 340 runtime imports as minified bundles. The primary size is gzip; raw minified size is included for diagnosis. An existing import growing by more than 10% is marked red. This report is informational.

Red Yellow Green Unchanged New Removed
0 62 50 224 4 0

Compared 5f7ad7e4 with a32dd580. Open workflow run.

Changed imports (116)
Status Import Base gzip Head gzip Delta
🟡 agents/lifecycle#Lifecycle 8.3 KiB 8.8 KiB +530 B (+6.27%)
🟡 agents/websockets#WebSockets 17.7 KiB 18.3 KiB +580 B (+3.2%)
🟡 agents#getSubAgentByName 258.9 KiB 261.3 KiB +2.4 KiB (+0.94%)
🟡 agents#routeAgentRequest 259.2 KiB 261.6 KiB +2.4 KiB (+0.93%)
🟡 agents#buildAgentUrl 259.3 KiB 261.7 KiB +2.4 KiB (+0.93%)
🟡 agents#unstable_callable 258.7 KiB 261.1 KiB +2.4 KiB (+0.93%)
🟡 agents#DurableObjectOAuthClientProvider 258.6 KiB 261.0 KiB +2.4 KiB (+0.92%)
🟡 agents#callable 258.6 KiB 261.0 KiB +2.4 KiB (+0.92%)
🟡 agents#buildAgentPath 259.2 KiB 261.5 KiB +2.4 KiB (+0.92%)
🟡 agents#MCP_SERVER_ID_MAX_LENGTH 258.6 KiB 261.0 KiB +2.4 KiB (+0.92%)
🟡 agents#routeSubAgentRequest 258.8 KiB 261.2 KiB +2.4 KiB (+0.92%)
🟡 agents#getCurrentAgent 258.6 KiB 261.0 KiB +2.4 KiB (+0.92%)
🟡 agents#DEFAULT_AGENT_STATIC_OPTIONS 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#isPlatformTransientError 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#isDurableObjectStorageReset 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#isDurableObjectMemoryLimitReset 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#createHeaderBasedEmailResolver 258.8 KiB 261.2 KiB +2.4 KiB (+0.91%)
🟡 agents#StreamingResponse 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#Agent 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#parseSubAgentPath 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#MessageType 258.8 KiB 261.1 KiB +2.4 KiB (+0.91%)
🟡 agents#normalizeServerId 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#getAgentByName 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#__DO_NOT_USE_WILL_BREAK__agentContext 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#SqlError 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#camelCaseToKebabCase 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#AGENT_TOOL_PROGRESS_PART 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#SUB_PREFIX 258.6 KiB 261.0 KiB +2.4 KiB (+0.91%)
🟡 agents#__DO_NOT_USE_WILL_BREAK__withInvocationScope 258.6 KiB 261.0 KiB +2.3 KiB (+0.91%)
🟡 agents#isDurableObjectCodeUpdateReset 258.6 KiB 261.0 KiB +2.3 KiB (+0.91%)
🟡 agents#AGENT_TOOL_MILESTONE_PART 258.6 KiB 261.0 KiB +2.3 KiB (+0.91%)
🟡 agents#routeAgentEmail 258.9 KiB 261.2 KiB +2.3 KiB (+0.9%)
🟡 agents/chat-sdk#createChatSdkState 261.0 KiB 263.2 KiB +2.2 KiB (+0.85%)
🟡 agents/chat-sdk#ChatSdkStateAdapter 261.0 KiB 263.2 KiB +2.2 KiB (+0.85%)
🟡 agents/chat-sdk#ChatSdkStateAgent 260.4 KiB 262.6 KiB +2.2 KiB (+0.85%)
🟡 agents/workflows#AgentWorkflow 260.0 KiB 262.2 KiB +2.2 KiB (+0.84%)
🟡 agents/workflows#WorkflowRejectedError 258.7 KiB 260.9 KiB +2.2 KiB (+0.83%)
🟡 agents/chat-sdk#defaultThreadShard 258.7 KiB 260.8 KiB +2.1 KiB (+0.83%)
🟡 agents/chat-sdk#defaultKeyShard 258.8 KiB 260.9 KiB +2.1 KiB (+0.83%)
🟡 agents/mcp#WorkerTransport 345.8 KiB 348.1 KiB +2.3 KiB (+0.65%)
🟡 agents/mcp#MCP_SERVER_ID_MAX_LENGTH 342.4 KiB 344.7 KiB +2.2 KiB (+0.65%)
🟡 agents/mcp#ElicitRequestSchema 342.4 KiB 344.6 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#RPC_DO_PREFIX 342.5 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#StreamableHTTPEdgeClientTransport 342.6 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#getMcpAuthContext 342.5 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#normalizeServerId 342.5 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#SSEEdgeClientTransport 342.6 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#RPCClientTransport 342.5 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#RPCServerTransport 342.5 KiB 344.7 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#McpAgent 342.5 KiB 344.6 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#DurableObjectEventStore 342.4 KiB 344.6 KiB +2.2 KiB (+0.64%)
🟡 agents/mcp#createLegacyMcpHandler 375.9 KiB 378.1 KiB +2.1 KiB (+0.56%)
🟡 agents/mcp#createMcpHandler 388.2 KiB 390.4 KiB +2.2 KiB (+0.56%)
🟡 agents/mcp#experimental_createMcpHandler 376.1 KiB 378.2 KiB +2.1 KiB (+0.55%)
🟡 agents/chat#TextSegmentJoiner 2.7 KiB 2.7 KiB +4 B (+0.14%)
🟡 agents/chat#dispatchChatRecoveryToHandoff 3.0 KiB 3.0 KiB +2 B (+0.06%)
🟡 agents/chat#setChatRecovering 2.5 KiB 2.5 KiB +1 B (+0.04%)
🟡 agents/chat#TurnQueue 2.6 KiB 2.6 KiB +1 B (+0.04%)
🟡 agents/chat#repairInterruptedToolParts 2.6 KiB 2.6 KiB +1 B (+0.04%)
🟡 agents/chat#applyAgentToolEvent 3.2 KiB 3.2 KiB +1 B (+0.03%)
🟡 agents/chat#createChatStreams 6.4 KiB 6.4 KiB +2 B (+0.03%)
🟡 agents/chat#createToolsFromClientSchemas 114.3 KiB 114.3 KiB +1 B (+0%)
🟢 agents/schedules#Scheduler 6.8 KiB 6.8 KiB -29 B (-0.42%)
🟢 agents/lifecycle#LifecycleCapability 484 B 483 B -1 B (-0.21%)
🟢 agents/tasks#Tasks 8.9 KiB 8.8 KiB -17 B (-0.19%)
🟢 agents/chat#createChatFiberSnapshot 2.5 KiB 2.5 KiB -2 B (-0.08%)
🟢 agents/chat#aiSdkRecoveryCodec 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#CHAT_RECOVERY_ALARM_DEBOUNCE_MS 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#CHAT_RECOVERY_INCIDENT_TTL_MS 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#DEFAULT_CHAT_RECOVERY_NO_PROGRESS_TIMEOUT_MS 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#normalizeToolInput 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#applyChunkToParts 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#CHAT_MESSAGE_TYPES 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#DEFAULT_CHAT_RECOVERY_MAX_ATTEMPTS 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#MAX_BOUND_PARAMS 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#CHAT_RECOVERY_TASK_NAME 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#CHAT_LAST_TERMINAL_KEY 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#clientResolvableToolNames 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#clearChatTerminal 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#STREAM_RESUME_NONE_REASONS 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#drainInteractionApplies 2.3 KiB 2.3 KiB -1 B (-0.04%)
🟢 agents/chat#recordChatTerminal 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#ChatStreamStalledError 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#bumpChatRecoveryProgress 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#shouldCreditStreamProgress 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#buildChatRecoveringFrame 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#sendIfOpen 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#pausedExecutionUpdate 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#awaitWithDeadline 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#listActiveChatRecoveryIncidents 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#crossMessageToolResultUpdate 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#buildInClauseStrings 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#classifyAgentToolChildRecovery 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#hasIncompleteToolBatch 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#sweepStaleChatRecoveryIncidents 2.4 KiB 2.4 KiB -1 B (-0.04%)
🟢 agents/chat#interceptAgentToolBroadcast 2.5 KiB 2.5 KiB -1 B (-0.04%)
🟢 agents/chat#AbortRegistry 2.5 KiB 2.5 KiB -1 B (-0.04%)
🟢 agents/chat#ContinuationState 2.7 KiB 2.7 KiB -1 B (-0.04%)
🟢 agents/chat#createChatTurnTaskDefinition 2.7 KiB 2.7 KiB -1 B (-0.04%)
🟢 agents/chat#AgentToolProgressEmitter 2.7 KiB 2.7 KiB -1 B (-0.04%)
🟢 agents/chat#SubmitConcurrencyController 2.9 KiB 2.9 KiB -1 B (-0.03%)
🟢 agents/chat#StreamAccumulator 2.9 KiB 2.9 KiB -1 B (-0.03%)
🟢 agents/chat#ResumeHandshake 3.0 KiB 3.0 KiB -1 B (-0.03%)
🟢 agents/chat#broadcastTransition 3.2 KiB 3.2 KiB -1 B (-0.03%)
🟢 agents/chat#truncateOlderMessages 3.2 KiB 3.2 KiB -1 B (-0.03%)
🟢 agents/chat#enforceRowSizeLimit 3.5 KiB 3.5 KiB -1 B (-0.03%)
🟢 agents/websockets#CALLABLES_RPC_VALUE 12.4 KiB 12.4 KiB -3 B (-0.02%)
🟢 agents/websockets#CALLABLES_RPC_QUERY 12.4 KiB 12.4 KiB -3 B (-0.02%)
🟢 agents/websockets#isCallablesRpcUpgrade 12.4 KiB 12.4 KiB -3 B (-0.02%)
🟢 agents/websockets#callablesRpcUrl 12.5 KiB 12.4 KiB -3 B (-0.02%)
🟢 agents/websockets#callablesFromDecorated 12.7 KiB 12.7 KiB -3 B (-0.02%)
🟢 agents/chat#ChatRecoveryEngine 4.4 KiB 4.4 KiB -1 B (-0.02%)
agents#DynamicAgents 261.0 KiB
agents/dynamic-agents#DynamicAgents 10.0 KiB
agents/dynamic-agents#parseSubAgentPath 720 B
agents/dynamic-agents#SUB_PREFIX 330 B
All 340 current runtime imports
Status Import Gzip Raw minified
🟡 agents#__DO_NOT_USE_WILL_BREAK__agentContext 261.0 KiB 1136.8 KiB
🟡 agents#__DO_NOT_USE_WILL_BREAK__withInvocationScope 261.0 KiB 1136.8 KiB
🟡 agents#Agent 261.0 KiB 1136.8 KiB
🟡 agents#AGENT_TOOL_MILESTONE_PART 261.0 KiB 1136.8 KiB
🟡 agents#AGENT_TOOL_PROGRESS_PART 261.0 KiB 1136.8 KiB
🟡 agents#buildAgentPath 261.5 KiB 1139.1 KiB
🟡 agents#buildAgentUrl 261.7 KiB 1139.5 KiB
🟡 agents#callable 261.0 KiB 1136.8 KiB
🟡 agents#camelCaseToKebabCase 261.0 KiB 1136.8 KiB
🟡 agents#createHeaderBasedEmailResolver 261.2 KiB 1137.2 KiB
🟡 agents#DEFAULT_AGENT_STATIC_OPTIONS 261.0 KiB 1136.8 KiB
🟡 agents#DurableObjectOAuthClientProvider 261.0 KiB 1136.8 KiB
agents#DynamicAgents 261.0 KiB 1136.8 KiB
🟡 agents#getAgentByName 261.0 KiB 1136.8 KiB
🟡 agents#getCurrentAgent 261.0 KiB 1136.8 KiB
🟡 agents#getSubAgentByName 261.3 KiB 1137.5 KiB
🟡 agents#isDurableObjectCodeUpdateReset 261.0 KiB 1136.8 KiB
🟡 agents#isDurableObjectMemoryLimitReset 261.0 KiB 1136.8 KiB
🟡 agents#isDurableObjectStorageReset 261.0 KiB 1136.8 KiB
🟡 agents#isPlatformTransientError 261.0 KiB 1136.8 KiB
🟡 agents#MCP_SERVER_ID_MAX_LENGTH 261.0 KiB 1136.8 KiB
🟡 agents#MessageType 261.1 KiB 1137.1 KiB
🟡 agents#normalizeServerId 261.0 KiB 1136.8 KiB
🟡 agents#parseSubAgentPath 261.0 KiB 1136.8 KiB
🟡 agents#routeAgentEmail 261.2 KiB 1137.5 KiB
🟡 agents#routeAgentRequest 261.6 KiB 1138.7 KiB
🟡 agents#routeSubAgentRequest 261.2 KiB 1137.3 KiB
🟡 agents#SqlError 261.0 KiB 1136.8 KiB
🟡 agents#StreamingResponse 261.0 KiB 1136.8 KiB
🟡 agents#SUB_PREFIX 261.0 KiB 1136.8 KiB
🟡 agents#unstable_callable 261.1 KiB 1137.0 KiB
agents/agent-tools#agentTool 112.5 KiB 538.2 KiB
agents/browser#BrowserConnector 50.5 KiB 176.6 KiB
agents/browser#browserContent 36.3 KiB 127.4 KiB
agents/browser#browserExtract 36.3 KiB 127.4 KiB
agents/browser#browserLinks 36.3 KiB 127.4 KiB
agents/browser#browserMarkdown 36.3 KiB 127.4 KiB
agents/browser#browserPdf 36.3 KiB 127.3 KiB
agents/browser#BrowserRenderingError 36.0 KiB 126.7 KiB
agents/browser#browserScrape 36.3 KiB 127.4 KiB
agents/browser#browserScreenshot 36.3 KiB 127.3 KiB
agents/browser#browserSnapshot 36.3 KiB 127.4 KiB
agents/browser#CdpSession 37.2 KiB 129.8 KiB
agents/browser#CodemodeRuntime 39.6 KiB 139.0 KiB
agents/browser#connectBrowser 37.8 KiB 131.4 KiB
agents/browser#connectBrowserSession 37.5 KiB 130.4 KiB
agents/browser#connectUrl 37.6 KiB 130.5 KiB
agents/browser#createBrowserSession 36.3 KiB 127.5 KiB
agents/browser#DEFAULT_EXEC_SWEEP_IDLE_MS 36.0 KiB 126.6 KiB
agents/browser#DEFAULT_SWEEP_IDLE_MS 36.0 KiB 126.6 KiB
agents/browser#deleteBrowserSession 36.1 KiB 126.9 KiB
agents/browser#DurableBrowserSessionStore 36.4 KiB 127.6 KiB
agents/browser#getBrowserRecording 36.2 KiB 127.1 KiB
agents/browser#listBrowserTargets 36.1 KiB 126.9 KiB
agents/browser#loadCdpSpec 36.6 KiB 128.3 KiB
agents/browser#runQuickAction 36.0 KiB 126.6 KiB
agents/browser/ai#createBrowserRuntime 147.0 KiB 632.8 KiB
agents/browser/ai#createBrowserTools 147.0 KiB 632.9 KiB
agents/browser/ai#createQuickActionTools 122.5 KiB 554.3 KiB
agents/browser/tanstack-ai#createBrowserTools 162.7 KiB 701.7 KiB
agents/channels#ChannelHost 3.3 KiB 9.1 KiB
agents/channels#consumeChunks 237 B 321 B
agents/channels#createUserIdentityStore 1.3 KiB 3.2 KiB
agents/channels#fallback 155 B 160 B
agents/channels#fallbackChannel 893 B 1.9 KiB
agents/channels#fanout 151 B 156 B
agents/channels#fanoutChannel 875 B 1.9 KiB
agents/channels#identityKey 178 B 223 B
agents/channels#isChannelMessageSurface 271 B 452 B
agents/channels#linkChannelIdentities 113 B 99 B
agents/channels#matchesPath 110 B 96 B
agents/channels#routes 307 B 507 B
agents/channels#UserIdentityConflictError 248 B 335 B
agents/channels/ai-sdk#createSendMessageTool 112.2 KiB 537.4 KiB
agents/channels/ai-sdk#toChannelChunks 112.5 KiB 538.4 KiB
agents/channels/email#email 23.5 KiB 75.4 KiB
agents/channels/email#inboundEmail 22.3 KiB 72.3 KiB
agents/channels/slack#slack 5.5 KiB 14.6 KiB
agents/channels/slack#slackWebhook 2.2 KiB 5.1 KiB
agents/channels/tanstack-ai#createSendMessageTool 16.2 KiB 68.4 KiB
agents/channels/telegram#telegram 3.8 KiB 10.3 KiB
agents/channels/telegram#telegramWebhook 1.6 KiB 3.6 KiB
agents/channels/voice#browserVoice 1010 B 2.2 KiB
🟢 agents/chat#AbortRegistry 2.5 KiB 8.9 KiB
agents/chat#AGENT_TOOL_STREAM_PROGRESS_BUMP_THROTTLE_MS 2.3 KiB 8.2 KiB
🟢 agents/chat#AgentToolProgressEmitter 2.7 KiB 9.5 KiB
agents/chat#AgentToolStreamProgressThrottle 2.4 KiB 8.3 KiB
🟢 agents/chat#aiSdkRecoveryCodec 2.3 KiB 8.2 KiB
🟡 agents/chat#applyAgentToolEvent 3.2 KiB 11.0 KiB
🟢 agents/chat#applyChunkToParts 2.3 KiB 8.2 KiB
agents/chat#applyToolUpdate 2.4 KiB 8.4 KiB
agents/chat#AutoContinuationController 2.3 KiB 8.2 KiB
🟢 agents/chat#awaitWithDeadline 2.4 KiB 8.4 KiB
🟢 agents/chat#broadcastTransition 3.2 KiB 11.4 KiB
🟢 agents/chat#buildChatRecoveringFrame 2.4 KiB 8.4 KiB
🟢 agents/chat#buildInClauseStrings 2.4 KiB 8.4 KiB
🟢 agents/chat#bumpChatRecoveryProgress 2.4 KiB 8.3 KiB
agents/chat#byteLength 2.5 KiB 8.5 KiB
🟢 agents/chat#CHAT_LAST_TERMINAL_KEY 2.3 KiB 8.2 KiB
🟢 agents/chat#CHAT_MESSAGE_TYPES 2.3 KiB 8.2 KiB
agents/chat#CHAT_RECOVERING_FLAG_TTL_MS 2.3 KiB 8.2 KiB
agents/chat#CHAT_RECOVERING_KEY 2.3 KiB 8.2 KiB
🟢 agents/chat#CHAT_RECOVERY_ALARM_DEBOUNCE_MS 2.3 KiB 8.2 KiB
agents/chat#CHAT_RECOVERY_INCIDENT_KEY_PREFIX 2.3 KiB 8.2 KiB
🟢 agents/chat#CHAT_RECOVERY_INCIDENT_TTL_MS 2.3 KiB 8.2 KiB
agents/chat#CHAT_RECOVERY_PROGRESS_KEY 2.3 KiB 8.2 KiB
agents/chat#CHAT_RECOVERY_STABLE_RETRY_DELAY_SECONDS 2.3 KiB 8.2 KiB
🟢 agents/chat#CHAT_RECOVERY_TASK_NAME 2.3 KiB 8.2 KiB
agents/chat#CHAT_STREAM_PROGRESS_CREDIT_THROTTLE_MS 2.3 KiB 8.2 KiB
🟢 agents/chat#ChatRecoveryEngine 4.4 KiB 15.3 KiB
agents/chat#chatRecoveryTaskRunOptions 2.4 KiB 8.6 KiB
🟢 agents/chat#ChatStreamStalledError 2.4 KiB 8.3 KiB
🟢 agents/chat#classifyAgentToolChildRecovery 2.4 KiB 8.5 KiB
🟢 agents/chat#clearChatTerminal 2.3 KiB 8.3 KiB
🟢 agents/chat#clientResolvableToolNames 2.3 KiB 8.3 KiB
🟢 agents/chat#ContinuationState 2.7 KiB 9.8 KiB
agents/chat#createAgentToolEventState 2.3 KiB 8.3 KiB
🟢 agents/chat#createChatFiberSnapshot 2.5 KiB 8.6 KiB
agents/chat#createChatRecoveryTaskDefinition 2.6 KiB 9.0 KiB
🟡 agents/chat#createChatStreams 6.4 KiB 22.0 KiB
🟢 agents/chat#createChatTurnTaskDefinition 2.7 KiB 8.9 KiB
🟡 agents/chat#createToolsFromClientSchemas 114.3 KiB 545.4 KiB
🟢 agents/chat#crossMessageToolResultUpdate 2.4 KiB 8.6 KiB
🟢 agents/chat#DEFAULT_CHAT_RECOVERY_MAX_ATTEMPTS 2.3 KiB 8.2 KiB
agents/chat#DEFAULT_CHAT_RECOVERY_MAX_OOM_RETRIES 2.3 KiB 8.2 KiB
agents/chat#DEFAULT_CHAT_RECOVERY_MAX_WORK 2.3 KiB 8.2 KiB
🟢 agents/chat#DEFAULT_CHAT_RECOVERY_NO_PROGRESS_TIMEOUT_MS 2.3 KiB 8.2 KiB
agents/chat#DEFAULT_CHAT_RECOVERY_STABLE_TIMEOUT_MS 2.3 KiB 8.2 KiB
agents/chat#DEFAULT_CHAT_RECOVERY_TERMINAL_MESSAGE 2.4 KiB 8.3 KiB
🟡 agents/chat#dispatchChatRecoveryToHandoff 3.0 KiB 9.9 KiB
🟢 agents/chat#drainInteractionApplies 2.3 KiB 8.3 KiB
🟢 agents/chat#enforceRowSizeLimit 3.5 KiB 11.2 KiB
🟢 agents/chat#hasIncompleteToolBatch 2.4 KiB 8.6 KiB
🟢 agents/chat#interceptAgentToolBroadcast 2.5 KiB 8.7 KiB
agents/chat#isPlatformFailure 2.6 KiB 8.9 KiB
agents/chat#isReplayChunk 2.4 KiB 8.7 KiB
agents/chat#iterateWithStallWatchdog 2.6 KiB 8.8 KiB
agents/chat#KV_DELETE_MAX_KEYS 2.3 KiB 8.2 KiB
🟢 agents/chat#listActiveChatRecoveryIncidents 2.4 KiB 8.4 KiB
🟢 agents/chat#MAX_BOUND_PARAMS 2.3 KiB 8.2 KiB
agents/chat#MessageType 2.4 KiB 9.0 KiB
🟢 agents/chat#normalizeToolInput 2.3 KiB 8.2 KiB
agents/chat#parseProtocolMessage 2.5 KiB 9.0 KiB
agents/chat#partAwaitsClientInteraction 2.4 KiB 8.6 KiB
🟢 agents/chat#pausedExecutionUpdate 2.4 KiB 8.4 KiB
agents/chat#pendingChatTerminal 2.3 KiB 8.3 KiB
agents/chat#persistReconstructedOrphan 3.1 KiB 11.0 KiB
agents/chat#PreStreamTurns 2.6 KiB 9.3 KiB
agents/chat#readChatRecoveryProgress 2.3 KiB 8.3 KiB
agents/chat#reconcileMessages 2.8 KiB 9.6 KiB
agents/chat#reconcileOrphanPartial 2.4 KiB 8.5 KiB
🟢 agents/chat#recordChatTerminal 2.4 KiB 8.3 KiB
🟡 agents/chat#repairInterruptedToolParts 2.6 KiB 9.1 KiB
agents/chat#resolveChatRecoveryConfig 2.6 KiB 8.9 KiB
agents/chat#resolveToolMergeId 2.4 KiB 8.5 KiB
agents/chat#ResumableStream 5.1 KiB 16.8 KiB
🟢 agents/chat#ResumeHandshake 3.0 KiB 10.4 KiB
agents/chat#ROW_MAX_BYTES 2.3 KiB 8.2 KiB
agents/chat#runChatRecoveryExhaustion 2.6 KiB 8.9 KiB
agents/chat#sanitizeMessage 2.5 KiB 8.8 KiB
🟢 agents/chat#sendIfOpen 2.4 KiB 8.4 KiB
🟡 agents/chat#setChatRecovering 2.5 KiB 8.5 KiB
🟢 agents/chat#shouldCreditStreamProgress 2.4 KiB 8.3 KiB
🟢 agents/chat#STREAM_RESUME_NONE_REASONS 2.3 KiB 8.2 KiB
🟢 agents/chat#StreamAccumulator 2.9 KiB 10.7 KiB
agents/chat#StreamProgressCreditThrottle 2.4 KiB 8.3 KiB
🟢 agents/chat#SubmitConcurrencyController 2.9 KiB 10.3 KiB
🟢 agents/chat#sweepStaleChatRecoveryIncidents 2.4 KiB 8.5 KiB
🟡 agents/chat#TextSegmentJoiner 2.7 KiB 9.2 KiB
agents/chat#TIMED_OUT 2.3 KiB 8.2 KiB
agents/chat#toolApprovalUpdate 2.4 KiB 8.5 KiB
agents/chat#toolPartHasSettledResult 2.3 KiB 8.4 KiB
agents/chat#toolResultUpdate 2.4 KiB 8.5 KiB
🟢 agents/chat#truncateOlderMessages 3.2 KiB 10.4 KiB
🟡 agents/chat#TurnQueue 2.6 KiB 9.2 KiB
agents/chat#unwrapChatFiberSnapshot 2.4 KiB 8.5 KiB
agents/chat#wrapChatFiberSnapshot 2.3 KiB 8.2 KiB
🟡 agents/chat-sdk#ChatSdkStateAdapter 263.2 KiB 1148.3 KiB
🟡 agents/chat-sdk#ChatSdkStateAgent 262.6 KiB 1145.8 KiB
🟡 agents/chat-sdk#createChatSdkState 263.2 KiB 1148.4 KiB
🟡 agents/chat-sdk#defaultKeyShard 260.9 KiB 1137.0 KiB
🟡 agents/chat-sdk#defaultThreadShard 260.8 KiB 1136.8 KiB
agents/chat/react#detectToolsRequiringConfirmation 3.3 KiB 8.3 KiB
agents/chat/react#extractClientToolSchemas 3.2 KiB 8.3 KiB
agents/chat/react#getAgentMessages 3.4 KiB 8.6 KiB
agents/chat/react#getToolApproval 3.1 KiB 8.0 KiB
agents/chat/react#getToolCallId 3.1 KiB 8.0 KiB
agents/chat/react#getToolInput 3.1 KiB 8.0 KiB
agents/chat/react#getToolOutput 3.1 KiB 8.0 KiB
agents/chat/react#getToolPartState 3.2 KiB 8.2 KiB
agents/chat/react#useAgentChat 132.9 KiB 609.7 KiB
agents/chat/react#WebSocketChatTransport 5.7 KiB 17.1 KiB
agents/chat/transport#WebSocketChatTransport 2.8 KiB 9.2 KiB
agents/client#AgentClient 5.7 KiB 16.6 KiB
agents/client#AgentConnectionError 582 B 993 B
agents/client#agentFetch 4.2 KiB 12.3 KiB
agents/client#createStubProxy 638 B 1.0 KiB
agents/client#DEFAULT_CALL_TIMEOUT_MS 473 B 770 B
agents/client#isTerminalCloseEvent 509 B 822 B
agents/context#AgentContextProvider 412 B 792 B
agents/context#AgentSearchProvider 640 B 1.3 KiB
agents/context#ContextBlocks 87.4 KiB 429.7 KiB
agents/dynamic-agents#DynamicAgents 10.0 KiB 32.8 KiB
agents/dynamic-agents#parseSubAgentPath 720 B 1.4 KiB
agents/dynamic-agents#SUB_PREFIX 330 B 750 B
agents/email#createAddressBasedEmailResolver 193 B 227 B
agents/email#createCatchAllEmailResolver 110 B 97 B
agents/email#createHeaderBasedEmailResolver 334 B 492 B
agents/email#createSecureReplyEmailResolver 718 B 1.3 KiB
agents/email#DEFAULT_MAX_AGE_SECONDS 56 B 39 B
agents/email#isAutoReplyEmail 201 B 249 B
agents/email#signAgentHeaders 424 B 812 B
agents/experimental/webmcp#registerWebMcp 85.2 KiB 295.8 KiB
agents/lifecycle#getCurrentAgent 376 B 798 B
🟡 agents/lifecycle#Lifecycle 8.8 KiB 27.4 KiB
🟢 agents/lifecycle#LifecycleCapability 483 B 975 B
🟡 agents/mcp#createLegacyMcpHandler 378.1 KiB 1579.1 KiB
🟡 agents/mcp#createMcpHandler 390.4 KiB 1624.3 KiB
🟡 agents/mcp#DurableObjectEventStore 344.6 KiB 1437.6 KiB
🟡 agents/mcp#ElicitRequestSchema 344.6 KiB 1437.6 KiB
🟡 agents/mcp#experimental_createMcpHandler 378.2 KiB 1579.4 KiB
🟡 agents/mcp#getMcpAuthContext 344.7 KiB 1437.7 KiB
🟡 agents/mcp#MCP_SERVER_ID_MAX_LENGTH 344.7 KiB 1437.6 KiB
🟡 agents/mcp#McpAgent 344.6 KiB 1437.6 KiB
🟡 agents/mcp#normalizeServerId 344.7 KiB 1437.6 KiB
🟡 agents/mcp#RPC_DO_PREFIX 344.7 KiB 1437.6 KiB
🟡 agents/mcp#RPCClientTransport 344.7 KiB 1437.6 KiB
🟡 agents/mcp#RPCServerTransport 344.7 KiB 1437.6 KiB
🟡 agents/mcp#SSEEdgeClientTransport 344.7 KiB 1437.9 KiB
🟡 agents/mcp#StreamableHTTPEdgeClientTransport 344.7 KiB 1437.9 KiB
🟡 agents/mcp#WorkerTransport 348.1 KiB 1454.5 KiB
agents/mcp/client#getNamespacedData 62.9 KiB 240.0 KiB
agents/mcp/client#MCP_SERVER_ID_MAX_LENGTH 62.9 KiB 239.9 KiB
agents/mcp/client#MCPClientManager 158.6 KiB 702.6 KiB
agents/mcp/client#normalizeServerId 63.0 KiB 240.2 KiB
agents/mcp/do-oauth-client-provider#DurableObjectOAuthClientProvider 2.1 KiB 6.6 KiB
agents/mcp/server#createMcpHandler 80.5 KiB 307.2 KiB
agents/mcp/server#getMcpAuthContext 64.0 KiB 245.5 KiB
agents/observability#channels 259 B 549 B
agents/observability#genericObservability 470 B 1.2 KiB
agents/observability#subscribe 324 B 668 B
agents/observability/ai#wrapAISDK 8.8 KiB 30.5 KiB
agents/react#_testUtils 3.8 KiB 9.5 KiB
agents/react#useAgent 10.8 KiB 31.1 KiB
agents/react#useAgentToolEvents 5.6 KiB 16.8 KiB
agents/routing#getAgentByName 795 B 1.7 KiB
agents/routing#routeAgentRequest 1.6 KiB 3.6 KiB
agents/routing#RoutedAgents 2.4 KiB 6.2 KiB
agents/schedule#getSchedulePrompt 85.8 KiB 424.7 KiB
agents/schedule#scheduleSchema 85.3 KiB 423.6 KiB
agents/schedule#unstable_getSchedulePrompt 85.9 KiB 424.9 KiB
agents/schedule#unstable_scheduleSchema 85.3 KiB 423.6 KiB
🟢 agents/schedules#Scheduler 6.8 KiB 21.9 KiB
agents/schedules/parser#getSchedulePrompt 85.8 KiB 424.7 KiB
agents/schedules/parser#scheduleSchema 85.3 KiB 423.6 KiB
agents/sessions#COMPACTION_PREFIX 147 B 160 B
agents/sessions#createCompactFunction 1.7 KiB 4.0 KiB
agents/sessions#isCompactionMessage 177 B 200 B
agents/sessions#Session 2.0 KiB 6.3 KiB
agents/sessions#Sessions 9.5 KiB 34.3 KiB
agents/skills#fromManifest 309.8 KiB 1084.0 KiB
agents/skills#parseSkillFrontmatter 328.4 KiB 1146.2 KiB
agents/skills#parseSkillMarkdown 328.6 KiB 1146.5 KiB
agents/skills#r2 330.2 KiB 1150.4 KiB
agents/skills#runner 369.0 KiB 1297.8 KiB
agents/skills#SkillRegistry 416.4 KiB 1581.7 KiB
agents/skills/compile#compileSkillScript 15.4 KiB 43.4 KiB
agents/skills/compile#isCompilableSkillScript 15.4 KiB 43.3 KiB
agents/streams#DEFAULT_MAX_CHUNK_BYTES 94 B 96 B
agents/streams#sseResponse 857 B 1.6 KiB
agents/streams#StreamClosedError 175 B 212 B
agents/streams#StreamNotFoundError 215 B 276 B
agents/streams#Streams 4.2 KiB 13.8 KiB
agents/streams#StreamSerializationError 171 B 201 B
agents/tasks#DuplicateTaskStepError 328 B 463 B
agents/tasks#MAX_SERIALIZED_BYTES 190 B 232 B
agents/tasks#MissingTaskDefinitionError 358 B 536 B
agents/tasks#NonRetryableError 238 B 308 B
agents/tasks#TaskReplayDivergedError 341 B 483 B
🟢 agents/tasks#Tasks 8.8 KiB 31.7 KiB
agents/tasks#TaskSerializationError 258 B 339 B
agents/types#MessageType 211 B 365 B
agents/vite#default 353.8 KiB 1356.1 KiB
agents/voice#addSFUTracks 324 B 424 B
agents/voice#createSFUSession 255 B 306 B
agents/voice#createSFUWebSocketAdapter 331 B 429 B
agents/voice#decodeVarint 157 B 160 B
agents/voice#downsample48kStereoTo16kMono 238 B 324 B
agents/voice#encodePayloadToProtobuf 189 B 279 B
agents/voice#encodeVarint 129 B 122 B
agents/voice#extractPayloadFromProtobuf 271 B 425 B
agents/voice#iterateText 1.6 KiB 3.8 KiB
agents/voice#renegotiateSFUSession 329 B 428 B
agents/voice#SentenceChunker 550 B 1.1 KiB
agents/voice#sfuFetch 294 B 358 B
agents/voice#upsample16kMonoTo48kStereo 211 B 272 B
agents/voice#VOICE_PROTOCOL_VERSION 51 B 31 B
agents/voice#withVoice 9.5 KiB 32.7 KiB
agents/voice#withVoiceInput 4.8 KiB 16.0 KiB
agents/voice#WorkersAIFluxSTT 1.5 KiB 4.3 KiB
agents/voice#WorkersAINova3STT 1.6 KiB 4.3 KiB
agents/voice#WorkersAITTS 682 B 1.4 KiB
agents/voice/client#VOICE_PROTOCOL_VERSION 473 B 768 B
agents/voice/client#VoiceClient 10.1 KiB 31.6 KiB
agents/voice/client#WebSocketVoiceTransport 4.6 KiB 13.3 KiB
agents/voice/errors#logVoiceError 132 B 173 B
agents/voice/errors#toVoiceError 94 B 80 B
agents/voice/errors#voiceErrorMessage 125 B 111 B
agents/voice/errors#VoiceProviderError 190 B 345 B
agents/voice/react#useVoiceAgent 13.6 KiB 42.5 KiB
agents/voice/react#useVoiceInput 13.3 KiB 41.4 KiB
agents/voice/react#WebSocketVoiceTransport 7.4 KiB 21.3 KiB
agents/voice/sfu#addSFUTracks 323 B 424 B
agents/voice/sfu#createSFUSession 254 B 306 B
agents/voice/sfu#createSFUWebSocketAdapter 329 B 429 B
agents/voice/sfu#decodeVarint 155 B 160 B
agents/voice/sfu#downsample48kStereoTo16kMono 236 B 324 B
agents/voice/sfu#encodePayloadToProtobuf 188 B 279 B
agents/voice/sfu#encodeVarint 129 B 122 B
agents/voice/sfu#extractPayloadFromProtobuf 270 B 425 B
agents/voice/sfu#renegotiateSFUSession 329 B 428 B
agents/voice/sfu#sfuFetch 292 B 358 B
agents/voice/sfu#upsample16kMonoTo48kStereo 209 B 272 B
agents/voice/text#iterateText 1.6 KiB 3.8 KiB
agents/voice/text#SentenceChunker 549 B 1.1 KiB
agents/voice/types#VOICE_PROTOCOL_VERSION 51 B 31 B
agents/voice/workers-ai#WorkersAIFluxSTT 1.5 KiB 4.3 KiB
agents/voice/workers-ai#WorkersAINova3STT 1.6 KiB 4.3 KiB
agents/voice/workers-ai#WorkersAITTS 682 B 1.4 KiB
🟢 agents/websockets#CALLABLES_RPC_QUERY 12.4 KiB 43.3 KiB
🟢 agents/websockets#CALLABLES_RPC_VALUE 12.4 KiB 43.3 KiB
🟢 agents/websockets#callablesFromDecorated 12.7 KiB 44.3 KiB
🟢 agents/websockets#callablesRpcUrl 12.4 KiB 43.5 KiB
🟢 agents/websockets#isCallablesRpcUpgrade 12.4 KiB 43.4 KiB
🟡 agents/websockets#WebSockets 18.3 KiB 64.3 KiB
🟡 agents/workflows#AgentWorkflow 262.2 KiB 1141.6 KiB
🟡 agents/workflows#WorkflowRejectedError 260.9 KiB 1137.0 KiB
agents/x402#normalizeNetwork 14.7 KiB 61.1 KiB
agents/x402#withX402 23.0 KiB 89.2 KiB
agents/x402#withX402Client 104.1 KiB 346.5 KiB

Reported by agent-think[bot].

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment on lines +546 to +554
const { 0: client, 1: server } = new WebSocketPair();
// `||`, not `??`: an empty `?_pk=` value must fall back to a generated id.
const id = new URL(request.url).searchParams.get("_pk") || nanoid();
const record = acceptOwnedSocket(this.lifecycle.sockets, server, {
id,
outer: request.headers.get(SUB_AGENT_OUTER_URL_HEADER) ?? request.url,
tags: [id],
state: null
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Failed upgrades leak accepted sockets

When child resolution or connect delivery fails, onWebSocketUpgrade leaves the accepted socket open. Repeated failed upgrades accumulate ownerless hibernating sockets.

Learn more

The capability accepts the server half into the Durable Object before resolving the child and delivering ws:connect. Either later operation can reject, including when the child has no WebSockets capability or its connection setup throws. Lifecycle then creates a separate error WebSocket response, while the accepted server socket remains registered in hibernation storage.

Example: A request upgrades to a valid dynamic child that does not install WebSockets. acceptOwnedSocket registers socket A, child delivery rejects, and Lifecycle returns error socket B. Socket A has no returned client endpoint and remains attached to the parent.

Recommended fix: Wrap all work after acceptOwnedSocket in try/catch. Close the accepted record on failure before rethrowing, using an appropriate setup-failure close code and guarding close errors.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +332 to +335
if (capability.provideRouteTransport) {
if (lifecycleRouteTransports.has(this)) {
throw new Error("Lifecycle already has a route transport");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Rejected transport stays installed

When a second provider is used, use() inserts and binds it before throwing. Catching the error leaves the rejected capability active.

Learn more

use() mutates #capabilities, #fallbacks, and capability service bindings before checking whether a route transport already exists. The thrown installation error therefore does not reject the capability atomically. A caller that handles the error gets a Lifecycle whose dispatch chain differs from the successful use() calls it observed.

Example: A host installs transport A, catches the error from installing transport B, then starts Lifecycle. Transport B's onStart, request hooks, and route-retirement hook still run despite its rejected installation.

Recommended fix: Check capability.provideRouteTransport and the existing transport before mutating the capability list, fallback set, or service binding. Only bind and register the transport after every validation passes.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2250

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2250

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2250

hono-agents

npm i https://pkg.pr.new/hono-agents@2250

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2250

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2250

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2250

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2250

commit: a32dd58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant