Skip to content

fix(opencode): fix full session fork#26811

Merged
rekram1-node merged 5 commits into
devfrom
fix-full-session-fork
May 11, 2026
Merged

fix(opencode): fix full session fork#26811
rekram1-node merged 5 commits into
devfrom
fix-full-session-fork

Conversation

@rekram1-node
Copy link
Copy Markdown
Collaborator

@rekram1-node rekram1-node commented May 11, 2026

Summary

  • Restore full-session forking when the SDK sends POST /session/:sessionID/fork with no request body.
  • Treat an empty fork request body as equivalent to {} while preserving the existing messageID JSON body path for timeline forks.
  • Cover the no-body fork request in the session HTTP API regression test.

Why

The full-session fork option calls session.fork({ sessionID }). Published SDK versions, including the version that introduced full-session fork support and the latest release, send that request with no body and no Content-Type. The legacy Hono route tolerated that shape, but the Effect HttpApi route attempts to decode JSON before the handler runs whenever a payload is declared, so the empty-body request was rejected before Session.fork executed.

The fix keeps the public fork payload contract unchanged (messageID remains optional) and restores compatibility at the HTTP boundary instead of changing generated SDK behavior.

Verification

  • bun test test/server/httpapi-session.test.ts

@rekram1-node rekram1-node merged commit 518264f into dev May 11, 2026
12 of 14 checks passed
@rekram1-node rekram1-node deleted the fix-full-session-fork branch May 11, 2026 05:26
joshue031 pushed a commit to joshue031/opencode that referenced this pull request May 11, 2026
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