opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Fork endpoint requires undocumented agent field

Open crayment opened this issue 1 week ago • 0 comments

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.

crayment avatar Jan 04 '26 19:01 crayment