Centralized numeric constants and compatibility defaults.
After the common runtime replatform, Gemini's streaming/session lane runs on
cli_subprocess_core. This module therefore keeps Gemini-owned defaults for
stream lifecycle management, synchronous command execution, public option
defaults, and preserved compatibility knobs.
Override any value via Application configuration:
# config/config.exs
config :gemini_cli_sdk,
stream_timeout_ms: 600_000,
max_buffer_size: 2_097_152Timeouts
| Key | Default | Used By | Description |
|---|---|---|---|
:command_timeout_ms | 60,000 | Command | Synchronous command timeout |
:stream_timeout_ms | 300,000 | Stream | Stream receive timeout |
:default_timeout_ms | 300,000 | Options | Default user-facing timeout |
:transport_call_timeout_ms | 5,000 | Legacy compatibility docs | Preserved legacy timeout |
:transport_force_close_timeout_ms | 500 | Legacy compatibility docs | Preserved legacy timeout |
:transport_headless_timeout_ms | 5,000 | Legacy compatibility docs | Preserved legacy timeout |
:transport_close_grace_ms | 2,000 | Stream | Close grace period |
:transport_kill_grace_ms | 250 | Stream | Kill/demonitor grace period |
:command_stop_wait_ms | 200 | Command | Wait after SIGTERM |
:command_kill_wait_ms | 500 | Command | Wait after SIGKILL |
:finalize_delay_ms | 25 | Legacy compatibility docs | Preserved legacy delay |
Buffer Sizes
| Key | Default | Used By | Description |
|---|---|---|---|
:max_buffer_size | 1,048,576 | Legacy compatibility docs | Preserved legacy stdout buffer (1 MB) |
:max_stderr_buffer_size | 262,144 | Options, Stream | Default stderr buffer (256 KB) |
Limits
| Key | Default | Used By | Description |
|---|---|---|---|
:max_lines_per_batch | 200 | Legacy compatibility docs | Preserved legacy batch size |
:max_include_directories | 5 | Options | Max include directories |
Compile-Time vs Runtime
Constants consumed via module attributes (for example in Stream) are
evaluated at compile time. Changing these via Application.put_env/3 at
runtime requires recompilation of the consuming module. Constants consumed via
direct function calls (for example in Command.run/2) pick up runtime
changes immediately.
Summary
Functions
Returns all configuration keys and their current values.
Returns the configured value for command_kill_wait_ms (default: 500).
Returns the configured value for command_stop_wait_ms (default: 200).
Returns the configured value for command_timeout_ms (default: 60000).
Returns the configured value for default_timeout_ms (default: 300000).
Returns the configured value for finalize_delay_ms (default: 25).
Returns the configured value for max_buffer_size (default: 1048576).
Returns the configured value for max_include_directories (default: 5).
Returns the configured value for max_lines_per_batch (default: 200).
Returns the configured value for max_stderr_buffer_size (default: 262144).
Returns the configured value for stream_timeout_ms (default: 300000).
Returns the configured value for transport_call_timeout_ms (default: 5000).
Returns the configured value for transport_close_grace_ms (default: 2000).
Returns the configured value for transport_force_close_timeout_ms (default: 500).
Returns the configured value for transport_headless_timeout_ms (default: 5000).
Returns the configured value for transport_kill_grace_ms (default: 250).
Functions
@spec all() :: keyword(pos_integer())
Returns all configuration keys and their current values.
@spec command_kill_wait_ms() :: pos_integer()
Returns the configured value for command_kill_wait_ms (default: 500).
@spec command_stop_wait_ms() :: pos_integer()
Returns the configured value for command_stop_wait_ms (default: 200).
@spec command_timeout_ms() :: pos_integer()
Returns the configured value for command_timeout_ms (default: 60000).
@spec default_timeout_ms() :: pos_integer()
Returns the configured value for default_timeout_ms (default: 300000).
@spec finalize_delay_ms() :: pos_integer()
Returns the configured value for finalize_delay_ms (default: 25).
@spec max_buffer_size() :: pos_integer()
Returns the configured value for max_buffer_size (default: 1048576).
@spec max_include_directories() :: pos_integer()
Returns the configured value for max_include_directories (default: 5).
@spec max_lines_per_batch() :: pos_integer()
Returns the configured value for max_lines_per_batch (default: 200).
@spec max_stderr_buffer_size() :: pos_integer()
Returns the configured value for max_stderr_buffer_size (default: 262144).
@spec stream_timeout_ms() :: pos_integer()
Returns the configured value for stream_timeout_ms (default: 300000).
@spec transport_call_timeout_ms() :: pos_integer()
Returns the configured value for transport_call_timeout_ms (default: 5000).
@spec transport_close_grace_ms() :: pos_integer()
Returns the configured value for transport_close_grace_ms (default: 2000).
@spec transport_force_close_timeout_ms() :: pos_integer()
Returns the configured value for transport_force_close_timeout_ms (default: 500).
@spec transport_headless_timeout_ms() :: pos_integer()
Returns the configured value for transport_headless_timeout_ms (default: 5000).
@spec transport_kill_grace_ms() :: pos_integer()
Returns the configured value for transport_kill_grace_ms (default: 250).