Conversation
In a multi-repo project whose workspace root is a parent folder, agents quote paths the way git prints them, relative to the repo they ran in. The chat resolved those paths against the workspace root, so a chip like `.graft/config.json` failed with "Failed to read workspace file". The same relative path can also exist in several repos. Sessions that span more than one repo root now get a mandatory rule to write every path as an absolute path, built from a `<base directory>/<relative path>` template, with no shortened repeat mentions and a check before sending. All six adapters pass the flag. Chat chips now resolve against the repo roots, including the two fallback resolver calls, and pass the owning root to the file panel. A path with an owning root skips the workspace-wide basename lookup. The file tree maps a chat selection onto its repo key, so folder links in a non-anchor repo are revealed. Fixes LoganRupe#302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file in a repo other than the workspace root showed "<project-name> > .graft > config.json", hiding which repo it came from, and the crumb menus listed the workspace root instead of the repo. Breadcrumbs now read "<project-name> > <repo> > path", and crumbs from the repo down browse and open files within that repo. Refs LoganRupe#302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @dotrahat, this is a really nice fix, and the before/after screenshots made it easy to follow. The chip fix is exactly right: passing Two things before I merge: 1. Could we trim the multi-repo prompt block? It's about 440 words. Cursor and Antigravity append runtime instructions to every turn, and OpenCode resends them as Something closer to this would work for me:
A generic example path would be better than 2. "Reveal in file manager" has the same basename issue. One small nit, no need to block on it: the repo crumb uses the raw folder basename, while the file tree uses Thanks again for picking this up! |
|
@LoganRupe Yes, I was worried about token usage too. I reduced prompt size and it started slipping again. I'm progressively increasing and testing to see what works best while ensuring prompt does not get too big. In start of its responses, it does work fine but at the end of response sometimes it slips back to relative. Noted your concerns on scope and included in prompt. Working on it. |
The multi-repo instruction block is shorter and exempts code blocks and text meant to be pasted elsewhere. It asks for every file and directory path in inline code as an absolute path, explains why, gives one example, and lists the ways replies slipped in testing. "Reveal in file manager" skips the workspace basename lookup when a chip has an owning repo root, like opening in the panel does. Refs LoganRupe#302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two repos with the same folder name showed the same crumb. The crumb now uses the file tree's root labels, which grow by parent folders until they differ. Refs LoganRupe#302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A link to the root folder of a repo that lives outside the workspace root failed with "Failed to read workspace file". The resolver only matches paths strictly inside a root, so the root itself arrived as a host path, and the panel keeps the read error for a host folder. The panel now opens a host path that is one of the project's repo roots as a folder, and the file tree selects that repo's top-level node. Refs LoganRupe#302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A link to the workspace root itself failed with "Failed to read workspace file", in single-repo and multi-repo projects alike. It arrived as a host path, like a repo root outside the workspace root did. The panel now opens the workspace root as a folder too, and the file tree shows the whole workspace with nothing selected. Refs LoganRupe#302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@LoganRupe This is ready for another look. I've addressed all three points and pushed the changes, plus a fix for a related bug in two separate commits. 1. Prompt block. I started with your wording and a generic example path. In a multi-repo project it didn't hold up with Claude Opus 5.5:
The block is now 265 words, about 350 tokens against the ~600 before. It keeps your scope: code blocks and text meant to be pasted elsewhere are exempt, and the "MANDATORY" wording is gone. It follows Anthropic's Opus 5.5 prompting guidance: it explains why (the client opens a relative path against the workspace root), gives one example in 2. Reveal in file manager. Fixed. It now skips the basename lookup when the chip has an owning root, the same as 3. Repo crumb label. I moved 4. Related bug: links to a root folder. I tested with a
It isn't strictly #302, so if you'd rather review it separately, I'll move both commits to their own PR. Same if you'd prefer the resolver and server approach. |
LoganRupe
left a comment
There was a problem hiding this comment.
Thanks @dotrahat, this looks great. Your test notes on the prompt settled it for me: my shorter wording clearly didn't hold up, and 265 words with code blocks exempt is a fair trade. The reveal fix and the shared root labels are exactly what I was after.
The root-folder fix is a nice catch too, especially since the workspace-root case was broken in single-repo projects as well. Keeping it in this PR is fine, and the two gaps you listed can wait until someone hits them.
Approving and merging. Thanks for sticking with this one!
In a multi-repo project whose workspace root is a parent folder, chat file chips resolved repo-relative paths against the workspace root and failed to open, or opened a same-named file in another repo. - Multi-repo sessions get runtime instructions to write absolute file paths; every provider adapter passes the flag. - Chat file chips pass their owning repo root to the file panel, and skip the workspace-wide basename lookup when a root is known, for both open and reveal. - The file tree reveals files and repo roots under their repo label; breadcrumbs name the owning repo using the tree's labels. - A link to the workspace root or a repo root opens as a folder. Fixes #302
In a multi-repo project whose workspace root is a parent folder, agents quote file paths the way git prints them, relative to the repo the command ran in. The chat resolved those paths against the workspace root, so a chip like
.graft/config.jsonfailed with "Failed to read workspace file '.graft/config.json' in '/home/cvl'". The same relative path can also exist in several repos, so the client cannot pick the right one by itself. Chips with an absolute path into a repo other than the workspace root also opened the wrong place.This replaces #303, which cannot be reopened because the fork it came from was deleted.
Fix
Agent instructions. A session whose project spans more than one repo root now gets a rule to write every file and directory path in inline code as a full absolute path, each time it is mentioned, including paths copied from git or grep output. The rule explains why (the client opens a relative path against the workspace root), gives one example, and lists the ways replies slipped in testing: a path shortened on a later mention, file lists copied from git output, submodule paths or
~/name, and bare file names. Code blocks and text meant to be pasted elsewhere are exempt. The block is 265 words. Shorter versions failed in testing, as described under Testing. All six adapters pass the multi-repo flag (Claude, Codex, Cursor, Grok, OpenCode, Antigravity).Chat file chips (
ChatMarkdown.tsx).graftor a repo's top-levelREADME.mdcould open or reveal a same-named entry in another repo.Folder links (
FileBrowserPanel.tsx). The file tree keys multi-repo rows under the repo label but received only the repo-relative path, so it never found the folder to reveal. It now maps the selection onto its repo key.Breadcrumbs (
FileBreadcrumbs.tsx). A file in a repo other than the workspace root read<project-name> > .graft > config.json. It now reads<project-name> > <repo> > .graft > config.json. Crumbs from the repo down list and open files within that repo. The repo crumb uses the same label as the file tree, so two repos with the same folder name get distinct crumbs.Root folder links (
FilePreviewPanel.tsx,FileBrowserPanel.tsx). A link to the root folder of a repo outside the workspace root, or to the workspace root itself, failed with "Failed to read workspace file".resolveOwningRootonly matches paths strictly inside a root, so the root itself arrived as a host path, and the panel keeps the read error for a host folder. The panel now opens a host path that is the workspace root or one of the project's repo roots as a folder. The tree selects that repo's top-level node, or shows the whole workspace for the workspace root. Repo roots inside the workspace root already worked, because their workspace-relative path equals the tree label. The workspace-root case failed in single-repo projects too.Testing
vp test run: RuntimeInstructions, ClaudeAdapter, CodexSessionRuntime, markdown-links, ChatMarkdown, andcomponents/filestests pass.vp run -r test) passes except for 24 server failures inGitManager,GitVcsDriver, andGitVcsDriverCoretests. The same 24 fail on the base commit1d386b99a. They come from the host's git 2.34.1, not from this change..code-workspacewith one repo outside the workspace root: the pills for that repo's root folder and for the workspace root open them in the tree.git stash showstayed relative..gitignoreand submodule names.Screenshots
Before: the chip fails to read
.graft/config.jsonfrom the workspace root, and the breadcrumbs leave out the repo.After: the chip links to the absolute path, the file opens from its repo, the breadcrumbs name the repo, and the tree reveals the file.
Root folder links (video): in a four-repo
.code-workspacewith one repo outside the workspace root, the workspace-root pill and the outside repo's pill open in the tree, and files open from their own repos. Before this change, both root pills failed with "Failed to read workspace file".video-3.webm
Fixes #302
Model: Claude Opus 5.5, harness: Claude Code.