Cite a passage from a document the way assistant responses can be cited #12086
danielquintas8
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Since 0.0.41 I can select part of an assistant response and cite it, which has become the main way I steer a long turn. What I keep reaching for and cannot do is the same gesture on a document: select a passage in an open file, a markdown preview, or something the agent just wrote, and send that passage as the thing I am talking about.
Today the alternatives are to tag the whole file with
@, which drops a large file into context when I mean one paragraph, or to copy the text into the composer by hand, which loses the link back to where it came from.The interesting part is that the pieces already exist and are already used on more than one surface.
The timeline has selection to citation through
AssistantSelectionToolbaranduseAssistantCitationTarget. The terminal drawer already proves the pattern works outside the timeline: selecting output there produces a context chip carrying a terminal id and a line range, viaobserveSelectionActions. AndcodexFileCitationsalready models a file reference as a path with an optional line range, so the shape of a document citation is a shape the codebase understands.So this is less a new mechanism than joining surfaces that each already do part of it. A file preview or editor selection would produce the same kind of chip the terminal already produces, carrying path and line range instead of terminal id and line range.
This is closely related to #6295, which asks for file references that can name a range of lines. That issue approaches it from the syntax side, writing
Foo.ts:20-40and having it resolve. This is the same primitive from the other end, selecting the range directly and letting the app write the reference.Two cases where it would matter most for me. Reviewing a document the agent produced, where I want to respond to one section rather than re-describe it. And working across a repo of notes, where the file is long and the relevant part is a few lines.
All reactions