openclaw - 💡(How to fix) Fix Feature: Session fork, resume, and continue (like open-agent-sdk) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59109Fetched 2026-04-08 02:28:28
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Fix Action

Fix / Workaround

Current workaround

Code Example

// Fork
const forked = sdk.forkSession('session-id');

// Resume by ID  
for await (const msg of sdk.query({ prompt, options: { resume: 'session-id' } })) { ... }

// Continue most recent
for await (const msg of sdk.query({ prompt, options: { continue: true } })) { ... }
RAW_BUFFERClick to expand / collapse

Motivation

OpenClaw lacks three session capabilities that open-agent-sdk provides:

  1. forkSession(id) — fork an existing session to create a parallel branch
  2. resume: sessionId — resume an existing session by ID
  3. continue: true — continue the most recent session without knowing its ID

Use cases

  • Branch testing: Test two different approaches from the same conversation context
  • Session replay: A task failed; resume from exactly where it left off
  • Quick continue: User says 'continue where we left off' without a session ID

Current workaround

requires knowing the exact session ID upfront. No forking capability exists.

Reference API (open-agent-sdk)

// Fork
const forked = sdk.forkSession('session-id');

// Resume by ID  
for await (const msg of sdk.query({ prompt, options: { resume: 'session-id' } })) { ... }

// Continue most recent
for await (const msg of sdk.query({ prompt, options: { continue: true } })) { ... }

Environment

  • OpenClaw: 2026.3.28 | macOS Darwin 25.1.0 | Node v24.1.0

extent analysis

TL;DR

Implementing the forkSession, resume, and continue session capabilities in OpenClaw will likely resolve the issue.

Guidance

  • Review the open-agent-sdk documentation to understand how the forkSession, resume, and continue capabilities are implemented.
  • Consider adding a forkSession method to OpenClaw that creates a parallel branch from an existing session.
  • Investigate how to store and manage session IDs in OpenClaw to support resuming sessions by ID and continuing the most recent session.

Example

// Example forkSession method
const forkedSession = openClaw.forkSession('existing-session-id');

// Example resume by ID
for await (const msg of openClaw.query({ prompt, options: { resume: 'session-id' } })) { ... }

// Example continue most recent
for await (const msg of openClaw.query({ prompt, options: { continue: true } })) { ... }

Notes

The implementation details of the forkSession, resume, and continue capabilities in OpenClaw are not provided, so the guidance is limited to reviewing the open-agent-sdk documentation and considering how to add these capabilities to OpenClaw.

Recommendation

Apply a workaround by implementing the missing session capabilities in OpenClaw, as this will provide the required functionality for branch testing, session replay, and quick continue use cases.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING