diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-15 02:13:30 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-15 02:13:30 +0300 |
| commit | dcfc45b45d198434db5057c991e72c089b42c705 (patch) | |
| tree | 4cbdbc253bb5dc12c734a7ed1cbf82fd444d3cd2 /src/integration/assets/claude/herdr-agent-state.ps1 | |
| parent | c91348e68b9e438159ffecc3e26bc6f971e0fa2a (diff) | |
fix: preserve claude session rotations
refs #620
Diffstat (limited to 'src/integration/assets/claude/herdr-agent-state.ps1')
| -rw-r--r-- | src/integration/assets/claude/herdr-agent-state.ps1 | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/integration/assets/claude/herdr-agent-state.ps1 b/src/integration/assets/claude/herdr-agent-state.ps1 index 71417e9c..dc78efd2 100644 --- a/src/integration/assets/claude/herdr-agent-state.ps1 +++ b/src/integration/assets/claude/herdr-agent-state.ps1 @@ -2,7 +2,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=claude -# HERDR_INTEGRATION_VERSION=5 +# HERDR_INTEGRATION_VERSION=6 param([string]$Action = "") @@ -24,6 +24,25 @@ if ([string]::IsNullOrWhiteSpace($sessionId)) { exit 0 } $seq = [DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds() try { - & herdr pane report-agent-session $env:HERDR_PANE_ID --source herdr:claude --agent claude --seq $seq --agent-session-id $sessionId 2>$null | Out-Null + $args = @( + "pane", + "report-agent-session", + $env:HERDR_PANE_ID, + "--source", + "herdr:claude", + "--agent", + "claude", + "--seq", + "$seq", + "--agent-session-id", + "$sessionId" + ) + if ($payload.transcript_path -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.transcript_path)) { + $args += @("--agent-session-path", "$($payload.transcript_path)") + } + if ($payload.hook_event_name -eq "SessionStart" -and $payload.source -is [string] -and -not [string]::IsNullOrWhiteSpace($payload.source)) { + $args += @("--session-start-source", "$($payload.source)") + } + & herdr @args 2>$null | Out-Null } catch { } |
