Skip to content

fix(herdr): point herdr's native integrations at the attaching pane - #4

Merged
tak-bro merged 1 commit into
mainfrom
fix/herdr-agents
Oct 18, 2026
Merged

tak-bro merged 1 commit into
mainfrom
fix/herdr-agents

Conversation

@tak-bro

@tak-bro tak-bro commented Oct 18, 2026

Copy link
Copy Markdown
Member

무엇이 문제였나

tmux 안의 에이전트는 tmux 서버 global env 를 상속한다 — 서버를 처음 띄운 터미널의 값이라 HERDR_PANE_ID 가 이미 닫힌 herdr pane(w1Y:pM)을 가리켰다. herdr 네이티브 통합(codex·opencode·hermes·cursor·claude·pi)이 그 pane 으로 보고해 pane_not_found — cc·pi 외 래핑 에이전트는 herdr 에 들어갈 길이 없었다.

변경

  • src/wrapper.ts herdrEnvArgs: wrapper 가 만드는 모든 세션에 new-session -e HERDR_*= 7개.
    • 네이티브 통합 에이전트: attach 하는 herdr pane 값.
    • claude·pi(hwip 자체 보고 — config.ts HERDR_SELF_REPORTING_KINDS), detached, herdr 밖: 빈 값. 한 pane 에 두 source 가 보고하면 나중 label 이 이기고 한쪽 release 가 둘 다 지운다(herdr 0.9.3 측정).
    • tmux < 3.2 는 new-session -e 가 없어(tmux CHANGES) 생략, 기존 동작 그대로.
  • pi 확장(src/templates.ts): herdr 재시작(socket mtime) 뒤 같은 state 재보고. trim() 이 빈 pane 필드를 지워 socket 을 pane 으로 읽던 결함 수정. 틀린 주석("tmux does not pass HERDR_*") 정정.

검증

  • npm test 199 files / 5209 passed, npm run build ok, sync-from-plugin --check ok.
  • 새 테스트는 픽스 전 red 확인(wrapper 5건, templates 2건).
  • live: 죽은 global env(gone:pX)로 띄운 격리 tmux 서버에서 codex 세션 HERDR_PANE_ID=live:p1, claude 세션 빈 값.

한계

  • 이미 떠 있는 세션은 env 가 그대로 — 새로 만든 세션부터 적용.
  • reattach 시 실행 중 에이전트의 env 는 생성 pane 고정(네이티브 통합 한계).
  • gemini·kimi·grok 등은 herdr integration install <agent> 로 herdr 통합이 설치돼야 인식.

짝 PR: hwipit/plugin#1

🤖 Generated with Claude Code

An agent under tmux inherits the tmux server's global env, copied from
the terminal that started the server, so HERDR_PANE_ID named a herdr pane
long closed. herdr's own integrations (codex, opencode, hermes, cursor,
and the claude/pi ones) reported there and failed with pane_not_found,
which left every wrapped agent but cc and pi with no way into herdr.

Set the HERDR_* env with `new-session -e` on every session the wrapper
creates: the attaching pane for an agent herdr reports natively, empty
for claude and pi (hwip reports those itself; a second source on the pane
replaces hwip's label and its release drops both), for a detached launch
and outside herdr. tmux older than 3.2 has no `new-session -e` and gets
none, as before.

The pi extension resends an unchanged state once herdr has restarted
(its socket is newer), and no longer trims an empty pane option away,
which read the socket path as the pane.
@tak-bro
tak-bro merged commit 47b09ae into main Oct 18, 2026
4 checks passed
@tak-bro
tak-bro deleted the fix/herdr-agents branch October 18, 2026 11:44
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.

1 participant