Understand Yielded Agent
The runtime model
An Agent Definition describes behavior. A Thread owns the conversation. A durable host accepts input and advances it under one process owner; your application supplies authority, model services, and tool handlers.
Four execution boundaries
Section titled “Four execution boundaries”| Boundary | Meaning |
|---|---|
| Thread | An identified conversation shared across requests |
| Run | One logical execution against that Thread |
| Attempt | One scoped period trying to advance a durable Run |
| Turn | One model request and response, followed by its tool batch if present |
Additional submissions can join an active Run and settle with it. A process restart ends an Attempt. It need not end the Run or create a new Thread. The application routes each Thread to one owner on every backend. A shared database does not provide distributed takeover; stale results from a closed Attempt cannot commit.
One request through the runtime
Section titled “One request through the runtime”Consider a travel assistant that searches, waits for booking approval, then answers. The receipt identifies accepted work; it does not mean the booking or Run has finished.
Your application
Authorize and submit input
Keep caller identity and Thread access under host control.
Yielded Agent
Retain admission and return a receipt
Accepted work remains owed until terminal settlement.
Model and tools
Produce a complete model response
Application tools start after the response finishes.
Yielded Agent
Validate calls and obtain approvals
A wait can close this Attempt; a later Attempt resumes the same Run.
Model and tools
Run authorized tools with bounded concurrency
Yielded Agent
Commit results, then continue or settle
Results enter the conversation in declaration order. The next Turn sees the complete batch.
Your application
Observe the outcome and publish your reply
Approval and visibility callbacks run only when configured; built-in allow-all authorization needs no host callback.
Steering enters between complete turns; follow-up input enters when the Run would otherwise stop. Neither rewrites a tool already executing. Opt-in model-call restart can consume joined input earlier only while the call remains disposable.
Separate owners for separate lifetimes
Section titled “Separate owners for separate lifetimes”- Yielded Agent: Thread logConversation and committed outcomes
- Yielded Agent: Current Run stateProgress and cumulative accounting
- Yielded Agent: Model contextSelected history and compaction
- Yielded Agent: Next AttemptResume selected work
- Thread log to Model context
- Current Run state to Next Attempt
The log is append-only. The active Run checkpoint is authoritative operational state, updated with new facts and removed at settlement. Open tool outcomes and delivery obligations can outlive that Run and retain their own state. Conversation projections and lookup indexes are rebuildable views. The host reuses validated continuation state and rechecks live budgets and authority before new work.
Recovery reconstructs saved model context from prompt-relevant history, checking its
historyDigest and validating current Run evidence in full. Explicit verification also
validates historical fields omitted from the prompt view.
Compaction changes what the model sees. Archiving changes where old records live. Neither resolves uncertain effects or gives a Run fresh budget. There is no lifetime record cap on the durable log; individual Runs, payloads, and live work remain bounded. Without compaction, loading and sending the model’s conversation still grows with its size.
The host keeps work moving
Section titled “The host keeps work moving”Node hosts own scoped workers and recovery scans. Cloudflare Thread Objects use requests and alarms to resume eligible work; an idle recovery wake clears itself. Applications own reply delivery, query views, and optional memory processing. These have distinct obligations from running the model. Required custom publication can delay native execution; choose it deliberately.
Use durability for recovery guarantees, budgets for limits, and the Node or Cloudflare guide for runnable host composition.