Skip to content

fix(last): count replies for pick, read agy's shell markers, match windows process names - #119

Merged
backnotprop merged 1 commit into
mainfrom
fix/agy-followups
Oct 28, 2026
Merged

backnotprop merged 1 commit into
mainfrom
fix/agy-followups

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Follow-ups reported by @mfujita47 in plannotator/herdr-annotate#70 after 0.9.6.

1. n counted prompts. Every reader except Codex took the newest n messages of either role, and locate() filtered to assistant replies afterwards. So --pick 1 returned only a waiting USER_INPUT and failed with "has no assistant messages yet", and folder discovery picked a just-started conversation with only a prompt instead of the previous one. A shared through_replies helper now stops at the nth assistant reply (prompts newer than it are kept for context), and discovery requires a reply (has_reply). This applies to Antigravity, Claude Code (ladder and parser), pi / OMP / Command Code, Copilot, Droid, Hermes (dropped the SQL LIMIT, which counted prompts) and OpenCode v1/v2. Droid's selection is unchanged: it deliberately reads the newest log as is, matching Plannotator.

2. agy shell markers. detect_host selects Antigravity on ANTIGRAVITY_AGENT or ANTIGRAVITY_CONVERSATION_ID, checked right after COPILOT_CLI and before GEMINI_CLI / OMPCODE. In fallback discovery, the exported conversation id goes through the exact resolver, the same way CODEX_THREAD_ID does: an unknown id is an error and never falls back to the folder. ANTIGRAVITY_APP_DATA_DIR was already honoured (#117).

3. Windows process names. known_host and the group-leader fallback strip / or \ directories and a case-insensitive .exe suffix, for every known agent.

The Linux /proc/<pid>/fd presence-lock scan is not included. Herdr already reports the conversation id for agy panes, and in-shell runs now carry it. That leaves only Linux panes without a Herdr session id, and the scan would need agy-specific lock-file handling that we have not checked against a live agy.

Tests: regression tests for each item (antigravity, claude, command code, hermes, opencode, pi, detect, last integration, herdr launch). cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace (416 passed).

refs plannotator/herdr-annotate#70

…ndows process names

- every host reader except codex counted prompts toward `n`, so a prompt
  still waiting for its reply took the only slot of `--pick 1`, and
  discovery chose a just-started conversation with no reply over the
  previous one. `n` now counts assistant replies, and discovery requires
  one (antigravity, claude ladder, pi, omp, command code); copilot,
  droid, hermes and opencode get the same counting.
- `ANTIGRAVITY_AGENT` / `ANTIGRAVITY_CONVERSATION_ID` select the
  antigravity host, and the exported conversation id is read exactly,
  as `CODEX_THREAD_ID` is for codex.
- herdr's process fallback matches `agy.exe` and `\`-separated paths,
  for every known agent and for the reported group leader.

refs plannotator/herdr-annotate#70
@backnotprop
backnotprop added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 22ff0fb Oct 28, 2026
3 checks passed
@backnotprop
backnotprop deleted the fix/agy-followups branch October 28, 2026 02:27
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