Skip to main content

Module spawn

Module spawn 

Source
Expand description

Last resort: start a NEW provider process that resumes the session for one turn. Only for a session marked headless (no client holds it open). A session that has a live client is never spawned into: two writers on one transcript is how sessions get corrupted.

KindCommand (prompt never in argv when the CLI reads stdin)
grok/localgrok --resume <id> -p <prompt>
codex/localcodex exec resume <id> - (prompt on stdin)
kimi_code/localkimi -S <id> -p <prompt>
claude_code/localclaude --resume <id> -p (prompt on stdin)
cursor/localagent --resume <id> -p <prompt>
codex/webcodex cloud exec --env <env> <prompt> (new cloud task)

The binary is M4A_<PROVIDER>_BIN or the vendor name on PATH.

Structs§

ResumeSpawnAdapter
Spawns one resume turn for a headless session. Does not wait for it.

Constants§

CODEX_CLOUD_ENV_ENV
Env var naming the cloud environment for codex cloud exec --env.

Functions§

bin_env
Env override for a provider binary (M4A_CODEX_BIN, …).
default_program
Default program name on PATH.
resume_command
Argv (after the program) and the stdin payload for one resume turn.