agent_launch
Launch coding agents into persistent sessions from one standard entry, choosing a harness that owns the loop, auth, hooks, and transcript, plus the model; run locally or on remote terminals.
Instructions
エージェントを単一の標準入口から永続sessionへ起動する。harnessはagent loop・認証・hook・transcriptを所有する実行基盤、modelはそのharnessが選ぶ推論モデルであり別軸。Cursor harnessからGPT/Claude/Grok等を選んでも完了相関はCursor方式のまま。ComposerはCursorのmodelの一つで、harnessでもGrokのmodelでもない。harness=cursor-cli と model=composer-2.5-fast(またはcomposer-2.5)で指定する。remoteを付けると、SSHで入った別端末のAitermで同じ起動を行い、完了は同じ形で親へ届く。通常CLIと同じHOME・cwd・project/user/local設定・MCP・plugin・skill・permission/trustを共有する。aitermは完了相関stateだけをlaunch単位で所有する。起動されたagentにはsub-agent自己認識、親session、delegation depth/lineage、delegation_allowed=trueを注入し、必要な追加委譲は許可する。別のcomputer(登録済みの端末)で起こす時は、この起動にterminal(端末の登録元が渡す値をそのまま)とcwd(その端末のproject folder)を付ける。ここで起こしてからcd・sshしない。秘密の値はどの引数・prompt・送信文にも書かず、env_varsに名前だけを書く。dispatch した子は投げっぱなしでよい=親はここで待たない。Codex親とClaude Code親にはAitermが回答本文を自動配送する。parent_deliveryがある場合はwait起動も通常の回答回収も不要。親は作業を続けるかターンを終える。Cursor親にはparent_deliveryとwait_processが付く。作業を続ければ次のツール返りに回答が差し込まれ、ターンを終える前にwait_processを背景で起動するとidle中の完了でも起きられる。ポーリングとpty_read(agent_transcript:true)は不要。その他の親では、完了通知をreceiptの wait_process.executable と wait_process.args をそのまま親のターンを塞がない別プロセスAPIへ渡して受け、PowerShell 7のStart-Processだけは windows_start_process_argument_list を単一文字列として渡す。exit を完了通知として扱う(exit 0=done / 3=timeout(既定600秒・未完了) / 4=closed / 7=error(harnessの記録でturnがAPIエラー等で打ち切られた。結果は無い)。receiptのoutcomeが正で、done以外は未完了。ポーリング不要)。wait_command は人間向け互換表示でありprocess境界へ使わない。foreground実行で親のターンを塞がない。自動配送以外の結果回収は pty_read(agent_transcript:true)。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"harness": "<harness>"
},
"name": "agent_launch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | 作業ディレクトリ(絶対パス・任意)。terminalを付ける時は必須で、その端末上のproject folderの絶対パス | |
| fast | No | ファスト(harnessの高速の応答。費用や利用量が増える)。省略とfalseは通常の速度で起こす(利用者の設定にfastが残っていても通常)。trueは通常で起こしてから、その席をfastへ切り替える。modelがfastに対応していない時(FAST_MODE_NOT_SUPPORTED)と、modelへfast版のIDを書いてfalseを渡した時(FAST_MODE_MODEL_CONFLICT)は起動を断る。アカウントの都合で使えない時・確かめられない時は、起動を断らずに通常の速度で起こし、返りの fast を false、fast_error に訳を入れる。modelへfast版のIDを直に書いて省略した時だけ、そのIDのまま起こす(返りの fast は true)。 | |
| image | No | 初手プロンプトへ添付する画像ファイルの絶対パス(png/jpg/jpeg/gif/webp) | |
| model | No | harnessが選ぶモデル。provider名ではなくlive catalog上のmodel ID | |
| prompt | No | 起動時に渡す初手プロンプト(任意)。送信後は待たずに即返る | |
| remote | No | 別端末のAitermで実行する時のSSH接続情報。hostだけならssh_configの接続名として使う。Aitermは接続情報を保存・管理しない。passphraseは会話記録に残るため、ssh-agentかpassphrase_env(環境変数名)を推奨する。 | |
| harness | Yes | agent loop・session・hook・transcript・認証を所有する実行基盤 | |
| env_vars | No | 現在のMCP processから継承する環境変数名 | |
| terminal | No | Run this seat on another computer (a registered terminal) over SSH. Value: exactly the terminal value your host system's terminal registry hands over, {ref, target:{host,user,port}, os?, trustRevision, and credentialRevision or credential {handle, revision}}; copy it unchanged, never invent or edit it, never use a host name or ssh command instead. Omit it to launch on this computer. Give cwd in the same call: the absolute project folder on that terminal in its own form (a POSIX path starting with / on macOS and Linux, a drive path like C:\folder with backslashes on Windows). Never launch locally and then cd or ssh. Never put tokens, passwords or other secrets in any argument, prompt or typed text; pass secret values only by name in env_vars. After launch, use session_id alone for pty_send, pty_observe, pty_read, pty_key, claude_turn, agent_stop and pty_close; Aiterm routes them to the terminal. Errors and next step: TERMINAL_INVALID = malformed value, missing/relative cwd (or one in the other system's form), or combined with remote: pass the registry's value unchanged with cwd. TARGET_MISMATCH / BINDING_UNKNOWN = the value is not this terminal's binding: ask the terminal registry again. HOST_TRUST_STALE / CREDENTIAL_REVISION_STALE = the binding changed: get the current value from the terminal registry and launch again. HOST_KEY_MISMATCH / HOST_TRUST_MISSING = the terminal's host key is not the trusted one: the Owner must confirm the new host key; do not retry. CREDENTIAL_REQUIRED / CREDENTIAL_NOT_LOADED = this terminal's key comes from a credential handle that the registry must load first; never paste a key anywhere. AUTH_FAILED = the terminal refused the key. UNREACHABLE = the terminal is offline; try later. CONNECTION_REFUSED = the terminal refused the SSH connection (SSH may be off there); try later. REMOTE_AITERM_TOO_OLD = update Aiterm on the terminal. CWD_UNAVAILABLE = the folder does not exist there; do not pick another folder. SEAT_FORWARD_UNAVAILABLE = the seat's MCP route back to this computer is not ready (launch again later), or the seat MCP URLs are not http://127.0.0.1:<one port>/api/seat-mcp. All five harnesses run on a terminal; REMOTE_AITERM_TOO_OLD names the Aiterm version the harness needs there (claude-code 0.65.0, codex-cli 0.70.7, grok-cli / cursor-cli / antigravity-cli 0.70.9). TERMINAL_HARNESS_UNSUPPORTED = the harness name is none of the five. AGENT_LAUNCH_NOT_STARTED with _meta aiterm/launch_error code AGENT_AUTH_REQUIRED = the CLI on the terminal is not logged in; the Owner logs it in there, then launch again. TERMINAL_OS_MISMATCH = the terminal is not the operating system os says: the registry's os is wrong or the binding points at another machine; ask the terminal registry, do not retry. TERMINAL_PLATFORM_UNSUPPORTED = the terminal is not a macOS, Linux or Windows system, so it cannot run seats. | |
| fork_from | No | claude-code and codex-cli. Start a disposable fork of that seat's latest saved conversation, in its cwd, with the main's tools and MCP. Every write inside that cwd (the project folder) is refused below the tools for the whole process tree (Linux Landlock, macOS sandbox-exec, Windows restricted token + folder deny ACE); everything else is allowed. Requires a prompt; no write_scope. Close it after its answer | |
| seat_role | No | 起動席の役割。省略・"delegated"は従来のsub-agent向け報告指示を保つ。"resident"はトップレベルのホスト管理常駐席(host-root/depth 1)向けで、技術lineageと実委譲は保ちつつ親への報告指示を外して報告先の規定を呼び手(append_system_prompt)へ委ねる。ネスト委譲された子席(depth>=2)では拒否。別端末では0.70.134以上が必要 | |
| mcp_config | No | Extra MCP servers for this seat. Secret header values: write ${NAME} and list NAME in env_vars. Codex, Grok, Cursor and Antigravity take only http servers {type?: "http", url, headers, replace?: boolean}: a literal header, 'Authorization: Bearer ${NAME}' or a header whose whole value is ${NAME}; other shapes, and a ${NAME} with no value at launch, are refused before the seat starts. A server the seat's own harness config already defines under the same name is dropped for this seat (listed in caller_mcp.dropped) unless its entry has replace: true; then it replaces that server (Codex: a user stdio server of that name runs Aiterm's relay to the given url instead). Cursor runs a server as plugin-aiterm-caller-<name> beside a same-name user server, so nothing is dropped there | |
| post_launch | No | A command {command: string[]} run once after every launch and resume of this seat, by the Aiterm that created the native seat (a terminal-bound launch: the terminal's), as the seat's user in its cwd, no shell, 10 s (argv[0] "node" = the Node this Aiterm runs on). Environment: AITERM_SESSION_ID, AITERM_HOOK_EVENT (launch/resume), AITERM_SEAT_FORWARD_PORT (terminal-bound, when the seat has a route back), AITERM_SESSION_ALIVE (JSON argv of aiterm-session-alive), and the private values this launch consumed (env_vars, ${NAME} header references): never argv. It never fails the launch; the result carries post_launch {status, exit_code}. Not saved: send it on every launch and resume. Needs Aiterm 0.70.100 on the terminal. | |
| write_scope | No | 能力宣言。read-onlyは対応harnessの標準read-only面で実効禁止する | |
| auto_approve | No | Antigravity machine only. Auto-approve all native tool permissions. Defaults to false on a fresh seat; omit on resume to keep the saved choice. Incompatible with read-only. | |
| session_name | No | Aiterm session名(省略で自動採番) | |
| settings_env | No | claude-code only. Environment values (name -> value) written into this seat's per-launch Claude settings `env` block on every machine, and again on resume. Nothing is set when omitted. Not for secrets: AITERM_*, CLAUDE_CONFIG_DIR and names ending TOKEN/KEY/SECRET/PASSWORD/CREDENTIAL/AUTH are refused (use env_vars by name). A remote below 0.70.76 refuses with REMOTE_AITERM_TOO_OLD | |
| trust_project | No | 対象projectを信頼し、既知のworkspace・project hooks・MCP初期同意を起動中に進める | |
| reasoning_effort | No | harness adapterが標準CLI表現へ変換する思考レベル。Cursorではmodel同時指定が必要 | |
| configuration_root | No | Claude Codeの設定root(CLAUDE_CONFIG_DIR)の絶対パス。既定のroot(~/.claude、CLAUDE_CONFIG_DIRなし)か、AITERM_CLAUDE_CONFIG_ROOTSに並べた親の直下だけ。他はAGENT_CONFIGURATION_ROOT_REJECTED。休止席の再開では、新しいrootに同じ会話の記録がある時だけ替えられる。claude-code harnessだけ | |
| launch_operation_id | No | Claude Codeのpromptなしexact replay相関だけで使用 | |
| append_system_prompt | No | Launch instructions added to the system prompt; kept in Aiterm state, not in the project or home. Never put secrets here. Codex: appended to developer_instructions after Aiterm's marker; Grok: appended to --rules; Antigravity: an always-on rule in the seat's own --add-dir folder; at most 64 KiB for these. Cursor has no system-prompt channel: the text goes in front of the first prompt, or of the first input sent to a promptless seat (at most 64 KiB) | |
| require_existing_resume | No | Resume an existing saved conversation only; missing or unsupported target never creates a new session. Requires session_name and no prompt; local-only. | |
| throughline_source_session | No | 同一端末のThroughline sessionから読み取り専用contextを初手へ注入する | |
| throughline_supplement_file | No | Throughline 0.10.8以降へそのまま渡すproject束縛済み長期記憶・知識の補足JSON path |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fast | No | 起こした後の、席のfastの状態(この項目を返さない版の別端末では無い) | |
| schema | Yes | ||
| fork_of | No | The seat this fork copies and the folder it cannot write | |
| harness | Yes | ||
| startup | Yes | ||
| input_id | No | ||
| provider | Yes | 旧互換field。新規連携はharnessを使う | |
| caller_mcp | No | mcp_config only: caller servers dropped because the seat's own harness config defines the name, and those that replaced it (replace: true). A terminal below 0.70.62 does not return it | |
| fast_error | No | fastを頼まれたが、通常の速度で起こした時の訳 | |
| session_id | Yes | ||
| post_launch | No | The result of the caller's post_launch command (absent when none was given) | |
| remote_host | No | 別端末で起動した時の接続先 | |
| write_scope | No | ||
| auto_approve | No | ||
| event_cursor | Yes | ||
| wait_command | Yes | ||
| wait_process | Yes | ||
| initial_prompt | Yes | ||
| remote_version | No | 別端末のAiterm版 | |
| submit_residue | Yes | ||
| parent_delivery | No | ||
| managed_completion | Yes | ||
| write_scope_enforcement | No |