Skip to main content

Module executor

Module executor 

Source
Expand description

Process execution abstraction for dependency injection.

This module provides a trait-based abstraction for executing external processes, allowing production code to use real processes and test code to use mocks. This follows the same pattern as AppEffectHandler for dependency injection.

§Purpose

  • Production: RealProcessExecutor executes actual commands using std::process::Command
  • Tests: MockProcessExecutor captures calls and returns controlled results

§Benefits

  • Test isolation: Tests don’t spawn real processes
  • Determinism: Tests produce consistent results
  • Speed: Tests run faster without subprocess overhead
  • Mockability: Full control over process behavior in tests

Structs§

AgentChildHandle
Result of spawning an agent process.
AgentCommandResult
Result of an agent command execution (for testing).
AgentSpawnConfig
Configuration for spawning an agent process with streaming support.
ProcessOutput
Output from an executed process.
RealAgentChild
Wrapper for real std::process::Child.
RealProcessExecutor
Real process executor that uses std::process::Command.

Traits§

AgentChild
Trait for interacting with a spawned agent child process.
ProcessExecutor
Trait for executing external processes.