Fork endpoint requires undocumented agent field #4175

Open
opened 2026-02-16 17:42:53 -05:00 by yindo · 0 comments
Owner

Originally created by @crayment on GitHub (Jan 4, 2026).

Originally assigned to: @thdxr on GitHub.

Issue

The /session/:sessionID/fork endpoint is requiring an agent field in the request body, but:

  1. This field is not documented in the API
  2. The field is not present in the Session.fork.schema in the git source code
  3. Due to a Zod validation quirk, the agent field gets stripped when sent alone

Error

{
  "expected": "string",
  "code": "invalid_type",
  "path": ["agent"],
  "message": "Invalid input: expected string, received undefined"
}

Reproduction

curl -X POST 'http://127.0.0.1:50154/session/ses_xxx/fork?directory=/path' \
  -H 'Content-Type: application/json' \
  -d '{}'

Expected Behavior

Fork should work without the agent field (as the source code suggests), or the agent field should be documented and properly validated.

Versions Affected

Tested on v1.0.170, v1.0.220, v1.0.223, v1.1.1 - all require the agent field but it's not in the git source.

Originally created by @crayment on GitHub (Jan 4, 2026). Originally assigned to: @thdxr on GitHub. ## Issue The `/session/:sessionID/fork` endpoint is requiring an `agent` field in the request body, but: 1. This field is not documented in the API 2. The field is not present in the `Session.fork.schema` in the git source code 3. Due to a Zod validation quirk, the agent field gets stripped when sent alone ## Error ```json { "expected": "string", "code": "invalid_type", "path": ["agent"], "message": "Invalid input: expected string, received undefined" } ``` ## Reproduction ```bash curl -X POST 'http://127.0.0.1:50154/session/ses_xxx/fork?directory=/path' \ -H 'Content-Type: application/json' \ -d '{}' ``` ## Expected Behavior Fork should work without the agent field (as the source code suggests), or the agent field should be documented and properly validated. ## Versions Affected Tested on v1.0.170, v1.0.220, v1.0.223, v1.1.1 - all require the agent field but it's not in the git source.
yindo added the docs label 2026-02-16 17:42:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4175