Repository navigation
feat(review): ask the agent about lines, with the answer in a box under them - #215
Open
harshavamsi wants to merge 2 commits into
Open
harshavamsi wants to merge 2 commits into
harshavamsi wants to merge 2 commits into
Conversation
…er them `a` (or the toolbar's ask button after a drag) asks the agent the review sends to about the selection or the cursor's line. The question goes the way Send goes, with the file, the lines and their code, so it is part of the agent's own conversation. The answer is read back from the agent's transcript, found as `last` finds it, on a thread, and shows as it is written in a box under the lines, whatever the Notes setting. More questions on those lines go into the same box, and the question box opens at its end. - A prompt Claude Code queued while it worked (`queued_command`) counts as a prompt. - Codex is refused: its reader has no prompts to find the question by. - `Delivery::agent_pid` names the agent's process for Rex and hc targets. - `remove` also takes Backspace, the Mac's delete key. Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
harshavamsi
marked this pull request as ready for review
November 26, 2026 17:31
…ent's own session - The question is the first prompt after the noted one that holds the question's first line and its text, so a prompt typed meanwhile, or another question still in the agent's queue, is not taken for it. - Only an exact session counts: a folder guess could show another session's answer. The Pi target names its process too. The transcript is found for each question. - An answer that ends with no text says so; a noted prompt out of reach ends the watch; a failed read is tried again. Copilot's events.jsonl is the file watched. - Send's size limit and notice apply. Choosing nothing in the picker drops the question. - `remove` keeps upstream's keys (no Backspace); `ask` yields `a` to an older config. - The README's "Pick what to review" heading is back. - ask.rs is split into boxes.rs, text.rs and watch.rs; threads are named; one card cache. Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
Author
|
AI disclosure: the code was entirely written with the help of AI agents. I, as a human, planned, tested, and reviewed the code. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

For #191.
Problem
In a code review there is no way to ask the agent a question about some lines without
sending a note. A note goes as feedback, and its answer shows only in the agent's pane, far
from the lines. #191 asks for "Ask AI in the review pane".
Change
a(ask), or the new❓ askbutton on the toolbar after a drag, opens the comment boxfor a question about the selection or the cursor's line. Enter sends it with the same
Deliverythat Send uses (its size limit and its notice too), with the file, the linesand their code. So this is "Ask this session" from Ask AI in the review pane (port from Plannotator) #191: the question and its answer are
part of the agent's own conversation.
lastfinds it(
last/transcript.rs: a small type on top oflocateand the readers, which keeps theprompts). Only the agent's own session counts (
Discovery::Exact): the newest session ina folder is a guess, and another session's answer would show as this one's, so asking
says so instead. A target that names the agent's process gives the exact session for
Claude Code, Copilot and Pi: Rex and hc have the pid, and
Delivery::agent_pidpasses it(the Pi target now has it too).
review/ask/watch.rs) that finds the transcript, notes thenewest prompt, and only then lets the question go. It then reads the transcript each
time the file grows. The question is the first prompt after the noted one that holds the
question's first line and its text, so a prompt typed into the agent meanwhile, or
another question still in the agent's queue, is not taken for it. The answer is the
replies up to the next prompt. A failed read is tried again at the next change. Nothing
is saved: the transcript is the record.
inlineinsets,Card::of_thread), whatever the Notes setting. Each message is under who wrote it:You,then the agent's host (
claude,pi, ...).aon the box asks again, and the question box opens under the box's end. If that end is
below the pane, the diff scrolls it into view first.
Deleteon the box, or on one of itslines, removes the box. The border names both keys.
queued_commandattachment.
claude/entries.rsnow reads it as a human prompt, so such a question getsits answer.
lastalso shows it now.so the question cannot be found there.
askona, inLATE, so an older config that usesakeeps loading.Not changed: Send, notes and their boxes, the data contract, and the Markdown view (where
astays "looks good").Testing
review/tests/ask_flow.rs, one test each:review/ask/watch/tests.rs: how the question and its answer are found, including a prompttyped in between and a noted prompt out of reach; Copilot's
events.jsonlis watched.plannotator-tui-hosts/tests/claude.rs: a queued prompt is a human prompt, and otherattachments are not.
keys/tests.rs: a config that gaveaaway still loads.review/tests/mouse_flow.rs: the toolbar's ask button opens the question box.cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandpython3 herdr/test-manifest.py: clean.cargo test --workspace: 1,375 passed, 1 failed. The onefailure,
pi::tests::the_review_command_puts_pis_screen_back_and_ends_the_review_with_pi,fails the same way on
mainhere: Node 26 has no--experimental-transform-types.binary: running, and this line will say the result.
questions sent while the agent was working.
Review guide
Read
review/ask.rsfirst (the flow), thenreview/ask/watch.rs(the thread and how theanswer is found,
answer),last/transcript.rs, then the box (review/ask/boxes.rs,review/ask/text.rs,inline.rs,inline/card.rs,inline/paint.rs) and where thequestion box opens (
compose_at.rs).Known limits:
by order only.
shortcut:comment says when to read only the tail). One watcher for each transcript, serving every
question, is a follow-up.
a pid, so Ask refuses them for now.