Repository navigation
Description
Description
In the Desktop app, a workspace-relative file path written as inline code in an agent's message (agent_work/.../REPORT.md) only becomes a clickable link after an existence check against the workspace file index. That check runs once, when the message block finishes rendering. The ripgrep-backed search index deliberately serves stale data for up to 10 seconds (packages/core/src/filesystem/search.ts, REFRESH_INTERVAL, background rescan introduced by #42348). So when an agent creates a file and immediately finishes with a report linking to it, the check runs inside the stale window, answers "does not exist", and the path stays plain code — until the user opens an older session from history and returns, which re-mounts the timeline and re-runs the check against the now-fresh index.
Markdown links (name) are unaffected because they never pass the existence check — they are always clickable and open fine. Absolute paths are unaffected too, because they are verified by a live parent-directory listing (/api/fs/list) instead of the index.
Measured on a real Windows project: /api/fs/find does not see a freshly created file for 0.3–9 s (typically ~9 s), while /api/fs/list of its folder shows it immediately.
Related but distinct: #65546 (ignored files never enter the index), #55863 (paths with spaces/directories are never linkified). PR #65571's exact-path-on-disk fallback would incidentally fix this case as well.
Plugins
superpowers (git), @nandoblanco/opencode-local-search@1.2.3, ru-hotkeys, search-in-session-local, session-id-copy, session-nav (bug reproduces independently of plugins: it is core path-link behavior; verified via API-level probes without touching the UI).
OpenCode version
Desktop 2.4.3 (V2, Windows x64; bundled CLI 2.4.3). Still present on dev HEAD 259e7cb (2026-11-30).
Steps to reproduce
- In any project, have the agent create a file, e.g. test-project/REPORT.md, and immediately finish with a short final message containing the relative path as inline code:
test-project/REPORT.md. - Within ~10 seconds of the file's creation, the path renders as plain inline code — not clickable, not styled as a link.
- Open any older session from history, then return to the original session: the same path is now a clickable link that opens the file in the side panel.
API-level repro without the UI (server on 127.0.0.1:):
GET /api/fs/find?query=&type=file&limit=200&location[directory]= immediately after creating the file → data: [].
Repeat for ~9 s → still empty; then it appears (the index refresh completes).
Control: GET /api/fs/list?path=&location[directory]= right after creation → the file is listed immediately.
Expected behavior
A relative path in inline code that names a file the agent just created should become an active link immediately (or within the 5 s negative-TTL window, once any re-render happens) — without reopening the session.
Actual behavior
The path stays plain inline code indefinitely. The negative answer is cached for only 5 s (LINK_EXISTS_NEGATIVE_TTL_MS in packages/gui-plugins/src/file/link-exists-machine.ts), but nothing ever re-asks: markInlineCode (packages/session-ui/src/components/markdown.tsx) checks each completed block once, and a completed message never re-renders its blocks. Opening a session from history re-mounts the timeline and re-runs the checks — by then the index is fresh, so the link "comes alive". This makes the workaround from the user's point of view: links only work after switching sessions.
Suggested fixes (any one is sufficient)
Cheapest: in checkFileLinkExists (packages/gui-plugins/src/file/resolve-link.ts), fall back to files.exists() (live parent-directory listing, already used for absolute paths) when the index search misses for a relative path. PR #65571 implements essentially this for ignored paths.
Invalidate the GUI linkExists cache on filesystem.changed events and re-run checks for already-rendered blocks.
Make FileSystemSearch.find await its pending rescan instead of returning the prior index when the entry is older than REFRESH_INTERVAL.
Screenshot
None; deterministic text repro, no visual state needed.
Operating System
Windows 10 (10.0.19044, x64)
Terminal
Not applicable (Desktop app)
Activity
opencodejr commentedon Nov 30, 2026
Thanks for the detailed report. I reproduced the server side on 2.4.3, and it still happens on the latest
dev(acf58399).With the ripgrep-backed index, which Windows uses by default:
test-project/REPORT.mdabout a second after the index was built./api/fs/listof the folder showed the file at once./api/fs/find?query=REPORT.md&type=filereturned[]for about 9.2 s before it found the file.The script below shows this.
I couldn't run the Desktop app here, so the rest is from reading the code:
On Linux and macOS in git projects, the default index has a file watcher, and the file showed up after about 0.5 s. So the long delay mostly affects Windows and folders that aren't git repositories.
Related: #65546 (ignored files never become links), with open PR #65571, and #55863.
Reproduction script (repro.sh)
Run it:
sh repro.sh