Centralized configuration with process-local overrides.
Configuration values are resolved in priority order:
- Process-local override — set via
put/2, scoped to the calling process. Automatically cleaned up when the process exits. - Application environment — set via
config :agent_session_manager, key: valueorApplication.put_env/3. - Built-in default — hardcoded fallback per key.
This layering follows the same pattern as Elixir's Logger module for per-process
log levels. It enables fully concurrent (async: true) testing because each test
process can override configuration without affecting any other process.
Supported Keys
| Key | Type | Default |
|---|---|---|
:telemetry_enabled | boolean | true |
:audit_logging_enabled | boolean | true |
Examples
# Read (checks process-local first, then app env, then default)
AgentSessionManager.Config.get(:telemetry_enabled)
#=> true
# Set process-local override
AgentSessionManager.Config.put(:telemetry_enabled, false)
AgentSessionManager.Config.get(:telemetry_enabled)
#=> false
# Clear process-local override (falls back to app env / default)
AgentSessionManager.Config.delete(:telemetry_enabled)
Summary
Functions
Returns the built-in default for key.
Removes the process-local override for key.
Returns the resolved value for key.
Sets a process-local override for key.
Types
Functions
Returns the built-in default for key.
@spec delete(key()) :: :ok
Removes the process-local override for key.
After deletion, get/1 falls back to Application environment or the
built-in default.
Returns the resolved value for key.
Checks the process dictionary first, then Application environment, then falls back to the built-in default.
Sets a process-local override for key.
This override is visible only to the calling process and is automatically cleaned up when the process exits. It takes priority over Application environment and built-in defaults.