Summary
When Herdr launches plannotator-tui in a named session, child Herdr CLI calls can target the wrong Herdr session if the process environment contains both of these values:
HERDR_SESSION=<intended-session>
HERDR_SOCKET_PATH=<another-session-socket>
Herdr resolves the target in this order:
- explicit CLI
--session <name>
HERDR_SOCKET_PATH
HERDR_SESSION
- default session socket
plannotator-tui calls HERDR_BIN_PATH directly without passing --session, so HERDR_SOCKET_PATH wins over HERDR_SESSION. In a multi-session setup, plannotator-tui herdr last and herdr last --newest can open or query the wrong Herdr session.
User-visible symptom
With two Herdr sessions running, for example:
herdr session list
# default running ...
# personal running ...
Invoking Herdr Annotate actions from personal:
annotate.last
annotate.last-newest
can behave as if they are operating against default.
The original observation was that annotate.last in the personal session appeared to select data or panes from the default session.
Minimal behavior that exposes the cause
This Herdr CLI command shows the problem:
HERDR_SESSION=personal \
HERDR_SOCKET_PATH="$HOME/.config/herdr/herdr.sock" \
herdr pane list
It routes to the socket in HERDR_SOCKET_PATH, which is usually default, not personal.
Explicit --session wins:
HERDR_SESSION=personal \
HERDR_SOCKET_PATH="$HOME/.config/herdr/herdr.sock" \
herdr --session personal pane list
That command routes to personal.
Any Herdr integrated tool that needs to preserve the named session should pass explicit --session "$HERDR_SESSION" when HERDR_SESSION is present.
Investigation findings
Herdr
Herdr gives HERDR_SOCKET_PATH higher precedence than inherited HERDR_SESSION unless the command includes explicit CLI --session.
Relevant upstream areas inspected:
src/session.rs
configure_from_args consumes explicit --session and calls apply_explicit_name.
- If
HERDR_SOCKET_PATH is present and no explicit --session was passed, Herdr clears the explicit-session flag instead of treating inherited HERDR_SESSION as explicit.
src/session.rs
Summary
When Herdr launches
plannotator-tuiin a named session, child Herdr CLI calls can target the wrong Herdr session if the process environment contains both of these values:HERDR_SESSION=<intended-session>HERDR_SOCKET_PATH=<another-session-socket>Herdr resolves the target in this order:
--session <name>HERDR_SOCKET_PATHHERDR_SESSIONplannotator-tuicallsHERDR_BIN_PATHdirectly without passing--session, soHERDR_SOCKET_PATHwins overHERDR_SESSION. In a multi-session setup,plannotator-tui herdr lastandherdr last --newestcan open or query the wrong Herdr session.User-visible symptom
With two Herdr sessions running, for example:
Invoking Herdr Annotate actions from
personal:annotate.lastannotate.last-newestcan behave as if they are operating against
default.The original observation was that
annotate.lastin thepersonalsession appeared to select data or panes from thedefaultsession.Minimal behavior that exposes the cause
This Herdr CLI command shows the problem:
HERDR_SESSION=personal \ HERDR_SOCKET_PATH="$HOME/.config/herdr/herdr.sock" \ herdr pane listIt routes to the socket in
HERDR_SOCKET_PATH, which is usuallydefault, notpersonal.Explicit
--sessionwins:HERDR_SESSION=personal \ HERDR_SOCKET_PATH="$HOME/.config/herdr/herdr.sock" \ herdr --session personal pane listThat command routes to
personal.Any Herdr integrated tool that needs to preserve the named session should pass explicit
--session "$HERDR_SESSION"whenHERDR_SESSIONis present.Investigation findings
Herdr
Herdr gives
HERDR_SOCKET_PATHhigher precedence than inheritedHERDR_SESSIONunless the command includes explicit CLI--session.Relevant upstream areas inspected:
src/session.rsconfigure_from_argsconsumes explicit--sessionand callsapply_explicit_name.HERDR_SOCKET_PATHis present and no explicit--sessionwas passed, Herdr clears the explicit-session flag instead of treating inheritedHERDR_SESSIONas explicit.src/session.rs