Skip to content

fix(coding-agent): report session id alongside path to herdr - #1269

Open
witt3rd wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
witt3rd:fix-1260-herdr-session-ref
Open

fix(coding-agent): report session id alongside path to herdr#1269
witt3rd wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
witt3rd:fix-1260-herdr-session-ref

Conversation

@witt3rd

@witt3rd witt3rd commented Aug 12, 2026

Copy link
Copy Markdown

Summary

The builtin herdr reporter captured the resumable session ref correctly but sent only agent_session_path when the session was persisted. Herdr's report handler accepts paths only for the pi/omp labels; for the prime-agent label it reads agent_session_id, so the ref was silently dropped and panes never became resumable (agent_session stayed null, no prime-agent --resume on herdr-server restart).

The reporter now sends both agent_session_id and agent_session_path on every report, so the session registers on current herdr (via id) and on path-accepting herdr (via path).

Fixes #1260.

Root cause notes

  • The ref itself resolves fine: daemon-created sessions are persisted via SessionManager.create, which assigns the session file at construction, before session_start fires. A socket tap on HERDR_SOCKET_PATH shows the first pane.report_agent already carrying agent_session_path. The drop happens herdr-side, in session_ref_from_report.
  • prime-agent support in herdr currently lives on a fork (witt3rd/herdr); upstream herdr has no ("herdr:pi","prime-agent") official source. The companion herdr-side fix (accept prime-agent paths, matching the snapshot/planner handling) is witt3rd/herdr@d524e4f1. This change stands alone: sending the id makes registration work regardless.

Test plan

  • New regression test packages/coding-agent/test/suite/regressions/1260-herdr-session-ref.test.ts drives the builtin extension against a real persisted SessionManager and a fake herdr socket, asserting both identity forms on the report (fails without the fix).
  • Extended test/herdr-agent-state.test.ts assertions for both forms.
  • npm run check clean.
  • Verified end-to-end on an isolated herdr session: agent start → prompt → agent_session registered → herdr-server restart → pane relaunches prime-agent --resume <ref> with session content intact.

Note

Fix herdr reporter to include session id alongside session path in reports

Previously, withSessionRef in herdr-agent-state.ts sent either agent_session_path or agent_session_id, but not both. Now both fields are included in pane.report_agent requests when available, allowing herdr to register a resumable session correctly.

Macroscope summarized dafafe8.

The builtin herdr reporter captured the resumable session ref correctly
but sent only agent_session_path when the session was persisted. Herdr's
report handler accepts paths only for the pi/omp labels; for the
prime-agent label it reads agent_session_id, so the ref was silently
dropped and panes never became resumable. Report both identity forms so
the session registers on current herdr (via id) and on path-accepting
herdr (via path).

fixes PrimeIntellect-ai#1260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coding-agent: builtin herdr reporter does not register a resumable session ref

1 participant