Add session start hook

This commit is contained in:
gt-oai
2026-02-12 11:07:23 +00:00
parent 26d9bddc52
commit 376c7d517d
5 changed files with 101 additions and 0 deletions
+11
View File
@@ -44,6 +44,7 @@ use async_channel::Receiver;
use async_channel::Sender;
use codex_hooks::HookEvent;
use codex_hooks::HookEventAfterAgent;
use codex_hooks::HookEventSessionStart;
use codex_hooks::HookPayload;
use codex_hooks::Hooks;
use codex_hooks::HooksConfig;
@@ -1327,6 +1328,16 @@ impl Session {
Arc::clone(&config),
&session_configuration.session_source,
);
sess.hooks()
.dispatch(HookPayload {
session_id: sess.conversation_id,
cwd: session_configuration.cwd.clone(),
triggered_at: chrono::Utc::now(),
hook_event: HookEvent::SessionStart {
event: HookEventSessionStart {},
},
})
.await;
Ok(sess)
}