Skip to main content

Module self_cmd

Module self_cmd 

Source
Expand description

Commands that act on the currently running zig/zag session.

The session’s process id is resolved from the ZAG_PROCESS_ID environment variable injected by zag-agent when the process was spawned. These commands are designed to be invoked by agents from inside their own interactive session (e.g. an interactive consult step calling zig self terminate to hand control back to the workflow engine).

Constants§

INTERACTIVE_SELF_TERMINATE_INSTRUCTION
Instruction appended to interactive agents’ system prompts so they know how to exit the session when they finish. Exposed for tests in run_tests.rs and used from run::build_agent_config.

Functions§

terminate
Terminate the current running session (SIGTERM) by delegating to zag-orch’s process registry. Resolves "self" via ZAG_PROCESS_ID; errors if that env var is not set.