Skip to content

fix(frontend): drive latest-edited symlink + open nested file links in Files - #5523

Draft
ardaerzin wants to merge 1 commit into
mainfrom
fe-fix/drive-bugs
Draft

fix(frontend): drive latest-edited symlink + open nested file links in Files#5523
ardaerzin wants to merge 1 commit into
mainfrom
fe-fix/drive-bugs

Conversation

@ardaerzin

@ardaerzin ardaerzin commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Context

Two drive file-surface bugs reported after 105.8.

Changes

Added one shared isAgentFilesFold(path) predicate and applied it in the full drive and both summary lists, so the fold marker is dropped consistently.

Before: the recents fallback = the cwd top level, which includes agent-files (the symlink) → shown as a row.
After: the agent-files fold marker is filtered everywhere; recents show real files (or the record-log edits).

Anchor in the chat markdown renderer now routes a RELATIVE href through the same file resolver the inline-code path uses.

Before: [plan](03-gtm/plan.md)<a target="_blank"> (new tab).
After: a relative href that names a real drive file → the in-Files chip; a scheme: URL, //host, #fragment, or an unresolved path → the plain external link (label preserved).

Scope note for #5480 (please read before QA)

This PR removes the misleading agent-files symlink row. It does NOT change where the "latest edited files" list gets its data. That list is sourced from the session RECORD LOG (the agent's write/edit tool events), with the cwd top-level listing as a fallback when the record log is empty. The agent's durable edits live in the agent mount and only reach this list via the record log.

Consequence: if a session's record log captured no write/edit events, the list falls back to the cwd top level (now correctly WITHOUT the agent-files row) instead of showing the agent's edits, so it can look sparse or empty. That emptiness is a separate, data-dependent issue (whether the record log captured that session's writes) and is NOT addressed here. If it shows up on a real session, diagnosing it needs that session's record data to trace the record path. Flag such a session and it can be investigated as a follow-up.

Tests

  • pnpm --filter @agenta/oss exec eslint clean; tsc --noEmit reports no new errors, none in the touched files.

What to QA

  • Open the config Files section / chat Files rail on a session where the agent worked. "Latest edited" no longer shows an agent-files row.
  • In a reply that references a nested file (e.g. 03-gtm/plan.md) as a link, click it. It opens in Files (Quick Look), not a new tab, when that file exists in the drive.
  • Regression: a real external link (https://...) in a reply still opens in a new tab; a made-up relative path stays a plain link.
  • See the "Scope note for [bug] Latest edited files view shows agent-files symlink #5480" above: a sparse/empty "latest edited" list on a session with no recorded write/edit events is expected and out of scope for this PR.

Fixes #5480
Fixes #5481

…n Files

Two drive UX bugs on the chat/config file surfaces:

- The summary "latest edited files" fallback listed the cwd top level, which
  includes the `agent-files` fold SYMLINK — so it surfaced the bare symlink row
  instead of real files. The full drive already drops it; the summary didn't.
  Added one shared `isAgentFilesFold(path)` predicate, applied in the full drive
  and both summary lists so the fold marker is dropped consistently.

- File mentions in a reply only opened in Files when written as inline code; a
  markdown link `[x](path)` went straight to a new tab, so nested / `NN-name/`
  paths (which the model tends to emit as links) never reached the resolver.
  `Anchor` now routes a RELATIVE href through the same file resolver: a real
  drive file becomes the in-Files chip, and a real URL / fragment / non-file
  falls back to the plain external link.

Fixes #5480
Fixes #5481
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 26, 2026 8:50pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27dfb5fd-68fd-4396-9b3b-7e0e8acab24c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fe-fix/drive-bugs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Not all files in chat can be opened directly in the files when clicking on them [bug] Latest edited files view shows agent-files symlink

1 participant