feature: SIGUSR2 handler for live config and rules reload
Summary
Changing Codex configuration or rules currently requires restarting the session, which loses all in-progress context. A SIGUSR2 handler that reloads config and rules files live would allow operators to update agent behavior mid-session.
Use case
Common mid-session scenarios where live reload would help:
- Switching the active model (e.g., to a faster model for a bulk subtask)
- Adding or updating rules files without losing conversation context
- Updating provider configuration without a full restart
Proposed behavior
- Codex registers a
SIGUSR2handler in the Node wrapper (codex-cli/bin/codex.js). - On receipt, Codex re-reads its config file (
~/.codex/config.tomlorCODEX_CONFIGpath) and any active rules files. - Settings that can safely change mid-session take effect immediately (model, provider, rules). Settings that cannot (e.g., transport mode, sandbox policy) are logged as "requires restart."
- Codex emits a brief in-session notice:
[config reloaded]so the operator knows the signal was received.
Why SIGUSR2
SIGHUP is the Unix convention for config reload in long-running processes, but Codex already forwards SIGHUP to child processes. SIGUSR2 is the standard alternative when SIGHUP is unavailable for application use.
Prior art
A similar proposal was filed for Claude Code: anthropics/claude-code#36849.
---
This issue was drafted collaboratively by a human operator and an AI assistant (AI-C per ai-attribution).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