Skip to content

feat(tasks): one durable state-machine engine, two APIs (agents/state-machine + agents/tasks) - #2301

Closed
mattzcarey wants to merge 15 commits into
feat/tasks-attempt-signal-and-budgetfrom
feat/tasks-state-machine
Closed

mattzcarey wants to merge 15 commits into
feat/tasks-attempt-signal-and-budgetfrom
feat/tasks-state-machine

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #2274 (feat/tasks-attempt-signal-and-budget): this PR's base is that branch, so its diff shows only the state-machine work. Merge #2274 first.

What this is

agents/tasks becomes one durable state-machine engine with two APIs, and the engine ships as its own entry point.

  • agents/state-machine exports StateMachine, the Lifecycle capability that owns the run tables, the wake mirror and routed dispatch. It registers machine definitions only — { initial, phases, onCancel?, migrate? }, one (state, ctx) => next handler per phase, keyed by the checkpoint's phase — under a StateMachine-prefixed vocabulary. Returning the next state is the commit.
  • agents/tasks is Tasks extends StateMachine: the same engine plus today's Workflows-shaped (input, step) => result form, compiled onto it as a single-phase machine with byte-identical journal and idempotency keys. Every Task* name is kept as an alias. Agent still installs only this.tasks.

The design is in design/rfc-tasks-state-machine.md (the RFC is the first half; the appendix is the implementation reference) with design/tasks-cleanup-plan.md beside it. The user-facing docs are docs/agents/tasks.md and docs/agents/state-machine.md.

What lands

  • Schema v3. New run columns by ALTER TABLE ADD COLUMN; cf_agents_task_steps rebuilt as the turn-scoped cf_agents_task_journal in bounded batches under a durable cursor; mailbox, ask and route tables. In-flight runs migrate at turn 0 and resume from their journals.
  • The turn loop. The post-transition decision list (superseded, terminal, platform failure, abort mark, parked, application error, checkpoint changed, progress, stall), initial committed at turn 0, Rule A (stallLimit) and Rule B (transitionBudget) faulting with outcome: "faulted" and the row preserved regardless of retain.
  • The abort protocol. The abort mark is the write barrier every checkpoint, park and settle write is fenced on. A machine with onCancel gets it in a fresh, mark-fenced invocation after the live one is joined; returning a checkpoint declines the cancel. Everything else keeps the inline default. cancel(..., { wait }), terminate, pause/resume, reopen, the per-transition turnTimeout watchdog, and the cancel cascade to in-tree children.
  • Versioning. @vN with migrate(checkpoint, fromVersion, input); a run whose base is registered only at a newer version without migrate is orphaned and preserved for reopen(). Agent-declared taskDefinitions take part.
  • The mailbox and asks. send (requestId dedupe, append/latest/drop/debounce, a limit, nothing for a terminal run), sendEvent, withdraw; ctx.receive/receiveAll/peek/peekAll; step.waitForEvent as a journaled receive with a deadline; defineAsk, ctx.ask/answers/peekAnswers, tasks.answer(askId, kind, value) applied exactly once, withdrawAsk, asks(). Event-driven parks hold no alarm; a send or an answer schedules the wake directly, so a within expiry stays distinguishable from a wake.
  • Children and streams. ctx.spawn, child settlement notes in the parent's mailbox, ctx.join, background children detached from the cascade; ctx.stream(name) engine-owned streams with epoch rotation on reclaim and the atomic checkpoint cutover through StreamWriter.onCommit; view() and watch().
  • Apertures deleted. __DO_NOT_USE_WILL_BREAK__runAttached and __DO_NOT_USE_WILL_BREAK__enqueue are gone; register(name, definition) returns the handle whose run(input, { start }) starts a reserved definition, and every in-repo caller (Think, AIChatAgent, their test workers, the agents tests, the three harness examples) migrates in this PR.

Final form (third round)

  • Cross-facet children. ctx.spawn(definition, input, { owner }) accepts the child on one of the Agent's sub-agents, addressed by the new Agent.subAgentRouteAddress(cls, name). The child runs and journals there; its settlement note returns to the parent through the root; the cancel cascade and terminate reach it; view().children lists it with its ownerKey. Every run a sub-agent accepts is indexed on the root in cf_agents_task_routes (riding the wake sync the accept already sends, and dropped by the delete's), and a verb that misses locally — get, view, send, sendEvent, withdraw, answer, withdrawAsk, cancel, terminate, pause, resume — is forwarded to the owner. That is the RFC §4.5 regression: an approval answered on the root now reaches a facet-hosted run parked with no wake at all. Sibling subtrees reach each other through the root; a spawn onto a sub-agent that does not exist fails the parent with a clear error.
  • Per-effect compensation. step.do(name, { compensate: (result) => … }, cb). When a run without onCancel is aborted, the inline default replays the current turn's journal in a fresh, fenced invocation (no step executes again), collects the compensations of completed steps, runs them newest first, each bounded by its step's timeout, records each success on the journal row (compensated_at) so an interrupted pass never repeats one, then settles by the mark. A failing compensation is recorded (task:step:compensation-failed) and the rest still run; watch() reports a compensating change; terminate() runs none. Invocations held in #active now carry their kind (transition, cancel transition, compensation pass): only a transition is signalled by a later mark, a standing mark spends the run deadline, and the watchdog over a hung onCancel takes the inline default too.
  • Streams on Agent. Agent installs this.streams and hands it to this.tasks, so ctx.stream() works on any Agent. AIChatAgent and Think no longer construct their own; ResumableStream raises chat's per-chunk ceiling for its own writes through the sync aperture, and createChatStreams() is deprecated for Agent hosts.
  • The satisfies TaskMachine rule. check:machines (scripts/check-machine-satisfies.ts, in the root check) fails on any object-literal machine definition without the annotation, since only the annotation narrows each handler's state to its phase.

Review round

A single review pass over the whole diff found two blocking issues that are fixed here: a run paused while live and then parked on an event-driven wait could never be woken (resume() now schedules the wake directly), and mailbox consumption was not fenced on the abort mark (a transition now buffers what it takes and the items are deleted with the commit, park or settle that makes the transition durable, so a cancelled-out transition consumes nothing). It also closed: the cancel transition's follow-through, a within that re-armed on every early wake (the deadline now carries across re-dispatch), memory-limit backoff flooring event-driven parks, the heartbeating stream wrapper, open asks at settlement, definition scoping on tasks.at() handles, debounce requiring a requestId, and a few timing-based test waits. The sealed memory-limit path keeps its pre-existing retain semantics (a non-retained sealed run is released so the recovery idempotency key is free), which the RFC's §5.7 wording will be updated to match.

