Repository navigation
🤖 fix: "Open as artifact" opens files outside the workspace checkout - #7915
Conversation
…kout File tool cards show "Open as artifact" for every path the agent read, but pinFile refuses absolute paths outside the checkout. This test pins such a file and fails with "Only files inside the workspace checkout can be pinned". --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
File tool cards show "Open as artifact" for every path the agent read, including plans, skill files and scratch files outside the checkout. The backend refused them with "Only files inside the workspace checkout can be pinned", so the button was a dead end. A pin outside the checkout is now stored by its normalized absolute path on the checkout's host (local, worktree, SSH, Docker). It is read from its own folder by the same capped readers, which still refuse a symlinked file, folders and missing files. Checkout files keep their checkout-relative pins. Dev container workspaces still refuse outside files: tool paths there name container files, and pins are read on the host. Older versions drop absolute entries when they read the store. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
… comments A drive-letter path is not absolute on a POSIX host, so it stays a checkout-relative request (refused, as before). Comments that said a pin path is always checkout-relative now say it can be absolute. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 47.1k tokens (23% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 27s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 23.5s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.8s · 2 targets (web, phone) · run artifacts |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…entry An outside pin that #7915 stored through a symlinked folder kept its alias path, and re-pinning it now produced the real path, so the file listed twice. pinFile compares absolute entries by their real form and opens the stored entry instead of adding a second one. _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Summary
"Open as artifact" now opens files outside the workspace checkout. File tool cards (
file_read,file_edit) and the command palette offered the action for every path, butartifacts.pinFilerefused any absolute path outside the checkout with "Only files inside the workspace checkout can be pinned". Plans, skill files and scratch files the agent read hit a dead button.Background
Pins were stored as checkout-relative paths and read relative to the checkout folder, so an outside path had no stored form. The limit was a storage choice, not a trust boundary: ORPC callers already run shell commands (
workspace.executeBash), and pinned HTML stays read-only (no send, setState, openWorkspace or relative asset loads).Implementation
src/node/services/pinnedArtifactFiles.ts: a pin outside the checkout is stored by its normalized absolute path on the checkout's host (local, worktree, SSH, Docker).pinTargetreads it from its own folder with the same capped readers, which still refuse missing files, folders and a symlinked file. Checkout files keep checkout-relative pins.pinned-files.json(their filter already skips invalid entries). Nothing breaks.docs/workspaces/artifacts.mdx) and comments that said a pin path is always checkout-relative are updated.Validation
error: "Only files inside the workspace checkout can be pinned". With the fix,pinnedArtifactFiles.test.tspasses 14/14 (outside pin, tool-cwd../path, live re-read, unpin, refusals of missing, folder and symlinked outside files, dev container refusal).pinFileof an absolute path under~/.mux/plugins/...returned the absolute path,listPinnedlisted it with size and mtime,readPinnedreturned its content, and a missing outside file returnedNot a readable file: /home/coder/nope.md.Risks
Low. The change is limited to pinned files behind the Artifacts experiment. Known edge cases left as is: on SSH and Docker a file whose parent folder is a symlink is refused (the runtime reader already refuses a symlinked root), a file directly under
/cannot be pinned, and one file opened through two alias paths lists as two pins that both read correctly.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$4.48