Skip to content

Docs: Long-running agents, durable execution, and chat recovery#1292

Merged
threepointone merged 5 commits intomainfrom
long-running-agents
Apr 11, 2026
Merged

Docs: Long-running agents, durable execution, and chat recovery#1292
threepointone merged 5 commits intomainfrom
long-running-agents

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

@threepointone threepointone commented Apr 11, 2026

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 for keepAlive(), runFiber(), stash(), and onFiberRecovered(). Covers the API, lifecycle diagrams, inline vs fire-and-forget patterns, checkpoint semantics, concurrent fibers, and testing recovery locally. Links to forever.md for internal design details.

  • Updated: docs/chat-agents.md — added Stream Recovery section documenting unstable_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 @experimental note on keepAlive().

Test plan

  • Verify all cross-doc #anchor links resolve correctly
  • Verify code examples are syntactically valid TypeScript
  • Read through each doc for clarity and completeness

Made with Cursor


Open with Devin

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.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 11, 2026

⚠️ No Changeset found

Latest commit: e90a40f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

devin-ai-integration[bot]

This comment was marked as resolved.

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
devin-ai-integration[bot]

This comment was marked as resolved.

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
devin-ai-integration[bot]

This comment was marked as resolved.

@threepointone threepointone merged commit edc1650 into main Apr 11, 2026
@threepointone threepointone deleted the long-running-agents branch April 11, 2026 22:15
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