Skip to content

docs: add Conversation.fork() guide#459

Open
xingyaoww wants to merge 3 commits intomainfrom
openhands/conversation-fork
Open

docs: add Conversation.fork() guide#459
xingyaoww wants to merge 3 commits intomainfrom
openhands/conversation-fork

Conversation

@xingyaoww
Copy link
Copy Markdown
Contributor

  • I have read and reviewed the documentation changes to the best of my ability.
  • If the change is significant, I have run the documentation site locally and confirmed it renders as expected.

Summary of changes

Adds a new SDK guide page for Conversation.fork(), a first-class primitive for branching off an existing conversation for follow-up exploration without contaminating the original audit trail.

The guide covers:

  • Basic usage — fork a conversation, source isolation, deep-copy semantics
  • Agent replacement — fork with a different agent for A/B testing or tool-change scenarios
  • Tags and metadata — title and arbitrary tags on forks
  • Metrics reset — controlling whether cost/token stats carry over or start fresh
  • Agent-server REST endpointPOST /api/conversations/{id}/fork
  • Full ready-to-run example — uses a real LLM, demonstrates fork end-to-end

Navigation: Added sdk/guides/convo-fork as the first item in the "Conversation Features" group in docs.json.

Related: This documents the feature implemented in OpenHands/software-agent-sdk#2841 (closes OpenHands/software-agent-sdk#2840).

Note: Branch name matches the SDK PR branch (openhands/conversation-fork) so the check-documented-examples CI can discover the docs.


This PR was created by an AI agent (OpenHands) on behalf of the user.

Add SDK guide page for the new Conversation.fork() primitive that lets
users branch off an existing conversation for follow-up exploration
without contaminating the original audit trail.

Covers:
  - Basic usage (fork, source isolation, deep-copy semantics)
  - Fork with a different agent (A/B testing, tool-change)
  - Tags, metadata, and metrics reset
  - Agent-server REST endpoint (POST /api/conversations/{id}/fork)
  - Full ready-to-run example (no LLM calls needed)

Added to Conversation Features nav group in docs.json.

Related SDK PR: OpenHands/software-agent-sdk#2841

Co-authored-by: openhands <openhands@all-hands.dev>
Update the ready-to-run example to match the real-LLM version from
the SDK repo, and add the RunExampleCode shared snippet.

Co-authored-by: openhands <openhands@all-hands.dev>
@xingyaoww xingyaoww requested a review from enyst as a code owner April 16, 2026 04:31
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 16, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
all-hands-ai 🟢 Ready View Preview Apr 16, 2026, 4:32 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copy link
Copy Markdown
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

🟢 Good taste - Well-structured, comprehensive documentation that follows all repository guidelines.

This guide is production-ready. Clear organization, good examples, proper navigation integration, and follows the established SDK documentation patterns.

Comment thread sdk/guides/convo-fork.mdx
tags={"variant": "B"},
)
fork.run() # Same history, different model
```
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.

🟢 Acceptable: The line range focus={8-11} might not precisely match the code block lines (the fork call appears to be lines 4-8). Mintlify should handle this gracefully, but if the highlighting looks off in preview, consider adjusting to focus={4-8}.

Comment thread sdk/guides/convo-fork.mdx

- **[Persistence](/sdk/guides/convo-persistence)** — Save and restore conversation state
- **[Pause and Resume](/sdk/guides/convo-pause-and-resume)** — Control execution flow
- **[Agent Server](/sdk/guides/agent-server/overview)** — Deploy agents with the REST API
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.

🟢 Nice touch: Including the full ready-to-run example with assertions that verify fork behavior works well. The example is self-contained and educational.

Co-authored-by: openhands <openhands@all-hands.dev>
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.

Add Conversation.fork() as a first-class SDK primitive

4 participants