open
Starts, reconnects, or reuses a subagent coding session by session ID or matching working directory, restores its last config, and returns the session ID plus config options.
Instructions
Open a session: reconnect when session is given; with reuse, take this server's idle session with the same cwd and subagent, else reconnect the latest closed one on disk; otherwise create one. A reuse that cannot reconnect creates a new session and says why in reuse_skipped. Reconnecting puts back the config the session last had (the subagent config, or later set_config changes). Returns once the session is set up (role prompt included), with the session id and the full config_options. It takes no task: send tasks with prompt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Working directory of the agent | |
| role | No | Identity for the session. Avoid imperative verbs. | |
| reuse | No | ||
| session | No | Session id returned by open | |
| subagent | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | No | ||
| reused | Yes | ||
| status | Yes | ||
| outcome | No | ||
| session | Yes | ||
| turn_id | No | ||
| approval | No | ||
| question | No | ||
| reuse_skipped | No | ||
| config_options | Yes |