| 720 | |
| 721 | impl Hooks { |
| 722 | fn should_handoff_codex_lifecycle(&self, managed: bool) -> bool { |
| 723 | // Codex clamps SessionEnd hooks to three seconds. Managed lifecycles |
| 724 | // stay foreground so WIP-backed refusal can reach the original caller. |
| 725 | !managed |
| 726 | && !self.foreground |
| 727 | && !self.json |
| 728 | && self.agent_name == "codex" |
| 729 | && matches!(self.verb.as_str(), "stop" | "session-end") |
| 730 | } |
| 731 | |
| 732 | fn handoff_codex_lifecycle(&self, input: &[u8]) -> CliResult<()> { |
| 733 | let exe = std::env::current_exe().map_err(|e| { |