Repository navigation
Add @ file mentions in Session Chat - #678
Merged
Merged
Conversation
Typing @ offers project files beside agents. A selected file is sent as a server file reference, kept separate from agent mentions and device attachments. Fixes #413
OPE-75 @ File Mentions
Let users insert project file references into Session Chat prompts with Shell scope:
Remaining:
Notes: |
ivanfenenko
commented
Oct 16, 2026
ivanfenenko
left a comment
Collaborator
Author
There was a problem hiding this comment.
The composer side is well put together. Mention spans, draft persistence, and the routing tests on both platforms look solid. Two problems on the send path need fixing before this ships. Details inline.
A mention-only prompt now uses the prompt body writer, so the file reference stays on the request. Project file URLs use URLEncoder.encode(String, String), which exists on API 24.
8 tasks
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.
Summary
@in Session Chat offers mentionable agents, then project files from the existing find-files search (files only, limit 50) on iOS and Android.@relative/pathas its own file mention. Agent mentions stay on their own list, and drafts keep both. Editing or deleting one span shifts the other.filepart withurl: file://…andsource: { type: "file", path, text }. v2 appends{ uri, name, mention }after device attachments, without taking an attachment slot. The server resolves the path. File contents are not inlined.@…token stays plain text. The empty overlay says "No matches". A file-search failure leaves the agent rows in place.Checks
ComposerMentionRoutingTest,MessageDomainAdapterTest,PromptJsonBodyWriterTest,DataStoreComposerDraftStoreTest, and the Session Chat view-model mention tests passed (./gradlewfromandroid/,--offline).ComposerMentionRoutingTests,MessageDomainAdapterTests,PromptJSONBodyWriterTests,ComposerDraftStoreTests, andSessionChatViewModelTestsatSuggestion_selectsProjectFileAndSendsReferenceNotAttachment/atSuggestion_selectInsertsMentionAndSendsAgentPartspassed on the iPhone 17 simulator.Issue
Fixes #413
Risks / Follow-ups
Need help on this PR? Tag
@codesmithwith what you need.