mirror of
https://github.com/openai/codex.git
synced 2026-05-04 11:26:33 +00:00
(Experimental) This PR adds a first MVP for hooks, with SessionStart and Stop The core design is: - hooks live in a dedicated engine under codex-rs/hooks - each hook type has its own event-specific file - hook execution is synchronous and blocks normal turn progression while running - matching hooks run in parallel, then their results are aggregated into a normalized HookRunSummary On the AppServer side, hooks are exposed as operational metadata rather than transcript-native items: - new live notifications: hook/started, hook/completed - persisted/replayed hook results live on Turn.hookRuns - we intentionally did not add hook-specific ThreadItem variants Hooks messages are not persisted, they remain ephemeral. The context changes they add are (they get appended to the user's prompt)
10 lines
286 B
Rust
10 lines
286 B
Rust
use std::path::PathBuf;
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
let schema_root = std::env::args_os()
|
|
.nth(1)
|
|
.map(PathBuf::from)
|
|
.unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("schema"));
|
|
codex_hooks::write_schema_fixtures(&schema_root)
|
|
}
|