Skip to content

fix(agent): focus agents by pane id - #19

Open
dmissoh wants to merge 1 commit into
thanhdat77:mainfrom
dmissoh:fix/agent-focus-pane-id
Open

fix(agent): focus agents by pane id#19
dmissoh wants to merge 1 commit into
thanhdat77:mainfrom
dmissoh:fix/agent-focus-pane-id

Conversation

@dmissoh

@dmissoh dmissoh commented Jul 27, 2026

Copy link
Copy Markdown

Fixes #18.

Agent rows never focus: FocusAgent targets terminal_id, but herdr resolves agent targets by pane_id only.

herdr agent get term_65748533b89a71  -> {"error":{"code":"agent_not_found", ...}}
herdr agent get w653fdbd6bc7b02:p2D  -> ok, same agent

terminal_id is always present in herdr agent list output, so the existing unwrap_or(pane) fallback never fires and every agent row is affected.

Change

Focus by pane_id, falling back to terminal_id if pane_id is ever absent. terminal_id stays in search_terms, so searching an agent by its terminal id still matches.

Verification

  • Repro before the patch, agent focus works after it. herdr 0.7.5, macOS arm64.
  • cargo test: 65 pass, 2 failures (close_target_matches_entry_kind, source_specific_reuse_distinguishes_same_path_workspaces) that also fail on unmodified main — both query a live herdr server.
  • cargo fmt --check clean. cargo clippy --all-targets unchanged: one pre-existing items after a test module warning in src/main.rs.

herdr resolves agent targets by pane id only; terminal ids return
agent_not_found, so every agent row failed to focus. Keep terminal_id
in search_terms.

Fixes thanhdat77#18
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.

Agent focus fails with agent_not_found: FocusAgent targets terminal_id, herdr resolves pane_id

1 participant