feat: reference past chats with @-mentions - #12456
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Resolved since previous review
Files Reviewed (6 files in this incremental diff)
Fix these issues in Kilo Cloud Previous Review Summary (commit 3d648d7)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3d648d7)Status: 5 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (24 files)
Reviewed by claude-sonnet-5 · Input: 36 · Output: 6.8K · Cached: 909.8K Review guidance: REVIEW.md from base branch |
chrarnoldus
approved these changes
Jul 23, 2026
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
feat: reference past chats with @-mentions
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.
Closes #12420.
Problem
There was no way to point the agent at a previous conversation. When a follow-up task depends on what was discussed or built in an earlier session, the only option was to re-explain everything manually, even though the transcript already exists locally. Agent Manager already has fast session search, but neither the CLI TUI nor the VS Code extension prompt could reach it.
What changed
Typing
@in the prompt now surfaces a Past chats entry. Choosing it opens an inline picker with fuzzy search over previous sessions (same fuzzysort-based mechanism as Agent Manager session search, recency-ordered when the query is empty, scoped to the current workspace/worktree). Selecting a session inserts a highlighted@titlemention token into the prompt; clicking the token later opens that session.The mention is sent as a
filepart with asession:<id>URL and resolved server-side at prompt time: the server renders the referenced session's transcript as markdown (# Session/## User/## Assistant) and injects it as context. Resolving at prompt time means the model always gets the current transcript rather than a stale snapshot, and no core schema or SDK change was needed. Synthetic parts (snapshots, patches, etc.) are excluded by default. Resolution enforces scoping: a mention can only resolve sessions that belong to the current project or worktree family, so a mention cannot leak transcripts across projects.Transcripts are capped at ~100k characters, keeping the first third and last two thirds with an explicit omission marker, so attaching a very long chat cannot by itself blow up the context window.
The TUI implements the same flow with a dedicated dialog (
DialogSessionMention), reusing the shared transcript formatter thatrecallnow also uses.Available in the CLI TUI and the VS Code extension.