aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/codex/herdr-agent-state.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration/assets/codex/herdr-agent-state.sh')
-rw-r--r--src/integration/assets/codex/herdr-agent-state.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/integration/assets/codex/herdr-agent-state.sh b/src/integration/assets/codex/herdr-agent-state.sh
index b3b08a78..687a8181 100644
--- a/src/integration/assets/codex/herdr-agent-state.sh
+++ b/src/integration/assets/codex/herdr-agent-state.sh
@@ -3,7 +3,7 @@
# managed by herdr; reinstalling or updating the integration overwrites this file.
# add custom hooks beside this file instead of editing it.
# HERDR_INTEGRATION_ID=codex
-# HERDR_INTEGRATION_VERSION=6
+# HERDR_INTEGRATION_VERSION=7
set -eu
@@ -56,6 +56,12 @@ request_id = f"{source}:{int(time.time() * 1000)}:{random.randrange(1_000_000):0
report_seq = time.time_ns()
session_id = hook_input.get("session_id")
agent_session_id = session_id if isinstance(session_id, str) and session_id else None
+transcript_path = hook_input.get("transcript_path")
+if not isinstance(transcript_path, str) or not transcript_path.strip():
+ raise SystemExit(0)
+inherited_session_id = os.environ.get("CODEX_THREAD_ID")
+if inherited_session_id and inherited_session_id != agent_session_id:
+ raise SystemExit(0)
session_start_source = hook_input.get("source") if hook_event_name == "SessionStart" else None
if not isinstance(session_start_source, str) or not session_start_source:
session_start_source = None