Review round two

  • Released children keep their note. A retain: false child's auto-release no longer point-deletes the settlement note it just wrote into its parent's mailbox (deleteRun(runId, { keepParentNote: true })), so a parent's ctx.join on a released child resolves; tasks.delete() and a subtree teardown still sweep a note nobody waits on.
  • Terminal cutover. A terminal return serializes its result before any stream is touched, and the run's fenced terminal write rides the last open stream's settlement transaction, as the checkpoint path already did. A writer the machine closed itself no longer counts as open, so the commit always reaches a live one.
  • Mailbox. send serializes the payload before latest/debounce delete anything and runs the policy plus insert in one transaction; mailboxLimit is checked where the mailbox grows, so a replacement at the limit is accepted; a transition that received then threw consumes what it read once the fence accepts the failure.
  • Handle scoping. at().answer matches the ask row's run_id rather than an id prefix (run ids may contain #); at().watch and the definition handle's send, view and watch are scoped like every other verb.
  • Two knobs a one-machine-per-address host needs. A definition may declare transitionBudget, overriding the capability's for its runs, so a queue drainer running one transition per item is not faulted by Rule B. run() at an existing runId or idempotencyKey joins across versions of one base; the receipt carries the stored name, and handles scope by base too, so the handle that joined the run can read it. A different base still throws.

Review round three

  • Atomic durable boundaries. The streamless checkpoint commit, a park, and the terminal and thrown settlements each run their fenced run write and the mailbox rows they consume in one transaction, so an interruption between the statements cannot redeliver consumed input.
  • Stream fan-out. A run's engine-owned streams settle in one transaction with the run's own write through the new streams.transaction(closure); the run's write is a statement of that transaction rather than a rider on the last settle, so a stream that is already terminal cannot skip it, a refused fence rolls every settlement back, the settle events are held until the transaction commits, and the legacy chunk-table flag is re-derived after a rollback. A ctx writer marks its entry settled only after its own settle has returned, so a machine's throwing commit leaves the stream in the cutover.

Verification

