Repository navigation
Closed
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
Not sure
Steps to reproduce
- Add a repository as a project.
- Add a subfolder containing a text file from that repository as another project on the same machine.
- Open a thread in a third project that does not contain the file.
- Click a chat file link that cites the file by filename alone.
Expected behavior
The file preview shows the cited file from the repository.
Actual behavior
The preview looks for the file in the thread's project and reports it missing.
Impact
Minor bug or occasional failure. Users who register a repository and one of its subfolders can hit this whenever a chat in another project links to a file found by both searches.
Version or commit
main at 470ca63499. The cause is at packages/client-runtime/src/workspaceBasenameLookup.ts:137.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
Handoff notes from the shared fileAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/citation-finds-file-in-overlapping-projects.e2e.ts b/scripts/scenarios/citation-finds-file-in-overlapping-projects.e2e.ts
new file mode 100644
index 0000000000..4c7495bed6
--- /dev/null
+++ b/scripts/scenarios/citation-finds-file-in-overlapping-projects.e2e.ts
@@ -0,0 +1,49 @@
+/// <reference lib="dom" />
+import { expect } from "e2e";
+
+import { T3_HOME } from "../e2e.config.ts";
+import { makeState, runPromise, test, WEB } from "./t3.ts";
+
+const FILE = "quarterly-handoff.txt";
+const CONTENT = "Handoff notes from the shared file";
+
+test(
+ "A citation finds one file listed by two overlapping projects",
+ WEB,
+ async ({ t3, app, browser, screen }) => {
+ const repository = await t3.project("reports", { [`docs/${FILE}`]: CONTENT });
+ const nested = `${repository}/docs`;
+ const project = await t3.project("planning");
+ const thread = await t3.thread({
+ project,
+ title: "Find the report",
+ messages: [`See :codex-file-citation{path="${FILE}" line_range_start="1"}`],
+ });
+ const { cli } = makeState(T3_HOME);
+ await runPromise(cli(["project", "add", nested, "--title", "Report docs"]));
+ try {
+ await t3.open(thread);
+ await screen.getByRole("button", /^Agent See/).tap();
+ await screen.getByRole("link", /^quarterly-handoff\.txt/).tap();
+
+ try {
+ await expect
+ .poll(() =>
+ browser.evaluate(() => {
+ const panel = document.querySelector("[data-right-panel-surface-content]");
+ for (const host of panel?.querySelectorAll("*") ?? []) {
+ const content = host.shadowRoot?.querySelector("[data-content]");
+ if (content) return content.textContent ?? "";
+ }
+ return panel?.textContent ?? "";
+ }),
+ )
+ .toContain(CONTENT);
+ } finally {
+ await app.screenshot("citation-in-overlapping-projects");
+ }
+ } finally {
+ await runPromise(cli(["project", "remove", nested]));
+ }
+ },
+);pnpm scenarios:prove scripts/scenarios/citation-finds-file-in-overlapping-projects.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity