Run a single task non-interactively and exit.
The agent is created with interactive=False, which tailors the system
prompt for autonomous headless execution (no clarification questions,
reasonable assumptions).
Shell access and auto-approval are controlled by --shell-allow-list:
recommended or explicit list → shell enabled, commands gated by
allow-list; non-shell tools approved unconditionally.all → shell enabled, any command allowed, all tools auto-approved.Note: startup header rendering avoids synchronous LangSmith URL lookups. A background thread resolves the thread URL concurrently and the result is displayed after task completion if available.
run_non_interactive(
message: str,
assistant_id: str = 'agent',
model_name: str | None = None,
model_params: dict[str, Any] | None = None,
sandbox_type: str = 'none',
sandbox_id: str | None = None,
sandbox_setup: str | None = None,
*,
initial_skill: str | None = None,
profile_override: dict[str, Any] | None = None,
quiet: bool = False,
stream: bool = True,
mcp_config_path: str | None = None,
no_mcp: bool = False,
trust_project_mcp: bool = False
) -> int| Name | Type | Description |
|---|---|---|
message* | str | The task/message to execute. |
assistant_id | str | Default: 'agent'Agent identifier for memory storage. |
model_name | str | None | Default: NoneOptional model name to use. |
model_params | dict[str, Any] | None | Default: NoneExtra kwargs from These override config file values. |
sandbox_type | str | Default: 'none'Type of sandbox ( |
sandbox_id | str | None | Default: NoneOptional existing sandbox ID to reuse. |
sandbox_setup | str | None | Default: NoneOptional path to setup script to run in the sandbox after creation. |
initial_skill | str | None | Default: NoneOptional skill name whose |
profile_override | dict[str, Any] | None | Default: NoneExtra profile fields from Merged on top of config file profile overrides. |
quiet | bool | Default: FalseWhen |
stream | bool | Default: TrueWhen When |
mcp_config_path | str | None | Default: NoneOptional path to MCP servers JSON configuration file. Merged on top of auto-discovered configs (highest precedence). |
no_mcp | bool | Default: FalseDisable all MCP tool loading. |
trust_project_mcp | bool | Default: FalseWhen |