fix(web): refresh @ file mention index on session switch and staleness#1385
Merged
fix(web): refresh @ file mention index on session switch and staleness#1385
Conversation
The file mention autocomplete index was stale after renaming workspace directories or switching sessions, requiring a full page reload. Also, files beyond the 500-file BFS limit were completely inaccessible. - Reset workspace state when sessionId changes so switching sessions triggers a fresh crawl - Add 30s TTL so re-opening @ after inactivity refreshes the index - Add debounced directory query when @ query contains "/" to find files beyond the initial 500-file crawl limit - Show truncation hint when file limit is reached Entire-Checkpoint: b43526b075f6
…query race - Reset directoryFiles state when sessionId changes to prevent stale results - Add sessionIdRef to detect session changes inside setTimeout callback - Remove unused lint suppression comments Entire-Checkpoint: 90e87d8e1a99
Prevent stale listDirectory results from overwriting directoryFiles when the user switches sessions while the request is in-flight.
…tion Use a request counter (matching the workspaceRequestRef pattern) to invalidate stale directory queries on session switch, query change, and post-await resolution.
Comment on lines
+7
to
+8
| - Web: Fix `@` file mention index not refreshing after switching sessions or when workspace files change — reset index on session switch, auto-refresh after 30s staleness, and support path-prefix search beyond the 500-file limit | ||
|
|
Contributor
There was a problem hiding this comment.
🟡 English changelog manually edited instead of auto-synced from root CHANGELOG.md
The docs/AGENTS.md rule states: "The English changelog (docs/en/release-notes/changelog.md) is auto-generated from the root CHANGELOG.md. Do not edit it manually." and "The sync script is docs/scripts/sync-changelog.mjs. ... To run manually: npm run sync (from the docs/ directory)." This PR directly edits docs/en/release-notes/changelog.md with new content at lines 7-8, violating this mandatory rule. The correct workflow is to edit CHANGELOG.md (which is done) and then run npm run sync to propagate changes, not manually mirror content into the English changelog.
Prompt for agents
Remove the manual edits to docs/en/release-notes/changelog.md. Instead, after editing the root CHANGELOG.md, run `npm run sync` from the docs/ directory to auto-generate the English changelog via the sync script at docs/scripts/sync-changelog.mjs. The file docs/en/release-notes/changelog.md should never be edited by hand per the docs/AGENTS.md rules.
Was this helpful? React with 👍 or 👎 to provide feedback.
Signed-off-by: Young E <49367723+YoungY620@users.noreply.github.com>
This was referenced Mar 12, 2026
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.
Related Issue
N/A
Description
Fix the
@file mention autocomplete index going stale after switching sessions or when workspace files change. Four changes:/), issue a targeted glob query to the backend, finding files beyond the initial 500-file limit.Checklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.