agent_launch
Launch coding agents from one standard entry into persistent local or remote sessions; harness-managed loops, auth, hooks, and transcripts handle execution while delivering completion asynchronously.
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}, 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. 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 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. TERMINAL_HARNESS_UNSUPPORTED = use harness claude-code. | |
| mcp_config | No | claude-code only. Extra MCP servers for this seat. Secret header values: write ${NAME} and list NAME in env_vars | |
| write_scope | No | 能力宣言。read-onlyは対応harnessの標準read-only面で実効禁止する | |
| session_name | No | Aiterm session名(省略で自動採番) | |
| 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 | claude-code only. Launch instructions added to the system prompt; kept in Aiterm state, not in the project or home. Never put secrets here | |
| 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 | ||
| harness | Yes | ||
| startup | Yes | ||
| input_id | No | ||
| provider | Yes | 旧互換field。新規連携はharnessを使う | |
| fast_error | No | fastを頼まれたが、通常の速度で起こした時の訳 | |
| session_id | Yes | ||
| remote_host | No | 別端末で起動した時の接続先 | |
| write_scope | 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 |