Docs: Long-running agents, durable execution, and chat recovery#1292
Merged
threepointone merged 5 commits intomainfrom Apr 11, 2026
Merged
Docs: Long-running agents, durable execution, and chat recovery#1292threepointone merged 5 commits intomainfrom
threepointone merged 5 commits intomainfrom
Conversation
Introduce comprehensive documentation for long-running, durable agents and recoverable execution: adds docs/long-running-agents.md (lifecycle, keepAlive, runFiber, stash, recovery strategies, examples, planning, workflows, sub-agents, housekeeping) and docs/durable-execution.md (API overview for durable fibers). Also updates docs/index.md to link to the new pages and related topics.
Add comprehensive docs for durable execution and LLM stream recovery: introduce Stream Recovery in chat-agents (unstable_chatRecovery, onChatRecovery, continueLastTurn, stash patterns, provider strategies) and export ChatRecovery types. Expand durable-execution with a Quick Start, keepAlive/keepAliveWhile details, runFiber API, stash/checkpoint semantics, recovery lifecycle, concurrent fibers, testing guidance, and related links. Also tidy related references and remove an outdated experimental note in scheduling.md.
|
Add bridging sentences before each pattern section so the narrative thread (project manager agent) carries through the entire doc instead of shifting into pattern-catalog mode halfway through. Made-with: Cursor
The setState filter was removing all complete tasks, but the archive filter only selected tasks older than 30 days. Recently completed tasks would be dropped from state without being archived. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New doc:
docs/long-running-agents.md— conceptual guide covering why Cloudflare is a natural fit for long-running agents (actor model, economics of waiting), the agent lifecycle (hibernation, eviction, recovery), and patterns for waking on signals, staying alive during work, surviving crashes, handling async operations, reconstructing AI context, planning as a durability strategy, delegating to sub-agents, recovering LLM streams, managing state over time, and end-of-life cleanup. Uses a project manager agent as a running example throughout.New doc:
docs/durable-execution.md— reference doc forkeepAlive(),runFiber(),stash(), andonFiberRecovered(). Covers the API, lifecycle diagrams, inline vs fire-and-forget patterns, checkpoint semantics, concurrent fibers, and testing recovery locally. Links toforever.mdfor internal design details.Updated:
docs/chat-agents.md— added Stream Recovery section documentingunstable_chatRecovery,onChatRecovery,ChatRecoveryContext,ChatRecoveryOptions,continueLastTurn(), stashing recovery data, and provider-specific strategies (Workers AI, OpenAI Responses API, Anthropic).Updated:
docs/index.md— added entries for both new docs (Long-Running Agents in Advanced Topics, Durable Execution in Background Processing).Updated:
docs/scheduling.md— removed@experimentalnote onkeepAlive().Test plan
#anchorlinks resolve correctlyMade with Cursor