Skip to content

Full-session fork fails when request body is empty #26656

@eatFirewood

Description

@eatFirewood

What happened?

Full-session forks can fail with a bad request when the client sends no JSON body.

The TUI full-session fork path calls session.fork({ sessionID }). The generated SDK strips the empty body when there is no messageID, but the HTTP API currently tries to parse the missing request body as JSON for /session/:sessionID/fork.

This produces a server-side request parse error:

POST /session/<id>/fork -> 400 RequestParseError
JSON Parse error: Unexpected EOF

In the TUI this can surface as a crash when the caller assumes forked.data.id exists after the failed request.

Expected behavior

POST /session/:sessionID/fork should accept an empty/no-content request body as a full-session fork, while still accepting { "messageID": "..." } for message-specific forks.

Notes

This appears to affect the full-session fork path added by #23339.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions