Skip to content

Fork endpoint requires undocumented agent field #6855

@crayment

Description

@crayment

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions