Skip to content

fix(session): accept empty fork payload#26655

Open
eatFirewood wants to merge 1 commit into
anomalyco:devfrom
eatFirewood:fix-session-fork-empty-body
Open

fix(session): accept empty fork payload#26655
eatFirewood wants to merge 1 commit into
anomalyco:devfrom
eatFirewood:fix-session-fork-empty-body

Conversation

@eatFirewood
Copy link
Copy Markdown

@eatFirewood eatFirewood commented May 10, 2026

Issue for this PR

Closes #26656

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Allows POST /session/:sessionID/fork to accept an empty request body. Full-session forks call session.fork({ sessionID }), and the generated SDK omits the body when there is no messageID. The server previously tried to parse that missing body as JSON and returned 400 RequestParseError: JSON Parse error: Unexpected EOF.

This keeps the existing { messageID } behavior for message-specific forks, but handles no-content bodies as full-session forks.

How did you verify your code works?

  • bun run --cwd packages/opencode typecheck
  • bun run --cwd packages/opencode script/httpapi-exercise.ts --mode effect
  • bun run --cwd packages/opencode script/httpapi-exercise.ts --mode coverage --fail-on-missing --fail-on-skip

Screenshots / recordings

N/A, server-side HTTP API fix.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Full-session fork fails when request body is empty

1 participant