Repository navigation
feat(herdr): make concurrent agents distinguishable and wire session restore - #231
Merged
Merged
Conversation
Every pane in this setup runs Claude, so the sidebar's default ["agent"] row rendered one identical "claude" label per entry and left agent_panel_sort = "priority" with nothing to distinguish the entries it had just ordered. Show terminal_title_stripped instead, which carries the actual task. Also opt into reveal_hidden_cursor_for_cjk_ime, scoped to Claude panes, so the macOS IME candidate window keeps tracking the pane cursor in TUIs that paint their own. Panes running an app that hides the cursor without painting a replacement keep the default behavior. agent_panel_sort itself was chosen through the Settings TUI and never made it back to this source, so a chezmoi apply would have reverted it to "spaces". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`herdr integration install claude` adds a SessionStart hook that reports the Claude session id and transcript path over herdr's local unix socket. That report is what [session] resume_agents_on_restore needs; without it herdr restores the pane but not the conversation. Render the path through .chezmoi.homeDir rather than $HOME. herdr decides whether the hook is already wired by matching its own absolute-path spelling, so a $HOME form is not recognized and a reinstall appends a second entry that fires the hook twice per session. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two gaps surfaced while auditing
herdr --default-configagainst this repo's config and checking what the running herdr server actually reports over its API.The agent sidebar could not tell concurrent agents apart. Every pane here runs Claude, so the default row layout
[["state_icon", "workspace", "tab"], ["agent"]]printed one identical "claude" label per entry.agent_panel_sort = "priority"was already set, so herdr was ordering entries by who needs attention and then giving the reader nothing to distinguish them by. The distinguishing data was already in the API snapshot asterminal_title_stripped.Agent session restore was silently inert.
[session] resume_agents_on_restoredefaults to true and reads as enabled, but it needs an official integration to report session refs, andherdr integration statusshowedclaude: not installed. The API snapshot confirmed the consequence: no session-ref field on any of the five running agents, so a herdr server restart would have restored the panes and lost the conversations.What changed
herdr config — the Claude sidebar rows now show
terminal_title_stripped, scoped throughrows_by_agentso other agent kinds keep the default layout. Opted intoexperimental.reveal_hidden_cursor_for_cjk_imewithcjk_ime_agents = ["claude"], which keeps the macOS IME candidate window tracking the pane cursor in TUIs that paint their own cursor. Also recordedagent_panel_sort = "priority", which had been chosen through the Settings TUI and never written back, so achezmoi applywould have reverted it to thespacesdefault.Claude settings template — added the SessionStart hook that
herdr integration install claudewires up.sequenceDiagram participant CC as Claude Code participant Hook as herdr-agent-state.sh participant Srv as herdr server CC->>Hook: SessionStart (session_id, transcript_path) Hook->>Srv: pane.report_agent_session (unix socket) Note over Srv: stores session ref for restoreThe path renders through
.chezmoi.homeDir, not$HOME. herdr decides whether the hook is already wired by matching its own absolute-path spelling, so a$HOMEform goes unrecognized and a reinstall appends a second entry that fires the hook twice per session. Both forms were tested in an isolatedHOMEbefore choosing.Verification
herdr server reload-configreturns{"diagnostics":[],"status":"applied"}for the config change.statusis the signal here, notdiagnostics:herdr config checkreportsconfig: okeven for a conflicting keybinding, and empty diagnostics do not imply the config took effect.hooks.SessionStartcompares equal to whatherdr integration install claudewrote, and the existing PreToolUse hooks still hold all 8 commands.herdr integration statusnow reportsclaude: current (v7).HOMEbefore touching the real one: existing hooks are preserved, reinstall is idempotent, and top-level key order is retained.just fmt-checkandjust lint-zshpass.just lintstill fails on the pre-existing missing-luacenvironment gap, unrelated to this change.Not in this PR: the
herdr --skillagent skill was deliberately declined. It exposesherdr pane read,send-keys, andrunagainst arbitrary panes, which would let one agent drive another pane's shell and route around the PreToolUse guards this repo installs.The pre-existing key-order and
_tagdrift between~/.claude/settings.jsonand the template is left untouched; applying it would push unrelated churn through this PR.🤖 Generated with Claude Code