herdr-annotate icon indicating copy to clipboard operation
herdr-annotate copied to clipboard

Feature request: Make last message from currently active herdr pane from which plannotator is launched to be loaded by default

Open xRyul opened this issue 2 months ago • 8 comments

Currently one needs to press prefix+b -> shift+o and then select which message to load. But sometimes the pane from which it was pressed doesnt even appear in plannotator. It completely ignores which pane or from which tab or workspace it was launched from.

xRyul avatar Sep 04 '26 22:09 xRyul

Thanks. On a current install this follows the launching pane: I just verified it with two Claude Code sessions in the same folder, invoking from each pane, and each opened its own reply. That exact-pane behavior shipped in plannotator-tui 0.6.0 on Aug 30 with the plugin pin bumped Aug 31, and Herdr does not update installed plugins on its own.

Could you check two things?

  1. ~/.config/herdr/plugins/github/annotate-*/bin/plannotator-tui.exe --version. If it says 0.5.0 or older, reinstall the plugin.
  2. herdr integration status. If claude is missing or outdated, run herdr integration install claude, then start a new agent session. Sessions that began before the integration was installed carry no session id, and the fallback picks the newest transcript in the folder.

If you're already on 0.6.0 with the integration current and it still picks the wrong pane, tell me the agent and the output of herdr agent get <pane> and I'll dig in.

backnotprop avatar Sep 05 '26 16:09 backnotprop

I am on 0.6.0 using pi

It might have been one of the updates from pi itself that broke it. Or might be my 50+ pane setup. Since reporting the issue I have updated pi and reduced number of workspaces/panes/tabs opened, so have not encountered it anymore. I will close this as resolved. If I encounter it again I wil lreopen or open new request <3

xRyul avatar Sep 06 '26 14:09 xRyul

Running prefix + shift+o open very random messages.

It still would be great if it would simply detect last message in the active session, not just by whatever date/time messages appeared.

It is hard to find appropriate message to annotate when:

  1. navigating in history via /tree
  2. if multiple additional sessions were created and the one from which you want to annotate is old one but is still open inside herdr so you go back to the pane to launch annotation but it simply opens random message instead of message from the pane.

xRyul avatar Sep 13 '26 08:09 xRyul

Quick check first: can you paste the output of herdr integration status? Herdr's pi integration isn't installed by default, and without it Herdr can't tell us which session your pane is running, so we fall back to the newest transcript in the folder, which is the "random" pick. If pi shows "not installed", run herdr integration install pi, start a fresh pi session, and try again. If you're on Windows, update Herdr to 0.9.1 as well; it fixed pi session paths there.

/tree is a separate problem: pi keeps the branch you navigated to in memory until your next message, so anything reading the session file shows the branch you left. That needs something inside pi to report it; I'm looking at whether Plannotator's own pi extension can.

backnotprop avatar Sep 20 '26 22:09 backnotprop

Quick check first: can you paste the output of herdr integration status? Herdr's pi integration isn't installed by default, and without it Herdr can't tell us which session your pane is running, so we fall back to the newest transcript in the folder, which is the "random" pick. If pi shows "not installed", run herdr integration install pi, start a fresh pi session, and try again. If you're on Windows, update Herdr to 0.9.1 as well; it fixed pi session paths there.

/tree is a separate problem: pi keeps the branch you navigated to in memory until your next message, so anything reading the session file shows the branch you left. That needs something inside pi to report it; I'm looking at whether Plannotator's own pi extension can.

I am on 0.9.1 with pi integration isntalled: pi: current (v8) (/home/daniel/.pi/agent/extensions/herdr-agent-state.ts)

xRyul avatar Sep 21 '26 09:09 xRyul

Thanks. One test will tell us which of three things this is. With the pane focused, run these two at the same moment and paste both:

herdr agent get <pane-id>
ls -lt ~/.pi/agent/sessions/--<your-encoded-cwd>--/ | head

Then tell me how that pane's pi was started: plain pi, pi -r, pi -c, /new mid-session, or restored by Herdr after a restart. If agent_session.value names an older file than the newest in that listing, Herdr is holding a stale reference (we've found a likely cause in how it handles pi -r) and we'll take it upstream. If the field is missing, it's our fallback, which is fixed in plannotator-tui v0.9.2 (the plugin now pins it; re-run the install command). If it names the right file and the message is still wrong, it's the /tree case, which needs a change in Herdr's pi extension that I'll propose to them.

backnotprop avatar Sep 21 '26 21:09 backnotprop

Correction to my note above: in a controlled test, a normal quit-then-pi -r updates Herdr's session reference correctly. What does keep a stale reference is starting the next pi within about a second of the previous one exiting (for example chaining them in one command line). That's filed as herdrdev/herdr#4463. The /tree case is now herdrdev/herdr#4464. The two outputs I asked for above still decide which of these you're seeing.

backnotprop avatar Sep 21 '26 21:09 backnotprop

Thanks @xRyul! The launching pane's reply is matched by default since plannotator-tui 0.6.0, and annotate.last-newest (Ctrl+B Ctrl+O, #48) opens the newest reply with no picker. The remaining pi-restart case is upstream in herdrdev/herdr#4463, so closing this here.

backnotprop avatar Oct 27 '26 13:10 backnotprop