Skip to content

Project the OpenCode pane header from the TUI process - #2018

Merged
dmlguq456 merged 1 commit into
mainfrom
opencode-pane-header-1129
Nov 29, 2026
Merged

dmlguq456 merged 1 commit into
mainfrom
opencode-pane-header-1129

Conversation

@dmlguq456

Copy link
Copy Markdown
Owner

Why

OpenCode panes never got the [xx] opencode … header that Claude panes get. OpenCode 2 runs the Hearting server plugin inside opencode serve, so projectPane's origin proof (tui-identity/<own pid>-<start>.json, written under the TUI's pid) never matched: native-origin-unavailable, herdr_projection.py never started. The shared service's HERDR_PANE_ID is also the first TUI's pane, so fixing only the proof would still aim at the wrong pane.

What

  • hearting-tui-identity.ts (runs in the TUI, owns the selection record and its own HERDR_PANE_ID) starts tools/fleet/herdr_projection.py --harness opencode --session-id <sid> --no-report-session detached, once when the selection changes and once on session.idle of the selected session. A repeated selection starts nothing. No timer, poller, gate, setting or stored field.
  • hearting-guards.js: projectPane returns early for the OpenCode 2 host (it could never pass). V1 is unchanged.
  • herdr_projection.py: _assign_observed_tag used a relative import that fails when the file runs as a script, so the CLI sent a header without the number. It now imports fleet.session_tags absolutely. The may_report proof is unchanged and passes as is (the projector's first opencode ancestor is the TUI, and its selection record proves the session).
  • herdr-peer-prompt scenario also requires display_agent and title to read [xx] <harness>.

Verification (isolated: throwaway HOME/XDG, private herdr server, loopback fake provider)

before (origin/main) after
OpenCode pane display_agent / title none / none [44] opencode / [44] opencode
pane report-metadata calls 0 1
Claude pane [68] claude, 3 calls [57] claude, 3 calls
two TUIs on one opencode serve no header on either pane each pane shows its own session's number ([14], [99])

New tests fail on origin/main and pass here; mutations (no projection on selection change / on idle / no same-selection filter / no V2 skip) each fail a test.

What changes for users

Before After
OpenCode pane header no number or title [xx] opencode … like Claude
Several OpenCode panes on one background service none showed a header each shows its own session
Claude pane header [xx] claude … unchanged

🤖 Generated with Claude Code

OpenCode 2 runs the Hearting server plugin in `serve`, whose projectPane
origin proof looks for a TUI selection record named after the server pid,
so it always refused (native-origin-unavailable) and no header was ever
reported; the shared service's HERDR_PANE_ID is also the first TUI's pane.

The TUI identity entry, which owns the selection record and its own pane,
now starts the shared herdr_projection.py once when its selection moves
and once per session.idle of the selected session. The V2 server plugin
skips projectPane. herdr_projection's existing may_report proof is
unchanged and passes (the projector's first opencode ancestor is the TUI).

herdr_projection.py also assigned the display number through a relative
import that fails when the file runs as a script, so the CLI reported a
header without a number; it now imports fleet.session_tags absolutely.

The herdr-peer-prompt scenario now also requires the pane's display_agent
and title to read "[xx] <harness>".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dmlguq456
dmlguq456 merged commit 23893cf into main Nov 29, 2026
15 checks passed
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