Skip to main content

Move a workspace session to another agent space

POST 

/session/reconfigure

Changes the agent space of the session named by X-Session-ID. The client names only an agent space and never sends an image, mount, network setting, or capability.

On success Peen records the decision with the caller's reason and stops the worker. The next turn starts a new worker in the new agent space. The decision also appears in GET /session/agent-space-decisions.

Errors, none of which changes anything:

  • 400 VALIDATION_FAILED: the body is missing, has an unknown field, leaves out agentSpace or reason, or reason is only whitespace.
  • 403 AGENT_SPACE_NOT_ALLOWED: the session is the system session, which always stays in control, whatever agentSpace names (message the system session's agent space cannot be changed); or agentSpace names an agent space the deployment does not offer.
  • 404 SESSION_NOT_FOUND: the session does not exist.
  • 409 CONFLICT: agentSpace names the agent space the workspace already runs in. Peen records no decision and stops no worker.
  • 409 SESSION_BUSY: the session has a turn in flight. Changing the environment under running work would attribute that turn's tool calls to an agent space that did not run them. Retry once the turns end.

Request​

Responses​

The agent space decision recorded for the named session.

Response Headers
    X-Session-ID

    The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.

    X-Request-ID

    The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.