Files
codex/codex-rs/ext/extension-api
papayo-oai b244e9bafe Add a command-start callback for tool lifecycle extensions (#46539)
## What changed

Add `ToolLifecycleContributor::on_command_start` with `CommandStartInput` carrying the resolved command, working directory, selected executor's filesystem, and lifecycle context. Await contributors after command hooks and environment resolution so they can prepare the filesystem before `exec_command` runs, including calls from code mode.

Reserve process IDs only after preparation completes so cancelled preparation does not consume an ID. Keep deterministic process IDs from being reused after removal.

## Testing

Add tests for direct and code-mode calls that verify callbacks receive hook-rewritten commands and the executor's working directory, filesystem preparation completes before execution, and interrupted preparation prevents execution without consuming a process ID. Add a regression test for deterministic process ID reuse after removal.

GitOrigin-RevId: d10bcafcc583a6e3e8b5924d004806727e3763bb
2026-09-19 00:46:06 +00:00
..