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
apps/server
Steps to reproduce
- Add a project whose folder contains a project-local T3 home.
- Create a folder named nightfall.json in that home's themes directory.
- Save a notes file inside the folder.
- Use t3 theme set with a different nightfall.json theme file and point --base-dir at the project-local T3 home.
- Open a thread in that project and look for the notes file at its original path in the Files panel.
Expected behavior
The notes file still opens at its original path.
Actual behavior
Publishing reports success and replaces the folder with a theme file, so the notes can no longer be opened from their original path.
Impact
Major degradation or frequent failure. Anyone publishing from the command line loses access to the contents at their original path whenever the target theme filename matches an existing folder.
Version or commit
main at 470ca63499. The cause is at apps/server/src/cli/theme.ts:345.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
The file preview does not contain Notes for the original Nightfall palette.Automated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/cli-theme-publish-keeps-existing-directory.e2e.ts b/scripts/scenarios/cli-theme-publish-keeps-existing-directory.e2e.ts
new file mode 100644
index 0000000000..177c5d9e98
--- /dev/null
+++ b/scripts/scenarios/cli-theme-publish-keeps-existing-directory.e2e.ts
@@ -0,0 +1,50 @@
+/// <reference lib="dom" />
+import { expect } from "e2e";
+
+import { makeState, runPromise, test, WEB } from "./t3.ts";
+
+const NOTE = "userdata/themes/nightfall.json/notes.txt";
+const BODY = "Notes for the original Nightfall palette";
+
+test(
+ "Publishing a theme preserves files in an existing directory under the same name",
+ WEB,
+ async ({ t3, app, browser, screen }) => {
+ const project = await t3.project("theme-workspace", {
+ [NOTE]: BODY,
+ "nightfall.json": JSON.stringify({
+ name: "Nightfall",
+ appearance: "dark",
+ canvas: "#1a1b26",
+ accent: "#7aa2f7",
+ }),
+ });
+ const thread = await t3.thread({
+ project,
+ title: "Theme notes",
+ messages: [`See :codex-file-citation{path="${NOTE}" line_range_start="1"}`],
+ });
+ const { cli } = makeState(project);
+ await runPromise(cli(["theme", "set", `${project}/nightfall.json`], [0, 1]));
+
+ await t3.open(thread);
+ await screen.getByRole("button", /^Agent See/).tap();
+ await screen.getByRole("link", /^notes\.txt/).tap();
+
+ try {
+ await expect
+ .poll(() =>
+ browser.evaluate(() => {
+ for (const host of document.querySelectorAll("*")) {
+ const content = host.shadowRoot?.querySelector("[data-content]");
+ if (content) return content.textContent ?? "";
+ }
+ return null;
+ }),
+ )
+ .toContain(BODY);
+ } finally {
+ await app.screenshot("open-original-theme-notes");
+ }
+ },
+);pnpm scenarios:prove scripts/scenarios/cli-theme-publish-keeps-existing-directory.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity