Skip to content

🤖 fix: "Open as artifact" opens files outside the workspace checkout - #7915

Merged
ThomasK33 merged 3 commits into
mainfrom
artifacts-pin-outside-checkout
Nov 4, 2026
Merged

ThomasK33 merged 3 commits into
mainfrom
artifacts-pin-outside-checkout

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

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, but artifacts.pinFile refused 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). pinTarget reads 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.
  • A request is classified as absolute by the location's own path rules, so a drive-letter path on a POSIX host stays a relative (refused) name.
  • Dev container workspaces refuse outside files with their own message: tool paths there name container files, while pins are read on the host.
  • Store compatibility: older versions drop absolute entries when they read pinned-files.json (their filter already skips invalid entries). Nothing breaks.
  • Docs (docs/workspaces/artifacts.mdx) and comments that said a pin path is always checkout-relative are updated.

Validation

  • The first commit adds a failing repro. On main it fails with error: "Only files inside the workspace checkout can be pinned". With the fix, pinnedArtifactFiles.test.ts passes 14/14 (outside pin, tool-cwd ../ path, live re-read, unpin, refusals of missing, folder and symlinked outside files, dev container refusal).
  • Real dev-server backend over ORPC: pinFile of an absolute path under ~/.mux/plugins/... returned the absolute path, listPinned listed it with size and mtime, readPinned returned its content, and a missing outside file returned Not 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

…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`_
@mintlify

mintlify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mux 🟢 Ready View Preview Nov 4, 2026, 12:00 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T12:09:48.027956Z 89e9b14 Manual request
🔒 Security Review ✅ Completed 2026-11-04T12:12:24.637751Z 89e9b14 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 47.1k tokens (23% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 a chat survives a restart of the server 1 step · 1 call 5.6s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.5s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.5s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 16.7s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 16.7s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 8.7s
🟢 a chat survives trips through Settings 2 steps · 1 call 8.7s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.3s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.3s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.5s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.5s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 8.9s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 8.9s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 2.9s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 2.9s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 29.4s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 4.1s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.0s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.6s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.3s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 10.4s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 3.0s

e2e 0.20.0 · 1m 27s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 7.9k tokens (22% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 9.1s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 9.1s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 6.8s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 6.8s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.3s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.3s

e2e 0.20.0 · 23.5s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.8s · 2 targets (web, phone) · run artifacts

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

Head: 89e9b14

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 89e9b14a2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 89e9b14a2e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 081a92b Nov 4, 2026
35 checks passed
@ThomasK33
ThomasK33 deleted the artifacts-pin-outside-checkout branch November 4, 2026 12:39
ThomasK33 added a commit that referenced this pull request Nov 4, 2026
…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`_

This branch was successfully deployed

1 active deployment
staging - docs — 89e9b14a Deployed Nov 4, 2026 by mintlify[bot]
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.

1 participant