npm run check and the full workers vitest project (133 files, 2097 tests) are green at every commit on the branch. New suites: tests/state-machine/{turn-loop,mailbox,children,engine,machine,migration,compensate}.test.ts and tests/tasks/facet-children.test.ts (real root and facet Agents); the existing tests/tasks/* step-API suites pass unchanged in substance, plus tests-d probes for both entry points. The @cloudflare/ai-chat and @cloudflare/think workers suites pass; ai-chat's agent-tools.test.ts intermittently segfaults workerd during its simulated memory-limit resets, and does so identically on the branch before this round (2 of 3 runs at 633edee), so it is noted here rather than fixed here.

One observable change beside the new surface: the engine errors' runtime name reads StateMachine… (each Task*Error is the same class under either import).

…Commit

Two prerequisites for the Tasks state-machine engine.

LifecycleJobs.pushSync and cancelSync are the same writes as push and
cancel without the async alarm re-arm, so a capability can commit a job
row inside its own storage.transactionSync and call rearm() after. The
job table is created lazily, so a rolled-back caller transaction could
drop it while the cached ensured bit stayed set; JobQueue now repairs
that on the first missing-table error and retries the query once.

StreamWriter.onCommit(fn) registers a synchronous callback that runs
inside the stream's settle transaction under the same contract as
StreamSettleOptions.commit, in registration order before the call's own
commit. Registrations are per writer, snapshotted at settle, and retired
once the writer's own call settles the stream.
…two APIs

Adds the decision record and its normative specification appendix for
replacing the agents/tasks implementation with a single durable
state-machine engine that serves both the existing Workflows-shaped step
API (compiled onto it, unchanged for callers) and a new machine form
(initial/phases/onCancel with a per-transition ctx that extends
TaskStep). Also adds the Tasks cleanup plan: surface-by-surface verdicts,
consumer migrations and a sequenced PR order, including the deletion of
the two __DO_NOT_USE_WILL_BREAK__ start apertures in favour of the handle
register() now returns.
…ypes

Stage 1a of the state-machine engine: the run table gains the checkpoint,
turn, progress, abort-mark and parent columns; cf_agents_task_steps is
rebuilt into the turn-scoped cf_agents_task_journal in bounded batches
under a durable cursor; the mailbox, ask and route tables are created; and
register() returns a handle whose run() accepts the start mode. Function
definitions compile onto the engine as a single-phase machine whose
checkpoint persists as NULL, keeping every existing idempotency key
byte-identical.
…s durable-function layer

agents/state-machine exports StateMachine, the Lifecycle capability that
owns the run tables, the wake stream and routed dispatch, and registers
machine definitions only under a StateMachine-prefixed vocabulary. Tasks
now extends StateMachine — same tables, same handles, one capability
instance — adding the durable-function form, compiled onto the engine as
it is registered, and keeping every Task* name as an alias of its
StateMachine* type. The engine's machine type is structural: never-typed
handler parameters admit every machine, where the any-parameterised form
rejected any whose mailbox was the default never. Storage tables and
event types keep the task namespace; the engine errors' runtime name now
reads StateMachine….
…nd versioning

A machine definition now runs: a handler is dispatched for the phase its
checkpoint names, and the post-transition decision list chooses what its
return means — a terminal settles, a changed checkpoint commits and
dispatches the next phase in the same invocation, progress without a new
checkpoint re-dispatches the same phase, and nothing at all is a stall.
The first dispatch commits `initial` at turn 0. Rule A (stallLimit) and
Rule B (transitionBudget) fault a run that makes no progress or spins,
preserving its row regardless of retain.

The abort mark is the write barrier every checkpoint-advancing, park and
settle write is fenced on. A machine that declares onCancel gets it in a
fresh, mark-fenced invocation after the live one is joined; returning a
checkpoint declines the cancel, a terminal settles. Everything else keeps
the inline default. cancel(..., { wait }) awaits terminality; terminate,
pause, resume and reopen are implemented; a per-transition turn watchdog
enforces turnTimeout through the wake queue.

A run whose @vn is registered only at a newer version is adopted through
that version's migrate() or, without one, orphaned with its checkpoint
preserved for reopen(). Agent-declared taskDefinitions take part through
the resolver's name enumeration. ReplayStep now implements the whole
machine context: run facts, memo, heartbeat and progress credit, with the
mailbox, ask, child and stream members declared pending their engines.
…ved definitions through register()'s handle

__DO_NOT_USE_WILL_BREAK__runAttached and __DO_NOT_USE_WILL_BREAK__enqueue
are gone. register(name, definition) returns the one handle that can
start a reserved __cf-prefixed definition, and its run(input, { start })
chooses warm, queued or attached. AIChatAgent and Think keep their
handles behind a protected _reservedTask(name) accessor and expose
_enqueueChatRecovery to subclasses; the harness examples hold the handle
their constructor registered; the test hosts and suites use the public
run({ start }) or the handle.
send appends one item to a run's mailbox — requestId dedupe before any
write, append/latest/drop/debounce policies, a mailbox limit, and
nothing at all for a terminal run — and sendEvent is its Workflows
spelling. A parked reader is woken through the mirror job without the
park's own within deadline being rewritten, so an expiry stays
distinguishable from a wake; a live reader re-reads at its next park.
ctx.receive/receiveAll/peek/peekAll/withdraw read and consume in FIFO
order, and step.waitForEvent is a journaled receive with a deadline
whose consumed event is memoized as the step's result.

ctx.ask writes one row per payload and returns Pending ids the checkpoint
carries; ctx.answers parks on them (all or any, within), sweeping expiry
into the ledger as it re-reads; tasks.answer applies exactly once with
only the ask id, and withdrawAsk and asks() round out the surface.
view() is the deep read and watch() a hibernation-safe subscription fed
from the event stream; handle() and at() delegate every verb.
…treams

ctx.spawn accepts a child run of the current one; its settlement lands in
the parent's mailbox as a kind:'child' note keyed by the child's run id
and wakes a parent parked on it, and ctx.join is sugar over receiving
those notes — nothing is consumed until every named child has settled.
Cancelling a parent, a deadline or the watchdog firing on it, and
terminate all cascade to in-tree children; background children are
detached and run on. Cross-facet ownership is declared and refused.

ctx.stream(name) opens an engine-owned stream at the run's current epoch,
rotating when that epoch's id has already settled, so a handler always
holds a live stream. A transition that returns its next checkpoint while
holding one settles the stream and writes the checkpoint in one
transaction through the settle's commit hook; a reclaim after an
interruption seals the lost attempt's streams and rotates the epoch;
appends heartbeat the claim and count as progress at the commit. view()
reports the run's streams, and cleanupRoutePrefix drops route rows under
a deleted facet prefix.
Rewrite docs/agents/tasks.md around durable jobs and durable actors on
one engine — the step API and replay sections kept, the machine form,
its runtime, the progress rules, the abort protocol, versioning and the
deep view added — and add docs/agents/state-machine.md for the engine's
own entry point with the name map between the two vocabularies. The
alarm-coordination note learns the transition watchdog and the alarm-free
event-driven park; the fibers design record points at its successor.
…carried deadlines, scoped handles

Mailbox items a transition takes are buffered and deleted with the
commit, park or settle that makes the transition durable, inside its
fence, so a transition the abort mark or a newer generation cuts off
consumes nothing. resume() schedules the wake for a run that parked on
an event-driven wait while paused. The cancel transition resolves a mark
that lands during it through the next wake rather than re-entering, and
its decline write is fenced on the mark it observed. A within deadline
carries across an early re-dispatch instead of re-arming. Memory-limit
backoff leaves event-driven parks at NULL. ctx.stream returns the
heartbeating wrapper on every call. Settlement withdraws a run's open
asks. tasks.at() handles scope every verb to their definition. debounce
requires a requestId. Ask ids sort in batch order. The Agent's
taskDefinitions is typed TaskDefinitions. Timing-based test waits are
replaced with state waits; debounce, a cascade into an onCancel child,
and a join over a faulted child are covered.
@changeset-bot

changeset-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1247a44

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

This PR includes changesets to release 4 packages
Name Type
@cloudflare/ai-chat Patch
@cloudflare/think Patch
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 18, 2026 •

Copy link
Copy Markdown
Contributor

🔴 agents import sizes

Measured 376 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
5 159 2 179 31 0

Compared f28ffc2f with 1247a447. Open workflow run.

Changed imports (197)
Status Import Base gzip Head gzip Delta
🔴 agents/tasks#Tasks 9.7 KiB 25.3 KiB +15.6 KiB (+161.84%)
🔴 agents/tasks#MAX_SERIALIZED_BYTES 190 B 218 B +28 B (+14.74%)
🔴 agents/tasks#TaskInterruptionsExhaustedError 312 B 345 B +33 B (+10.58%)
🔴 agents/tasks#TaskSerializationError 258 B 285 B +27 B (+10.47%)
🔴 agents/tasks#NonRetryableError 238 B 262 B +24 B (+10.08%)
🟡 agents/tasks#TaskDeadlineExceededError 299 B 328 B +29 B (+9.7%)
🟡 agents/tasks#DuplicateTaskStepError 328 B 358 B +30 B (+9.15%)
🟡 agents/tasks#TaskReplayDivergedError 341 B 372 B +31 B (+9.09%)
🟡 agents/tasks#MissingTaskDefinitionError 359 B 389 B +30 B (+8.36%)
🟡 agents#callable 261.9 KiB 281.8 KiB +19.9 KiB (+7.59%)
🟡 agents#isDurableObjectStorageReset 261.9 KiB 281.8 KiB +19.9 KiB (+7.59%)
🟡 agents#MCP_SERVER_ID_MAX_LENGTH 261.9 KiB 281.8 KiB +19.9 KiB (+7.59%)
🟡 agents#StreamingResponse 261.9 KiB 281.8 KiB +19.9 KiB (+7.59%)
🟡 agents#getSubAgentByName 262.2 KiB 282.1 KiB +19.9 KiB (+7.59%)
🟡 agents#Agent 261.9 KiB 281.8 KiB +19.9 KiB (+7.59%)
🟡 agents#SUB_PREFIX 261.9 KiB 281.8 KiB +19.9 KiB (+7.59%)
🟡 agents#AGENT_TOOL_PROGRESS_PART 261.9 KiB 281.8 KiB +19.9 KiB (+7.58%)
🟡 agents#unstable_callable 262.0 KiB 281.9 KiB +19.9 KiB (+7.58%)
🟡 agents/chat-sdk#defaultThreadShard 261.9 KiB 281.8 KiB +19.9 KiB (+7.58%)
🟡 agents#AGENT_TOOL_MILESTONE_PART 261.9 KiB 281.7 KiB +19.9 KiB (+7.58%)
🟡 agents/workflows#WorkflowRejectedError 262.0 KiB 281.8 KiB +19.9 KiB (+7.58%)
🟡 agents#__DO_NOT_USE_WILL_BREAK__agentContext 261.9 KiB 281.8 KiB +19.9 KiB (+7.58%)
🟡 agents#camelCaseToKebabCase 261.9 KiB 281.8 KiB +19.9 KiB (+7.58%)
🟡 agents#__DO_NOT_USE_WILL_BREAK__withInvocationScope 261.9 KiB 281.7 KiB +19.8 KiB (+7.58%)
🟡 agents#normalizeServerId 261.9 KiB 281.7 KiB +19.8 KiB (+7.58%)
🟡 agents#isDurableObjectCodeUpdateReset 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#getCurrentAgent 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#isPlatformTransientError 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#MessageType 262.1 KiB 281.9 KiB +19.9 KiB (+7.58%)
🟡 agents#DurableObjectOAuthClientProvider 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#getAgentByName 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#createHeaderBasedEmailResolver 262.1 KiB 282.0 KiB +19.9 KiB (+7.58%)
🟡 agents#SqlError 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#DEFAULT_AGENT_STATIC_OPTIONS 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#parseSubAgentPath 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents#routeSubAgentRequest 262.2 KiB 282.0 KiB +19.9 KiB (+7.58%)
🟡 agents#isDurableObjectMemoryLimitReset 261.9 KiB 281.8 KiB +19.8 KiB (+7.58%)
🟡 agents/chat-sdk#defaultKeyShard 262.0 KiB 281.9 KiB +19.8 KiB (+7.57%)
🟡 agents#routeAgentEmail 262.2 KiB 282.1 KiB +19.9 KiB (+7.57%)
🟡 agents#buildAgentPath 262.5 KiB 282.3 KiB +19.8 KiB (+7.56%)
🟡 agents#routeAgentRequest 262.6 KiB 282.4 KiB +19.8 KiB (+7.55%)
🟡 agents#buildAgentUrl 262.7 KiB 282.5 KiB +19.8 KiB (+7.55%)
🟡 agents/workflows#AgentWorkflow 263.2 KiB 283.1 KiB +19.8 KiB (+7.54%)
🟡 agents/chat-sdk#ChatSdkStateAgent 263.7 KiB 283.5 KiB +19.8 KiB (+7.53%)
🟡 agents/chat-sdk#ChatSdkStateAdapter 264.3 KiB 284.1 KiB +19.8 KiB (+7.49%)
🟡 agents/chat-sdk#createChatSdkState 264.3 KiB 284.1 KiB +19.8 KiB (+7.49%)
🟡 agents/streams#Streams 4.3 KiB 4.5 KiB +268 B (+6.16%)
🟡 agents/mcp#ElicitRequestSchema 346.0 KiB 365.9 KiB +20.0 KiB (+5.77%)
🟡 agents/mcp#SSEEdgeClientTransport 346.1 KiB 366.0 KiB +19.9 KiB (+5.76%)
🟡 agents/mcp#StreamableHTTPEdgeClientTransport 346.1 KiB 366.0 KiB +19.9 KiB (+5.76%)
🟡 agents/mcp#McpAgent 346.0 KiB 365.9 KiB +19.9 KiB (+5.76%)
🟡 agents/mcp#getMcpAuthContext 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#RPC_DO_PREFIX 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#normalizeServerId 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#RPCServerTransport 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#DurableObjectEventStore 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#RPCClientTransport 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#MCP_SERVER_ID_MAX_LENGTH 346.0 KiB 365.9 KiB +19.9 KiB (+5.75%)
🟡 agents/mcp#WorkerTransport 349.4 KiB 369.3 KiB +19.9 KiB (+5.7%)
🟡 agents/mcp#createLegacyMcpHandler 379.4 KiB 399.4 KiB +20.0 KiB (+5.28%)
🟡 agents/mcp#experimental_createMcpHandler 379.6 KiB 399.6 KiB +20.0 KiB (+5.26%)
🟡 agents/mcp#createMcpHandler 391.7 KiB 411.5 KiB +19.8 KiB (+5.06%)
🟡 agents/chat#createChatStreams 6.4 KiB 6.6 KiB +261 B (+4%)
🟡 agents/lifecycle#Lifecycle 8.4 KiB 8.4 KiB +84 B (+0.98%)
🟡 agents/streams#StreamSerializationError 171 B 172 B +1 B (+0.58%)
🟡 agents/chat#ResumableStream 5.1 KiB 5.1 KiB +25 B (+0.48%)
🟡 agents/chat#AgentToolProgressEmitter 2.7 KiB 2.7 KiB +10 B (+0.37%)
🟡 agents/chat#TurnQueue 2.6 KiB 2.6 KiB +9 B (+0.34%)
🟡 agents/chat#TIMED_OUT 2.3 KiB 2.3 KiB +8 B (+0.34%)
🟡 agents/chat#isPlatformFailure 2.6 KiB 2.6 KiB +9 B (+0.33%)
🟡 agents/chat#toolResultUpdate 2.4 KiB 2.4 KiB +8 B (+0.33%)
🟡 agents/chat#TextSegmentJoiner 2.7 KiB 2.7 KiB +9 B (+0.33%)
🟡 agents/chat#reconcileOrphanPartial 2.4 KiB 2.4 KiB +8 B (+0.33%)
🟡 agents/chat#partAwaitsClientInteraction 2.4 KiB 2.4 KiB +8 B (+0.32%)
🟡 agents/chat#hasIncompleteToolBatch 2.4 KiB 2.4 KiB +8 B (+0.32%)
🟡 agents/chat#byteLength 2.5 KiB 2.5 KiB +8 B (+0.32%)
🟡 agents/chat#interceptAgentToolBroadcast 2.5 KiB 2.5 KiB +8 B (+0.32%)
🟡 agents/chat#runChatRecoveryExhaustion 2.6 KiB 2.6 KiB +8 B (+0.31%)
🟡 agents/chat#iterateWithStallWatchdog 2.6 KiB 2.6 KiB +8 B (+0.3%)
🟡 agents/chat#CHAT_RECOVERING_FLAG_TTL_MS 2.3 KiB 2.3 KiB +7 B (+0.3%)
🟡 agents/chat#KV_DELETE_MAX_KEYS 2.3 KiB 2.3 KiB +7 B (+0.3%)
🟡 agents/chat#AGENT_TOOL_STREAM_PROGRESS_BUMP_THROTTLE_MS 2.3 KiB 2.3 KiB +7 B (+0.3%)
🟡 agents/chat#CHAT_STREAM_PROGRESS_CREDIT_THROTTLE_MS 2.3 KiB 2.3 KiB +7 B (+0.3%)
🟡 agents/chat#CHAT_RECOVERING_KEY 2.3 KiB 2.3 KiB +7 B (+0.29%)
🟡 agents/chat#wrapChatFiberSnapshot 2.3 KiB 2.3 KiB +7 B (+0.29%)
🟡 agents/chat#createAgentToolEventState 2.3 KiB 2.3 KiB +7 B (+0.29%)
🟡 agents/chat#readChatRecoveryProgress 2.3 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#drainInteractionApplies 2.3 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#recordChatTerminal 2.4 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#AgentToolStreamProgressThrottle 2.4 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#StreamProgressCreditThrottle 2.4 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#applyToolUpdate 2.4 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#buildChatRecoveringFrame 2.4 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#isReplayChunk 2.4 KiB 2.4 KiB +7 B (+0.29%)
🟡 agents/chat#resolveToolMergeId 2.4 KiB 2.4 KiB +7 B (+0.28%)
🟡 agents/chat#listActiveChatRecoveryIncidents 2.4 KiB 2.4 KiB +7 B (+0.28%)
🟡 agents/chat#toolApprovalUpdate 2.4 KiB 2.4 KiB +7 B (+0.28%)
🟡 agents/chat#crossMessageToolResultUpdate 2.4 KiB 2.4 KiB +7 B (+0.28%)
🟡 agents/chat#unwrapChatFiberSnapshot 2.4 KiB 2.4 KiB +7 B (+0.28%)
🟡 agents/chat#reconcileMessages 2.8 KiB 2.8 KiB +8 B (+0.28%)
🟡 agents/chat#MessageType 2.4 KiB 2.4 KiB +7 B (+0.28%)
🟡 agents/chat#createChatFiberSnapshot 2.5 KiB 2.5 KiB +7 B (+0.28%)
🟡 agents/chat#applyAgentToolEvent 3.2 KiB 3.2 KiB +9 B (+0.28%)
🟡 agents/chat#parseProtocolMessage 2.5 KiB 2.5 KiB +7 B (+0.27%)
🟡 agents/chat#AbortRegistry 2.5 KiB 2.6 KiB +7 B (+0.27%)
🟡 agents/chat#resolveChatRecoveryConfig 2.6 KiB 2.6 KiB +7 B (+0.27%)
🟡 agents/chat#repairInterruptedToolParts 2.6 KiB 2.6 KiB +7 B (+0.26%)
🟡 agents/chat#createChatTurnTaskDefinition 2.7 KiB 2.7 KiB +7 B (+0.26%)
🟡 agents/chat#CHAT_RECOVERY_STABLE_RETRY_DELAY_SECONDS 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#DEFAULT_CHAT_RECOVERY_MAX_OOM_RETRIES 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#DEFAULT_CHAT_RECOVERY_MAX_WORK 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#DEFAULT_CHAT_RECOVERY_STABLE_TIMEOUT_MS 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#CHAT_RECOVERY_TASK_NAME 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#CHAT_RECOVERY_PROGRESS_KEY 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#CHAT_RECOVERY_INCIDENT_KEY_PREFIX 2.3 KiB 2.3 KiB +6 B (+0.25%)
🟡 agents/chat#pendingChatTerminal 2.3 KiB 2.4 KiB +6 B (+0.25%)
🟡 agents/chat#clearChatTerminal 2.3 KiB 2.4 KiB +6 B (+0.25%)
🟡 agents/chat#STREAM_RESUME_NONE_REASONS 2.3 KiB 2.4 KiB +6 B (+0.25%)
🟡 agents/chat#ChatStreamStalledError 2.4 KiB 2.4 KiB +6 B (+0.25%)
🟡 agents/chat#sendIfOpen 2.4 KiB 2.4 KiB +6 B (+0.25%)
🟡 agents/chat#pausedExecutionUpdate 2.4 KiB 2.4 KiB +6 B (+0.24%)
🟡 agents/chat#awaitWithDeadline 2.4 KiB 2.4 KiB +6 B (+0.24%)
🟡 agents/chat#sweepStaleChatRecoveryIncidents 2.4 KiB 2.5 KiB +6 B (+0.24%)
🟡 agents/chat#setChatRecovering 2.5 KiB 2.5 KiB +6 B (+0.24%)
🟡 agents/chat#StreamAccumulator 2.9 KiB 2.9 KiB +7 B (+0.23%)
🟡 agents/chat#ResumeHandshake 3.0 KiB 3.0 KiB +7 B (+0.23%)
🟡 agents/chat#sanitizeMessage 2.5 KiB 2.5 KiB +6 B (+0.23%)
🟡 agents/chat#ContinuationState 2.7 KiB 2.7 KiB +6 B (+0.22%)
🟡 agents/chat#broadcastTransition 3.2 KiB 3.2 KiB +7 B (+0.22%)
🟡 agents/chat#aiSdkRecoveryCodec 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#AutoContinuationController 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#CHAT_RECOVERY_ALARM_DEBOUNCE_MS 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#CHAT_RECOVERY_INCIDENT_TTL_MS 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#DEFAULT_CHAT_RECOVERY_NO_PROGRESS_TIMEOUT_MS 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#normalizeToolInput 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#DEFAULT_CHAT_RECOVERY_MAX_ATTEMPTS 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#MAX_BOUND_PARAMS 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#ROW_MAX_BYTES 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#CHAT_LAST_TERMINAL_KEY 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#toolPartHasSettledResult 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#clientResolvableToolNames 2.3 KiB 2.3 KiB +5 B (+0.21%)
🟡 agents/chat#DEFAULT_CHAT_RECOVERY_TERMINAL_MESSAGE 2.4 KiB 2.4 KiB +5 B (+0.21%)
🟡 agents/chat#bumpChatRecoveryProgress 2.4 KiB 2.4 KiB +5 B (+0.21%)
🟡 agents/chat#shouldCreditStreamProgress 2.4 KiB 2.4 KiB +5 B (+0.21%)
🟡 agents/chat#SubmitConcurrencyController 2.9 KiB 2.9 KiB +6 B (+0.2%)
🟡 agents/chat#buildInClauseStrings 2.4 KiB 2.4 KiB +5 B (+0.2%)
🟡 agents/chat#classifyAgentToolChildRecovery 2.4 KiB 2.4 KiB +5 B (+0.2%)
🟡 agents/chat#chatRecoveryTaskRunOptions 2.4 KiB 2.4 KiB +5 B (+0.2%)
🟡 agents/chat#persistReconstructedOrphan 3.1 KiB 3.1 KiB +6 B (+0.19%)
🟡 agents/chat#createChatRecoveryTaskDefinition 2.6 KiB 2.6 KiB +5 B (+0.19%)
🟡 agents/chat#PreStreamTurns 2.6 KiB 2.6 KiB +5 B (+0.19%)
🟡 agents/chat#applyChunkToParts 2.3 KiB 2.3 KiB +4 B (+0.17%)
🟡 agents/chat#CHAT_MESSAGE_TYPES 2.3 KiB 2.3 KiB +4 B (+0.17%)
🟡 agents/chat#dispatchChatRecoveryToHandoff 3.0 KiB 3.0 KiB +3 B (+0.1%)
🟡 agents/chat#ChatRecoveryEngine 4.4 KiB 4.4 KiB +4 B (+0.09%)
🟡 agents/websockets#CAPNWEB_TRANSPORT_QUERY 12.4 KiB 12.4 KiB +6 B (+0.05%)
🟡 agents/websockets#capnWebTransportUrl 12.5 KiB 12.5 KiB +6 B (+0.05%)
🟡 agents/websockets#CF_READONLY_KEY 12.4 KiB 12.4 KiB +5 B (+0.04%)
🟡 agents/websockets#CAPNWEB_TRANSPORT_VALUE 12.4 KiB 12.4 KiB +5 B (+0.04%)
🟡 agents/websockets#CF_NO_PROTOCOL_KEY 12.4 KiB 12.4 KiB +5 B (+0.04%)
🟡 agents/websockets#registerInternalConnectionKeys 12.4 KiB 12.4 KiB +5 B (+0.04%)
🟡 agents/websockets#isCapnWebTransportUpgrade 12.5 KiB 12.5 KiB +5 B (+0.04%)
🟡 agents/chat#truncateOlderMessages 3.2 KiB 3.2 KiB +1 B (+0.03%)
🟡 agents/websockets#WebSockets 20.0 KiB 20.0 KiB +5 B (+0.02%)
🟢 agents/chat#enforceRowSizeLimit 3.5 KiB 3.5 KiB -1 B (-0.03%)
🟢 agents/chat#createToolsFromClientSchemas 114.3 KiB 114.3 KiB -1 B (-0%)
⚪ agents/state-machine#defineAsk — 293 B —
⚪ agents/state-machine#MAX_CHECKPOINT_BYTES — 217 B —
⚪ agents/state-machine#MAX_SERIALIZED_BYTES — 218 B —
⚪ agents/state-machine#NonRetryableError — 262 B —
⚪ agents/state-machine#StateMachine — 25.1 KiB —
⚪ agents/state-machine#StateMachineCancelCannotParkError — 352 B —
⚪ agents/state-machine#StateMachineCheckpointTooLargeError — 442 B —
⚪ agents/state-machine#StateMachineConcurrentParkError — 345 B —
⚪ agents/state-machine#StateMachineDeadlineExceededError — 328 B —
⚪ agents/state-machine#StateMachineDuplicateStepError — 359 B —
⚪ agents/state-machine#StateMachineEventTimeoutError — 314 B —
⚪ agents/state-machine#StateMachineInterruptionsExhaustedError — 346 B —
⚪ agents/state-machine#StateMachineMailboxFullError — 321 B —
⚪ agents/state-machine#StateMachineMissingDefinitionError — 389 B —
⚪ agents/state-machine#StateMachineNoProgressError — 423 B —
⚪ agents/state-machine#StateMachineOrphanedDefinitionError — 403 B —
⚪ agents/state-machine#StateMachineReplayDivergedError — 373 B —
⚪ agents/state-machine#StateMachineSerializationError — 286 B —
⚪ agents/state-machine#StateMachineTransitionBudgetError — 397 B —
⚪ agents/state-machine#StateMachineTurnDeadlineExceededError — 337 B —
⚪ agents/tasks#defineAsk — 291 B —
⚪ agents/tasks#MAX_CHECKPOINT_BYTES — 217 B —
⚪ agents/tasks#TaskCancelCannotParkError — 351 B —
⚪ agents/tasks#TaskCheckpointTooLargeError — 441 B —
⚪ agents/tasks#TaskConcurrentParkError — 344 B —
⚪ agents/tasks#TaskEventTimeoutError — 314 B —
⚪ agents/tasks#TaskMailboxFullError — 321 B —
⚪ agents/tasks#TaskNoProgressError — 422 B —
⚪ agents/tasks#TaskOrphanedDefinitionError — 403 B —
⚪ agents/tasks#TaskTransitionBudgetError — 397 B —
⚪ agents/tasks#TaskTurnDeadlineExceededError — 339 B —
All 376 current runtime imports
Status Import Gzip Raw minified
🟡 agents#__DO_NOT_USE_WILL_BREAK__agentContext 281.8 KiB 1222.3 KiB
🟡 agents#__DO_NOT_USE_WILL_BREAK__withInvocationScope 281.7 KiB 1222.3 KiB
🟡 agents#Agent 281.8 KiB 1222.3 KiB
🟡 agents#AGENT_TOOL_MILESTONE_PART 281.7 KiB 1222.3 KiB
🟡 agents#AGENT_TOOL_PROGRESS_PART 281.8 KiB 1222.3 KiB
🟡 agents#buildAgentPath 282.3 KiB 1224.6 KiB
🟡 agents#buildAgentUrl 282.5 KiB 1225.0 KiB
🟡 agents#callable 281.8 KiB 1222.4 KiB
🟡 agents#camelCaseToKebabCase 281.8 KiB 1222.3 KiB
🟡 agents#createHeaderBasedEmailResolver 282.0 KiB 1222.7 KiB
🟡 agents#DEFAULT_AGENT_STATIC_OPTIONS 281.8 KiB 1222.3 KiB
🟡 agents#DurableObjectOAuthClientProvider 281.8 KiB 1222.3 KiB
🟡 agents#getAgentByName 281.8 KiB 1222.3 KiB
🟡 agents#getCurrentAgent 281.8 KiB 1222.3 KiB
🟡 agents#getSubAgentByName 282.1 KiB 1223.0 KiB
🟡 agents#isDurableObjectCodeUpdateReset 281.8 KiB 1222.3 KiB
🟡 agents#isDurableObjectMemoryLimitReset 281.8 KiB 1222.3 KiB
🟡 agents#isDurableObjectStorageReset 281.8 KiB 1222.4 KiB
🟡 agents#isPlatformTransientError 281.8 KiB 1222.3 KiB
🟡 agents#MCP_SERVER_ID_MAX_LENGTH 281.8 KiB 1222.3 KiB
🟡 agents#MessageType 281.9 KiB 1222.6 KiB
🟡 agents#normalizeServerId 281.7 KiB 1222.3 KiB
🟡 agents#parseSubAgentPath 281.8 KiB 1222.3 KiB
🟡 agents#routeAgentEmail 282.1 KiB 1223.0 KiB
🟡 agents#routeAgentRequest 282.4 KiB 1224.2 KiB
🟡 agents#routeSubAgentRequest 282.0 KiB 1222.9 KiB
🟡 agents#SqlError 281.8 KiB 1222.3 KiB
🟡 agents#StreamingResponse 281.8 KiB 1222.3 KiB
🟡 agents#SUB_PREFIX 281.8 KiB 1222.3 KiB
🟡 agents#unstable_callable 281.9 KiB 1222.5 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.6 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.4 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.4 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.6 KiB 22.7 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.4 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.4 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.4 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.4 KiB 8.3 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.5 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 284.1 KiB 1233.9 KiB
🟡 agents/chat-sdk#ChatSdkStateAgent 283.5 KiB 1231.4 KiB
🟡 agents/chat-sdk#createChatSdkState 284.1 KiB 1233.9 KiB
🟡 agents/chat-sdk#defaultKeyShard 281.9 KiB 1222.5 KiB
🟡 agents/chat-sdk#defaultThreadShard 281.8 KiB 1222.4 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 21.8 KiB 75.2 KiB
⚪ agents/client#AgentConnectionError 16.3 KiB 57.8 KiB
⚪ agents/client#agentFetch 19.7 KiB 69.0 KiB
⚪ agents/client#createStubProxy 16.4 KiB 57.8 KiB
⚪ agents/client#DEFAULT_CALL_TIMEOUT_MS 16.2 KiB 57.6 KiB
⚪ agents/client#isTerminalCloseEvent 16.3 KiB 57.6 KiB
⚪ agents/client#nativeCall 16.5 KiB 58.3 KiB
⚪ agents/client#NativeCallQueue 16.7 KiB 58.9 KiB
⚪ agents/client#splitCallOptions 16.3 KiB 57.7 KiB
⚪ 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/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.4 KiB 26.4 KiB
⚪ agents/lifecycle#LifecycleCapability 497 B 999 B
🟡 agents/mcp#createLegacyMcpHandler 399.4 KiB 1665.1 KiB
🟡 agents/mcp#createMcpHandler 411.5 KiB 1710.3 KiB
🟡 agents/mcp#DurableObjectEventStore 365.9 KiB 1523.6 KiB
🟡 agents/mcp#ElicitRequestSchema 365.9 KiB 1523.6 KiB
🟡 agents/mcp#experimental_createMcpHandler 399.6 KiB 1665.4 KiB
🟡 agents/mcp#getMcpAuthContext 365.9 KiB 1523.6 KiB
🟡 agents/mcp#MCP_SERVER_ID_MAX_LENGTH 365.9 KiB 1523.6 KiB
🟡 agents/mcp#McpAgent 365.9 KiB 1523.6 KiB
🟡 agents/mcp#normalizeServerId 365.9 KiB 1523.6 KiB
🟡 agents/mcp#RPC_DO_PREFIX 365.9 KiB 1523.6 KiB
🟡 agents/mcp#RPCClientTransport 365.9 KiB 1523.6 KiB
🟡 agents/mcp#RPCServerTransport 365.9 KiB 1523.6 KiB
🟡 agents/mcp#SSEEdgeClientTransport 366.0 KiB 1523.9 KiB
🟡 agents/mcp#StreamableHTTPEdgeClientTransport 366.0 KiB 1523.9 KiB
🟡 agents/mcp#WorkerTransport 369.3 KiB 1540.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/queue#Queue 3.1 KiB 9.6 KiB
⚪ agents/react#_testUtils 19.3 KiB 66.4 KiB
⚪ agents/react#useAgent 27.1 KiB 89.9 KiB
⚪ agents/react#useAgentToolEvents 21.1 KiB 73.7 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 22.0 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.6 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/state#State 1.1 KiB 2.4 KiB
⚪ agents/state-machine#defineAsk 293 B 382 B
⚪ agents/state-machine#MAX_CHECKPOINT_BYTES 217 B 266 B
⚪ agents/state-machine#MAX_SERIALIZED_BYTES 218 B 271 B
⚪ agents/state-machine#NonRetryableError 262 B 343 B
⚪ agents/state-machine#StateMachine 25.1 KiB 98.0 KiB
⚪ agents/state-machine#StateMachineCancelCannotParkError 352 B 494 B
⚪ agents/state-machine#StateMachineCheckpointTooLargeError 442 B 728 B
⚪ agents/state-machine#StateMachineConcurrentParkError 345 B 478 B
⚪ agents/state-machine#StateMachineDeadlineExceededError 328 B 457 B
⚪ agents/state-machine#StateMachineDuplicateStepError 359 B 506 B
⚪ agents/state-machine#StateMachineEventTimeoutError 314 B 437 B
⚪ agents/state-machine#StateMachineInterruptionsExhaustedError 346 B 485 B
⚪ agents/state-machine#StateMachineMailboxFullError 321 B 439 B
⚪ agents/state-machine#StateMachineMissingDefinitionError 389 B 579 B
⚪ agents/state-machine#StateMachineNoProgressError 423 B 631 B
⚪ agents/state-machine#StateMachineOrphanedDefinitionError 403 B 595 B
⚪ agents/state-machine#StateMachineReplayDivergedError 373 B 526 B
⚪ agents/state-machine#StateMachineSerializationError 286 B 382 B
⚪ agents/state-machine#StateMachineTransitionBudgetError 397 B 576 B
⚪ agents/state-machine#StateMachineTurnDeadlineExceededError 337 B 472 B
⚪ 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.5 KiB 14.5 KiB
🟡 agents/streams#StreamSerializationError 172 B 201 B
⚪ agents/tasks#defineAsk 291 B 382 B
🟡 agents/tasks#DuplicateTaskStepError 358 B 506 B
⚪ agents/tasks#MAX_CHECKPOINT_BYTES 217 B 266 B
🔴 agents/tasks#MAX_SERIALIZED_BYTES 218 B 271 B
🟡 agents/tasks#MissingTaskDefinitionError 389 B 579 B
🔴 agents/tasks#NonRetryableError 262 B 343 B
⚪ agents/tasks#TaskCancelCannotParkError 351 B 494 B
⚪ agents/tasks#TaskCheckpointTooLargeError 441 B 728 B
⚪ agents/tasks#TaskConcurrentParkError 344 B 478 B
🟡 agents/tasks#TaskDeadlineExceededError 328 B 457 B
⚪ agents/tasks#TaskEventTimeoutError 314 B 437 B
🔴 agents/tasks#TaskInterruptionsExhaustedError 345 B 485 B
⚪ agents/tasks#TaskMailboxFullError 321 B 439 B
⚪ agents/tasks#TaskNoProgressError 422 B 631 B
⚪ agents/tasks#TaskOrphanedDefinitionError 403 B 595 B
🟡 agents/tasks#TaskReplayDivergedError 372 B 526 B
🔴 agents/tasks#Tasks 25.3 KiB 98.4 KiB
🔴 agents/tasks#TaskSerializationError 285 B 382 B
⚪ agents/tasks#TaskTransitionBudgetError 397 B 576 B
⚪ agents/tasks#TaskTurnDeadlineExceededError 339 B 472 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#CAPNWEB_TRANSPORT_QUERY 12.4 KiB 43.3 KiB
🟡 agents/websockets#CAPNWEB_TRANSPORT_VALUE 12.4 KiB 43.3 KiB
🟡 agents/websockets#capnWebTransportUrl 12.5 KiB 43.5 KiB
🟡 agents/websockets#CF_NO_PROTOCOL_KEY 12.4 KiB 43.3 KiB
🟡 agents/websockets#CF_READONLY_KEY 12.4 KiB 43.3 KiB
🟡 agents/websockets#isCapnWebTransportUpgrade 12.5 KiB 43.4 KiB
🟡 agents/websockets#registerInternalConnectionKeys 12.4 KiB 43.4 KiB
🟡 agents/websockets#WebSockets 20.0 KiB 69.3 KiB
🟡 agents/workflows#AgentWorkflow 283.1 KiB 1227.1 KiB
🟡 agents/workflows#WorkflowRejectedError 281.8 KiB 1222.5 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[bot]

This comment was marked as resolved.

@pkg-pr-new

pkg-pr-new Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

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

@cloudflare/ai-chat

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

@cloudflare/codemode

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

hono-agents

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

@cloudflare/shell

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

@cloudflare/think

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

@cloudflare/voice

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

@cloudflare/worker-bundler

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

commit: 1247a44

…inal consumption, replay identity, dedupe before latest

A machine run's transition watchdog defaults to the step timeout and is
off for a durable function; the routed dispatch path enforces it and
the run deadline like the local one. A terminal the fence refuses
consumes no mailbox items. A repeated requestId is a duplicate before
latest can clear the original. Ask ids and default child run ids derive
from the run, the turn and the ordinal within the transition, so a
replayed transition finds what it already raised or spawned instead of
duplicating it; the ask insert is idempotent. A park re-reads the
mailbox and the ask ledger for a send or answer that raced it and wakes
at once. reopen() accepts any failed or cancelled run whose row is
still present.
devin-ai-integration[bot]

This comment was marked as resolved.

…Agent, machine lint

Cross-facet children: ctx.spawn(definition, input, { owner }) accepts the
child on one of the Agent's sub-agents, addressed by the new
Agent.subAgentRouteAddress(cls, name). The child runs and journals there;
its settlement note returns to the parent through the root; the cancel
cascade and terminate reach it; view().children lists it with its
ownerKey. Every run a sub-agent accepts is indexed on the root in
cf_agents_task_routes (riding the accept's wake sync, dropped by the
delete's), and a verb that misses locally — get, view, send, sendEvent,
withdraw, answer, withdrawAsk, cancel, terminate, pause, resume — is
forwarded to the owner, so an approval answered on the root reaches a
facet-hosted run parked with no wake at all.

Per-effect compensation: step.do(name, { compensate }, cb). The inline
default replays the current turn's journal in a fresh, fenced invocation
to collect the compensations of completed steps, runs them newest first,
each bounded by its step's timeout, records each success on the journal
row (compensated_at) so an interrupted pass never repeats one, then
settles by the mark. Invocations carry their kind (transition, cancel
transition, compensation pass); only a transition is signalled by a later
mark, a standing mark spends the run deadline, and the watchdog over a
hung onCancel takes the inline default.

Streams on Agent: Agent installs this.streams and hands it to this.tasks.
AIChatAgent and Think no longer construct their own; ResumableStream
raises chat's per-chunk ceiling through the sync aperture.

check:machines: a root check step that fails on any object-literal
machine definition without `satisfies TaskMachine`.
devin-ai-integration[bot]

This comment was marked as resolved.

…, base-name join

A released child keeps the note it wrote its parent, so a join on a
retain:false child resolves. A terminal return serializes its result
before any stream is touched and lands its fenced write inside the last
open stream's settlement; a writer the machine closed itself no longer
counts as open. send() serializes before latest/debounce delete anything,
runs the policy and insert in one transaction, and checks mailboxLimit
where the mailbox grows. A transition that received then threw consumes
what it read once the fence accepts the failure. at().answer matches the
ask row's run_id rather than an id prefix, and every handle verb is
scoped.

A definition may declare transitionBudget, overriding the capability's
for its runs. run() at an existing runId or idempotencyKey joins across
versions of one base; the receipt carries the stored name and handles
scope by base too.
devin-ai-integration[bot]

This comment was marked as resolved.

Every streamless boundary — the checkpoint commit, a park, and the
terminal and thrown settlements — runs its fenced run write and the
mailbox rows it consumes in one transaction. A run's engine-owned
streams settle in one transaction with the run's own write through the
new streams.transaction(closure), which holds the settle events until
it commits and re-derives the legacy chunk-table flag after a rollback;
the run's write is a statement of that transaction rather than a rider
on the last settle, so a stream that is already terminal cannot skip
it. A ctx writer marks its entry settled only after its own settle has
returned.

@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 4 new potential issues.

Devin Review

Comment on lines +2239 to +2243
active.controller.abort(error);
await this.#joinAttempt(active);
const current = this.#store.getRun(runId);
if (!current || TERMINAL_STATES.has(current.state)) return;
await this.#runCancelTransition(current, definition);

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.

🔴 Cancel transition races live handler

A signal-deaf handler outliving #joinAttempt runs concurrently with onCancel. Both can append to the same stream or repeat external effects.

Learn more

#joinAttempt returns after CLAIM_SLACK_MS even when the old invocation remains active. Generation fences reject later engine writes, but stream appends and arbitrary external effects do not carry that fence. Starting onCancel after this timeout therefore violates the fresh-invocation isolation promised by the abort protocol.

Example: A transition ignores ctx.signal while producing stream chunks. Cancellation times out the join and starts onCancel, which appends a final cancellation frame. The original transition can append another chunk before the stream closes, placing normal output after or among cancellation output.

Recommended fix: Do not run onCancel concurrently with the previous invocation. Either await actual invocation completion, or seal/fence every shared effect before starting onCancel and provide a separate cancellation-safe effect channel. The solution must cover stream appends and user-defined external effects, not only run-table writes.

Devin Review


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

Comment on lines +3844 to +3857
const resumed = this.#store.fencedWrite(
runId,
generation,
`UPDATE cf_agents_task_runs
SET checkpoint = ?, checkpoint_turn = ?, transitions = 0, stall = 0,
progress = ?, abort_mark = NULL, abort_reason = NULL,
cancel_requested = 0, cancel_reason = NULL, updated_at = ?
WHERE abort_mark = ? AND state = 'running'
AND run_id = ? AND generation = ?`,
[nextJson, turn + 1, progress + delta, now, mark]
);
if (!resumed) return;
engine.deleteMailbox(ctx.takeConsumed());
engine.retireJournal(turn);

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.

🔴 Declined cancellation can redeliver input

When onCancel returns a checkpoint, its checkpoint commits before consumed mailbox rows are deleted. An interruption can advance state while redelivering that input.

Learn more

The normal checkpoint path uses engine.commitCheckpoint to atomically update the checkpoint, delete consumed mailbox rows, and retire the old journal. The declined-cancellation path performs those operations as three independent writes. Durable Object termination after the first write leaves the new checkpoint committed while the consumed mailbox rows remain.

Example: onCancel receives message approve-7 and returns a new approved checkpoint. The checkpoint update commits, then the isolate dies before engine.deleteMailbox. On replay, the run starts from approved but receives approve-7 again.

Recommended fix: Add a mark-aware checkpoint commit operation that performs the checkpoint update, mailbox deletion, and journal retirement inside one transactionSync. Its fence must require the expected generation and abort mark, then clear the mark in the same write.

Devin Review


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

Comment on lines +2609 to +2612
const active = this.#active.get(runId);
active?.controller.abort(new TaskCancellation(reason));
await this.#settleCancelled(runId, null, reason);
const children = this.#store.read<{ run_id: string }>(

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.

🔴 Termination leaves streams open

terminate cancels the run without settling its engine-owned streams. Readers keep tailing a stream whose producer can never resume.

Learn more

Engine-owned streams are tracked durably through stream_tag and stream_epoch, but this direct terminal path never visits them. The same omission affects inline cancellation and deadline settlement when no fresh handler opens the existing stream. A terminal run has no future transition that can close the live epoch.

Example: A transition opens ctx.stream("main"), appends one chunk, and parks. Calling terminate(runId) changes the run to cancelled, while streams.status("<run>:main#0") remains streaming. A tailing reader waits indefinitely.

Recommended fix: Make every terminal abort path seal all live engine-owned streams atomically with the run settlement. Reuse the persisted stream names and current epoch, and ensure a refused run fence rolls every stream settlement back.

Devin Review


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

Comment on lines +4537 to +4544
if (row !== undefined) await this.#notifyParent(row);
// Nobody can answer a settled run's questions: mark them withdrawn, and
// keep them for the UI (§8.3).
this.#store.write(
`UPDATE cf_agents_task_asks SET state = 'withdrawn', answered_at = ?
WHERE run_id = ? AND state = 'open'`,
[Date.now(), runId]
);

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.

🔍 Terminal mailbox cleanup needs follow-up

Retained cancellations keep queued mailbox rows after handlers become unreachable. This conflicts with the documented terminal cascade and leaves stale messages in view().

Devin Review


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

@mattzcarey

Copy link
Copy Markdown
Contributor Author

Closing in favour of #2396. We're moving harnesses onto a small driver (agents/driver) and rebuilding Think's turn loop on it, instead of a general state-machine engine under Tasks.

@mattzcarey mattzcarey closed this Sep 28, 2026
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