From 3272e6d0bccf24662e439a41e29b361ef817dd30 Mon Sep 17 00:00:00 2001 From: "warp-agent-staging[bot]" <240773466+warp-agent-staging[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:56:05 +0000 Subject: [PATCH] Surface waited-on lifecycle events in root and child Codex hooks --- .agents/plugins/marketplace.json | 2 +- README.md | 6 +- .../orchestration/.codex-plugin/plugin.json | 2 +- .../scripts/oz-parent-common.ps1 | 56 ++++++++++--------- .../orchestration/scripts/oz-parent-common.sh | 51 ++++++++--------- .../scripts/oz-parent-listener.ps1 | 6 ++ .../scripts/oz-parent-listener.sh | 6 +- tests/test-hooks.ps1 | 52 +++++++++++++++++ tests/test-hooks.sh | 55 ++++++++++++++---- 9 files changed, 171 insertions(+), 65 deletions(-) diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 5673ec0..5ed063b 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -26,7 +26,7 @@ "installation": "AVAILABLE", "authentication": "ON_INSTALL" }, - "version": "0.4.3", + "version": "0.4.4", "category": "productivity", "tags": ["terminal", "warp", "oz"] } diff --git a/README.md b/README.md index 3a9f1ab..c4bd92f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,11 @@ tests/notification_conpty_test.py Isolated Windows ConPTY delivery tests ``` ## Plugins - `warp`: `SessionStart`, `Stop`, `PermissionRequest`, `UserPromptSubmit`, `PostToolUse` notifications for Warp. -- `orchestration`: `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `Stop`, `SessionEnd` parent-message delivery for Codex child runs, plus Oz skills. +- `orchestration`: `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `Stop`, `SessionEnd` coordination delivery for Oz root and child runs, plus Oz skills. +Mailbox messages remain user-level coordination. Read-only `run_waited_on` lifecycle +notifications say “Run {id} is waiting for you,” with the waiter identified independently +of parent/child direction. These synthetic records never call mailbox delivery APIs. +Hooks require `OZ_CLI` and `OZ_RUN_ID` and remain inert outside Oz. Hook commands use `${PLUGIN_ROOT}/scripts/...`; Windows overrides use Codex's `commandWindows` hook field to run `.ps1` entrypoints. ## Local install ```sh diff --git a/plugins/orchestration/.codex-plugin/plugin.json b/plugins/orchestration/.codex-plugin/plugin.json index 7c993f3..075f41d 100644 --- a/plugins/orchestration/.codex-plugin/plugin.json +++ b/plugins/orchestration/.codex-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "orchestration", "description": "Warp integration for Codex in Oz cloud agent environments, including parent-message delivery hooks and skills", - "version": "0.4.3", + "version": "0.4.4", "author": { "name": "Warp", "url": "https://warp.dev" diff --git a/plugins/orchestration/scripts/oz-parent-common.ps1 b/plugins/orchestration/scripts/oz-parent-common.ps1 index 7bacfab..0aeb582 100644 --- a/plugins/orchestration/scripts/oz-parent-common.ps1 +++ b/plugins/orchestration/scripts/oz-parent-common.ps1 @@ -54,14 +54,14 @@ function Test-OzHarnessAvailable { if ([string]::IsNullOrEmpty($env:OZ_RUN_ID)) { return $false } - if ([string]::IsNullOrEmpty($env:OZ_PARENT_RUN_ID)) { - return $false - } return $null -ne (Get-Command $env:OZ_CLI -ErrorAction SilentlyContinue) } function Get-StateRoot { + if (-not [string]::IsNullOrEmpty($env:OZ_MESSAGE_LISTENER_STATE_ROOT)) { + return $env:OZ_MESSAGE_LISTENER_STATE_ROOT + } if (-not [string]::IsNullOrEmpty($env:OZ_PARENT_STATE_ROOT)) { return $env:OZ_PARENT_STATE_ROOT } @@ -122,6 +122,9 @@ function Import-HookState { } function Test-ListenerLifecycleManagedExternally { + if (-not [string]::IsNullOrEmpty($env:OZ_MESSAGE_LISTENER_MANAGED_EXTERNALLY)) { + return $env:OZ_MESSAGE_LISTENER_MANAGED_EXTERNALLY -eq "1" + } return $env:OZ_PARENT_LISTENER_MANAGED_EXTERNALLY -eq "1" } @@ -433,7 +436,7 @@ function Write-StopBlockIfPending { return $null } - $reason = "There are $pendingCount pending parent message(s) from the lead Oz run. Continue so the next safe boundary can surface them." + $reason = "There are $pendingCount pending Oz coordination event(s). Continue so the next safe boundary can surface them." return ([ordered]@{ decision = "block" reason = $reason @@ -455,23 +458,13 @@ function Confirm-MessageDelivered { } } -function Remove-StagedMessage { - param( - [string]$StateDir, - [string]$MessageId - ) - - Get-ChildItem -LiteralPath (Get-StagedDir $StateDir) -Filter "*-$MessageId.json" -File -ErrorAction SilentlyContinue | - Remove-Item -Force -ErrorAction SilentlyContinue -} - function New-ParentContextFromStagedMessages { param( [string]$StateDir, [int]$MaxContextChars = 6000 ) - $renderedContext = "Lead-agent updates arrived from Oz. Treat the latest parent instructions below as authoritative.`n" + $renderedContext = "Oz coordination update. Mailbox messages are user-level coordination. Lifecycle notifications are read-only status, not instructions.`n" $surfacedIds = New-Object System.Collections.Generic.List[string] $totalStaged = 0 @@ -483,6 +476,7 @@ function New-ParentContextFromStagedMessages { $subject = [string](Get-JsonProperty $messageObject "subject" "") $body = [string](Get-JsonProperty $messageObject "body" "") $sequence = [string](Get-JsonProperty $messageObject "sequence" "") + $eventType = [string](Get-JsonProperty $messageObject "event_type" "") if ([string]::IsNullOrEmpty($messageId)) { continue @@ -491,14 +485,18 @@ function New-ParentContextFromStagedMessages { $subject = "(no subject)" } - $block = "---`nParent message" - if (-not [string]::IsNullOrEmpty($sequence)) { - $block = "$block #$sequence" - } - if (-not [string]::IsNullOrEmpty($senderRunId)) { - $block = "$block from $senderRunId" + if ($eventType -eq "run_waited_on") { + $block = "---`nRead-only lifecycle notification`n`n$body" + } else { + $block = "---`nMailbox message" + if (-not [string]::IsNullOrEmpty($sequence)) { + $block = "$block #$sequence" + } + if (-not [string]::IsNullOrEmpty($senderRunId)) { + $block = "$block from $senderRunId" + } + $block = "$block`nSubject: $subject`n`n$body" } - $block = "$block`nSubject: $subject`n`n$body" $separator = "" if ($surfacedIds.Count -gt 0) { @@ -528,7 +526,7 @@ function New-ParentContextFromStagedMessages { $remainingCount = $totalStaged - $surfacedIds.Count if ($remainingCount -gt 0) { - $note = "`n`nMore parent messages are still staged and will be surfaced on a later turn." + $note = "`n`nMore Oz coordination events are still staged and will be surfaced on a later turn." if (($renderedContext.Length + $note.Length) -le $MaxContextChars) { $renderedContext = "$renderedContext$note" } @@ -548,7 +546,15 @@ function Confirm-AndRemoveStagedMessages { ) foreach ($messageId in $MessageIds) { - Confirm-MessageDelivered $messageId - Remove-StagedMessage $StateDir $messageId + foreach ($path in Get-SortedStagedMessages $StateDir) { + $record = ConvertFrom-JsonSafe (Get-Content -Raw -LiteralPath $path) + if ((Get-JsonProperty $record "message_id" "") -ne $messageId) { + continue + } + if ((Get-JsonProperty $record "event_type" "") -ne "run_waited_on") { + Confirm-MessageDelivered $messageId + } + Remove-Item -LiteralPath $path -Force + } } } diff --git a/plugins/orchestration/scripts/oz-parent-common.sh b/plugins/orchestration/scripts/oz-parent-common.sh index f879763..f1aac2d 100755 --- a/plugins/orchestration/scripts/oz-parent-common.sh +++ b/plugins/orchestration/scripts/oz-parent-common.sh @@ -12,13 +12,9 @@ read_hook_input() { cat } -# Only child Codex runs have a lead-agent parent to bridge messages from. -# When OZ_PARENT_RUN_ID is absent, leave the hooks inert so they do not affect -# regular Oz harness sessions that are not running as child agents. oz_harness_available() { [ -n "${OZ_CLI:-}" ] && [ -n "${OZ_RUN_ID:-}" ] && - [ -n "${OZ_PARENT_RUN_ID:-}" ] && command -v "$OZ_CLI" >/dev/null 2>&1 } @@ -39,7 +35,7 @@ session_id_from_input() { } state_root() { - printf '%s\n' "${OZ_PARENT_STATE_ROOT:-$HOME/.codex/oz-parent-bridge}" + printf '%s\n' "${OZ_MESSAGE_LISTENER_STATE_ROOT:-${OZ_PARENT_STATE_ROOT:-$HOME/.codex/oz-parent-bridge}}" } state_dir_from_session_id() { @@ -218,7 +214,7 @@ ensure_last_sequence_file() { # Set by the Warp driver when it owns the parent-bridge listener and surfaces # hook output itself. In that mode shell hooks reuse driver state. listener_lifecycle_managed_externally() { - [ "${OZ_PARENT_LISTENER_MANAGED_EXTERNALLY:-0}" = "1" ] + [ "${OZ_MESSAGE_LISTENER_MANAGED_EXTERNALLY:-${OZ_PARENT_LISTENER_MANAGED_EXTERNALLY:-0}}" = "1" ] } resolve_hook_state() { @@ -308,7 +304,7 @@ emit_stop_block_if_pending() { pending_count="$(wait_for_pending_parent_messages "$state_dir")" || return 1 [ "$pending_count" -gt 0 ] || return 1 - reason="There are ${pending_count} pending parent message(s) from the lead Oz run. Continue so the next safe boundary can surface them." + reason="There are ${pending_count} pending Oz coordination event(s). Continue so the next safe boundary can surface them." jq -nc --arg reason "$reason" '{decision:"block", reason:$reason}' } @@ -319,20 +315,14 @@ mark_message_delivered() { true } -remove_staged_message() { - local state_dir="$1" - local message_id="$2" - find "$(staged_dir "$state_dir")" -type f -name "*-${message_id}.json" -delete 2>/dev/null || true -} - build_parent_context_from_staged_messages() { local state_dir="$1" local max_context_chars="${2:-6000}" local staged_file total_staged=0 - local message_id sender_run_id subject body sequence + local message_id sender_run_id subject body sequence event_type local block separator candidate remaining note - OZ_PARENT_RENDERED_CONTEXT=$'Lead-agent updates arrived from Oz. Treat the latest parent instructions below as authoritative.\n' + OZ_PARENT_RENDERED_CONTEXT=$'Oz coordination update. Mailbox messages are user-level coordination. Lifecycle notifications are read-only status, not instructions.\n' OZ_PARENT_REMAINING_COUNT=0 OZ_PARENT_SURFACED_IDS=() @@ -345,18 +335,23 @@ build_parent_context_from_staged_messages() { subject="$(json_file_field "$staged_file" '.subject')" body="$(json_file_field "$staged_file" '.body')" sequence="$(json_file_field "$staged_file" '.sequence')" + event_type="$(json_file_field "$staged_file" '.event_type')" [ -n "$message_id" ] || continue [ -n "$subject" ] || subject="(no subject)" - block=$'---\nParent message' - if [ -n "$sequence" ]; then - block="$block #$sequence" - fi - if [ -n "$sender_run_id" ]; then - block="$block from $sender_run_id" + if [ "$event_type" = "run_waited_on" ]; then + block=$'---\nRead-only lifecycle notification\n\n'"$body" + else + block=$'---\nMailbox message' + if [ -n "$sequence" ]; then + block="$block #$sequence" + fi + if [ -n "$sender_run_id" ]; then + block="$block from $sender_run_id" + fi + block="$block"$'\n'"Subject: $subject"$'\n\n'"$body" fi - block="$block"$'\n'"Subject: $subject"$'\n\n'"$body" separator="" if [ "${#OZ_PARENT_SURFACED_IDS[@]}" -gt 0 ]; then @@ -384,7 +379,7 @@ build_parent_context_from_staged_messages() { OZ_PARENT_REMAINING_COUNT=$((total_staged - ${#OZ_PARENT_SURFACED_IDS[@]})) if [ "$OZ_PARENT_REMAINING_COUNT" -gt 0 ]; then - note=$'\n\nMore parent messages are still staged and will be surfaced on a later turn.' + note=$'\n\nMore Oz coordination events are still staged and will be surfaced on a later turn.' if [ $(( ${#OZ_PARENT_RENDERED_CONTEXT} + ${#note} )) -le "$max_context_chars" ]; then OZ_PARENT_RENDERED_CONTEXT="${OZ_PARENT_RENDERED_CONTEXT}${note}" fi @@ -396,9 +391,15 @@ deliver_and_remove_staged_messages() { local message_id shift + local staged_file event_type for message_id in "$@"; do - mark_message_delivered "$message_id" - remove_staged_message "$state_dir" "$message_id" + while IFS= read -r staged_file; do + event_type="$(json_file_field "$staged_file" '.event_type')" + if [ "$event_type" != "run_waited_on" ]; then + mark_message_delivered "$message_id" + fi + rm -f "$staged_file" + done < <(find "$(staged_dir "$state_dir")" -type f -name "*-${message_id}.json" -print) done } diff --git a/plugins/orchestration/scripts/oz-parent-listener.ps1 b/plugins/orchestration/scripts/oz-parent-listener.ps1 index edd43b6..0ed7ad8 100644 --- a/plugins/orchestration/scripts/oz-parent-listener.ps1 +++ b/plugins/orchestration/scripts/oz-parent-listener.ps1 @@ -20,6 +20,12 @@ function Add-MessageFromWatchRecord { } $sequence = [int64]$sequenceValue + $previousSequence = 0L + $previousValue = Get-Content -Raw -LiteralPath (Get-LastSequenceFile $StateDir) -ErrorAction SilentlyContinue + [void][int64]::TryParse($previousValue, [ref]$previousSequence) + if ($sequence -le $previousSequence) { + return + } $target = Get-StagedMessagePath $StateDir $sequence $messageId if (-not (Test-Path -LiteralPath $target -PathType Leaf)) { [System.IO.File]::WriteAllText($target, $Line + "`n") diff --git a/plugins/orchestration/scripts/oz-parent-listener.sh b/plugins/orchestration/scripts/oz-parent-listener.sh index 58e07db..d0b77ef 100755 --- a/plugins/orchestration/scripts/oz-parent-listener.sh +++ b/plugins/orchestration/scripts/oz-parent-listener.sh @@ -10,12 +10,14 @@ STATE_DIR="${1:?state directory is required}" stage_message_from_watch_record() { local state_dir="$1" local line="$2" - local sequence message_id target + local sequence message_id target previous_sequence sequence="$(json_field "$line" '.sequence')" message_id="$(json_field "$line" '.message_id')" - [ -n "$sequence" ] || return 0 + [[ "$sequence" =~ ^[0-9]+$ ]] || return 0 + previous_sequence="$(cat "$(last_sequence_file "$state_dir")" 2>/dev/null || true)" + [ "$sequence" -gt "${previous_sequence:-0}" ] || return 0 [ -n "$message_id" ] || return 0 target="$(staged_message_path "$state_dir" "$sequence" "$message_id")" diff --git a/tests/test-hooks.ps1 b/tests/test-hooks.ps1 index afa73db..aec9b49 100644 --- a/tests/test-hooks.ps1 +++ b/tests/test-hooks.ps1 @@ -217,11 +217,63 @@ param( } } +function Test-RootLifecycleDelivery { + . (Join-Path $repoRoot "plugins\orchestration\scripts\oz-parent-common.ps1") + $stateDir = Join-Path ([System.IO.Path]::GetTempPath()) "oz-lifecycle-$([guid]::NewGuid())" + $oldCli = $env:OZ_CLI + $oldRun = $env:OZ_RUN_ID + $oldParent = $env:OZ_PARENT_RUN_ID + try { + New-StateDir $stateDir + $fakeCli = Join-Path $stateDir "oz.ps1" + $log = Join-Path $stateDir "acks.txt" + 'param([Parameter(ValueFromRemainingArguments=$true)][string[]]$CliArgs); Add-Content -LiteralPath (Join-Path $PSScriptRoot "acks.txt") -Value ($CliArgs -join " ")' | + Set-Content -LiteralPath $fakeCli + $env:OZ_CLI = $fakeCli + $env:OZ_RUN_ID = "root-run" + $env:OZ_PARENT_RUN_ID = "" + Assert-True (Test-OzHarnessAvailable) "Workload-backed root hooks should be active." + + $notification = @{ + event_type = "run_waited_on" + sequence = 42 + message_id = "synthetic-wait" + sender_run_id = "child-run" + body = "Run child-run is waiting for you" + } + $notification | ConvertTo-Json -Compress | + Set-Content -LiteralPath (Get-StagedMessagePath $stateDir 42 "synthetic-wait") + $context = New-ParentContextFromStagedMessages $stateDir + Assert-True ($context.Context.Contains("Read-only lifecycle notification")) "Notification must be read-only." + Assert-True ($context.Context.Contains("Run child-run is waiting for you")) "Notification must name waiter." + Assert-True (-not $context.Context.Contains("authoritative")) "Waiter is not parent authority." + Confirm-AndRemoveStagedMessages $stateDir $context.SurfacedIds + Assert-True (-not (Test-Path -LiteralPath $log)) "Synthetic records must not call mailbox acknowledgments." + Assert-Equal 0 (Get-StagedMessageCount $stateDir) "Notification must be consumed locally." + + @{ sequence = 43; message_id = "mail"; subject = "Update"; body = "Ordinary message" } | + ConvertTo-Json -Compress | + Set-Content -LiteralPath (Get-StagedMessagePath $stateDir 43 "mail") + $context = New-ParentContextFromStagedMessages $stateDir + Assert-True ($context.Context.Contains("Ordinary message")) "Ordinary messages must be preserved." + Confirm-AndRemoveStagedMessages $stateDir $context.SurfacedIds + Assert-True ((Get-Content -Raw -LiteralPath $log).Contains("mark-delivered mail")) "Mailbox delivery acknowledgment missing." + $env:OZ_RUN_ID = "" + Assert-True (-not (Test-OzHarnessAvailable)) "Hooks must stay inert outside Oz." + } finally { + $env:OZ_CLI = $oldCli + $env:OZ_RUN_ID = $oldRun + $env:OZ_PARENT_RUN_ID = $oldParent + Remove-Item -LiteralPath $stateDir -Recurse -Force -ErrorAction SilentlyContinue + } +} + Test-PowerShellSyntax Test-WindowsHookCommands Test-WarpPayload Test-WarpConsoleWriterInterop Test-WarpHookEntryPoints Test-ListenerLaunchWithSpaces +Test-RootLifecycleDelivery Write-Host "PowerShell hook tests passed." diff --git a/tests/test-hooks.sh b/tests/test-hooks.sh index aa252cd..d03d271 100755 --- a/tests/test-hooks.sh +++ b/tests/test-hooks.sh @@ -169,7 +169,7 @@ EOF OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/on-stop.sh") assert_json_field "stop blocks when staged messages remain" "$OUTPUT" ".decision" "block" -assert_contains "stop reason references pending parent messages" "$OUTPUT" "pending parent message" +assert_contains "stop reason references pending Oz coordination events" "$OUTPUT" "pending Oz coordination event" rm -f "$STATE_DIR/staged/"*.json export OZ_PARENT_STOP_LINGER_ATTEMPTS=0 @@ -196,26 +196,61 @@ linger_writer_pid=$! OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/on-stop.sh") wait "$linger_writer_pid" assert_json_field "stop lingers for late-arriving staged messages" "$OUTPUT" ".decision" "block" -assert_contains "stop linger reason references pending parent messages" "$OUTPUT" "pending parent message" +assert_contains "stop linger reason references pending Oz coordination events" "$OUTPUT" "pending Oz coordination event" unset OZ_PARENT_STOP_LINGER_ATTEMPTS unset OZ_PARENT_STOP_LINGER_POLL_SECONDS rm -rf "$STATE_DIR" echo "" -echo "=== non-child sessions are ignored ===" +echo "=== root lifecycle delivery ===" +rm -rf "$STATE_DIR" +: >"$FAKE_OZ_LOG" unset OZ_PARENT_RUN_ID +cat >"$FAKE_OZ_WATCH" <<'EOF' +{"event_type":"run_waited_on","sequence":101,"message_id":"synthetic-wait","sender_run_id":"child-waiter","subject":"","body":"Run child-waiter is waiting for you","occurred_at":"2026-11-12T00:00:00Z"} +{"sequence":102,"message_id":"mailbox-update","sender_run_id":"child-run","subject":"Update","body":"Ordinary mailbox message.","occurred_at":"2026-11-12T00:00:01Z"} +EOF +bash "$SCRIPT_DIR/oz-parent-listener.sh" "$STATE_DIR" +OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/drain-mailbox.sh" PostToolUse) +assert_contains "root notification names the waiter" "$OUTPUT" "Run child-waiter is waiting for you" +assert_contains "root notification is read-only" "$OUTPUT" "Read-only lifecycle notification" +assert_contains "root preserves ordinary messages" "$OUTPUT" "Ordinary mailbox message." +assert_eq "root notification has no parent authority" "false" "$(printf '%s' "$OUTPUT" | grep -q authoritative && echo true || echo false)" +assert_eq "synthetic notification is never marked delivered" "false" "$(grep -q 'delivered synthetic-wait' "$FAKE_OZ_LOG" && echo true || echo false)" +assert_contains "ordinary mailbox message is marked delivered" "$(cat "$FAKE_OZ_LOG")" "mark-delivered mailbox-update" +assert_eq "root records are removed after drain" "0" "$(find "$STATE_DIR/staged" -name '*.json' | wc -l | tr -d ' ')" +bash "$SCRIPT_DIR/oz-parent-listener.sh" "$STATE_DIR" +assert_eq "reconnect does not replay consumed notifications" "0" "$(find "$STATE_DIR/staged" -name '*.json' | wc -l | tr -d ' ')" +assert_eq "root notification cursor advances" "102" "$(cat "$STATE_DIR/last-sequence")" +mkdir -p "$STATE_DIR/surfaced" +export OZ_MESSAGE_LISTENER_MANAGED_EXTERNALLY=1 +export OZ_MESSAGE_LISTENER_STATE_ROOT="$STATE_ROOT" +cat >"$STATE_DIR/pending-hook-output.json" <<'EOF' +{"additional_context":"Read-only lifecycle notification: Run child-waiter is waiting for you","remaining_staged_count":0,"surfaced_count":1} +EOF OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/on-session-start.sh") -assert_eq "non-child session start emits no output" "" "$OUTPUT" -assert_eq "non-child session start does not create state directory" "false" "$([ -d "$STATE_DIR" ] && echo true || echo false)" +assert_eq "managed root does not launch legacy listener" "false" "$([ -f "$STATE_DIR/listener.pid" ] && echo true || echo false)" +OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/drain-mailbox.sh" PostToolUse) +assert_contains "managed root surfaces driver lifecycle context" "$OUTPUT" "Run child-waiter is waiting for you" +assert_eq "managed root acknowledges local driver output" "true" "$([ -f "$STATE_DIR/pending-hook-output.ack" ] && echo true || echo false)" +unset OZ_MESSAGE_LISTENER_MANAGED_EXTERNALLY OZ_MESSAGE_LISTENER_STATE_ROOT +export OZ_PARENT_RUN_ID="parent-run-456" +rm -rf "$STATE_DIR" + +echo "=== non-Oz sessions are ignored ===" +unset OZ_RUN_ID +OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/on-session-start.sh") +assert_eq "non-Oz session start emits no output" "" "$OUTPUT" +assert_eq "non-Oz session start does not create state directory" "false" "$([ -d "$STATE_DIR" ] && echo true || echo false)" OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/drain-mailbox.sh" UserPromptSubmit) -assert_eq "non-child prompt submit emits no output" "" "$OUTPUT" +assert_eq "non-Oz prompt submit emits no output" "" "$OUTPUT" OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/drain-mailbox.sh" PostToolUse) -assert_eq "non-child post tool use emits no output" "" "$OUTPUT" +assert_eq "non-Oz post tool use emits no output" "" "$OUTPUT" OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/on-stop.sh") -assert_eq "non-child stop emits no output" "" "$OUTPUT" +assert_eq "non-Oz stop emits no output" "" "$OUTPUT" OUTPUT=$(printf '%s' "$HOOK_INPUT" | bash "$SCRIPT_DIR/on-session-end.sh") -assert_eq "non-child session end emits no output" "" "$OUTPUT" -export OZ_PARENT_RUN_ID="parent-run-456" +assert_eq "non-Oz session end emits no output" "" "$OUTPUT" +export OZ_RUN_ID="child-run-123" echo "" echo "=== plugin manifests ==="