Skip to content

🤖 fix: pinned files outside the checkout store real folder paths and read at the filesystem root - #7916

Merged
ThomasK33 merged 10 commits into
mainfrom
artifacts-pin-followups
Nov 4, 2026
Merged

ThomasK33 merged 10 commits into
mainfrom
artifacts-pin-followups

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Follow-up to #7915 (pinned files outside the workspace checkout). It fixes the edge cases that the review of #7915 found: one file reached through a symlinked folder listed as two pins, SSH and Docker refused a file in a symlinked folder, a file directly under / could not be pinned, and a hand-edited drive-letter entry on a POSIX host read below the backend's working folder.

Implementation

  • pinnedArtifactFiles.ts: a pin outside the checkout stores the file name in its folder's real path. Both spellings of one file are one pin. A symlinked folder that leads into the checkout gives a checkout-relative pin. The runtime read script refuses a symlinked root folder, so storing the real folder also makes those files readable on SSH and Docker.
  • artifactRuntimeStore.ts: resolveRealDirOnRuntime resolves a folder with cd -P and pwd -P behind a magic header (login banners can come first). The read script's containment checks use ${xum_root%/}/, and its root check handles / as the folder, so a pinned file directly under / reads.
  • artifactStore.ts: the host reader's two containment checks accept / as the folder (dirPrefix).
  • A stored entry counts as absolute only by the location's own rules (isAbsoluteOn), so a hand-edited C:/x.md on a POSIX host is invalid.

Not changed, by design: a downgrade to a version before #7915 drops outside pins (the older reader filters invalid entries). Nothing breaks.

Validation

The first commit adds the repros. Before the fix they failed: the symlinked-folder pin test, the drive-letter test, and the filesystem-root read (runtime and host). With the fix, pinnedArtifactFiles.test.ts and artifactRuntimeStore.test.ts pass 46/46 locally.

Risks

Low. The runtime read script change keeps every artifacts-folder check: the artifacts name check still needs the real parent plus artifacts, and ${xum_root%/}/ equals $xum_root/ for every root except /.


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`_
…and drive-letter entries

Three failing tests from the review of #7915: a pinned read whose folder
is `/` is refused, one file reached through a symlinked folder is two
pins, and a hand-edited `C:/x.md` entry on a POSIX host is read below the
backend's working folder. Adds resolveRealDirOnRuntime, which the fix
uses, with its own test.

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…m root

Follow-up to the review of #7915:
- A pin outside the checkout stores the file name in its folder's real
  path. One file reached through a symlinked folder is now one pin, a
  symlinked folder into the checkout gives a checkout pin, and SSH and
  Docker read files in a symlinked folder (their read script refuses a
  symlinked root).
- Containment checks accept `/` as a folder (host reader and the runtime
  read script), so a file directly under `/` can be pinned.
- A stored entry is absolute only by the location's own rules, so a
  hand-edited `C:/x.md` on a POSIX host is invalid instead of a path
  below the backend's working folder.

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
# Conflicts:
#	src/node/services/pinnedArtifactFiles.test.ts
#	src/node/services/pinnedArtifactFiles.ts
@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-04T14:02:48.523236Z 0c56d1e Manual request
🔒 Security Review ✅ Completed 2026-11-04T14:04:26.708009Z 0c56d1e 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24b1532ee4

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

@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.3s
🟢 a chat survives a restart of the server 1 step · 1 call 5.3s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.2s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.2s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 9.6s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 9.6s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 8.6s
🟢 a chat survives trips through Settings 2 steps · 1 call 8.6s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.5s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.5s
🟢 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 6.8s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.8s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 7.2s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 7.2s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 31.2s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 7.1s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 7.5s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 6.1s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.5s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.8s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 3.2s

e2e 0.20.0 · 1m 23s · 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 5.4s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 5.4s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 7.5s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 7.5s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.0s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.0s

e2e 0.20.0 · 20.2s · 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

A hand-edited drive-letter entry on a POSIX host stayed in the pinned
list as a pin that never reads. listPinnedFiles now drops entries that
are neither absolute on the host nor a valid checkout-relative path.

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 9a67b4abc4

ℹ️ 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: 9a67b4abc4

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.

… checkout

End-to-end check of the runtime path: pinFile stores the folder's real
path and readPinnedFile reads it through the runtime read script. On
main's code the pin is refused.

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 348fa24ab6

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

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

Copy link
Copy Markdown
Member Author

@codex security review

Head: 0c56d1e

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 0c56d1ed56

ℹ️ 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: 0c56d1ed56

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 5347e86 Nov 4, 2026
32 of 34 checks passed
@ThomasK33
ThomasK33 deleted the artifacts-pin-followups branch November 4, 2026 14:18
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Nov 4, 2026
…#7918)

## Summary

Follow-up to coder#7916. When the user pins a new file, `findExistingPin`
looks for a stored alias of it. It resolved the folder of every stored
outside pin to do that. On an SSH or Docker checkout each resolution is
one remote command, and they ran at once: about 2N+2 commands for N
stored outside pins, which can hit an SSH server's session limit. Now it
resolves only the stored entries with the same file name (usually none),
and it logs a failed resolution at debug level instead of dropping the
error.

## Background

The independent review of coder#7916 found the cost and the silent `.catch(()
=> null)`. coder#7916 had used 5 Codex rounds, so the fix ships here instead
of as a sixth push there.

## Implementation

An outside pin stores its folder's real path plus the file name as given
(coder#7916), so an alias of the same file always has the same file name.
Filtering by name keeps every alias match and skips every other entry. A
failed resolution still means "no match", and the pin is added as a new
entry, as before.

## Validation

The first commit adds a failing test. It pins a new file on an SSH
checkout (a `LocalRuntime` stands in for the host) with three unrelated
stored outside pins, and counts the folder resolutions. Before the fix
the three stored folders were resolved. After it, none are. The alias
test from coder#7916 still passes.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$15.82`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=15.82 -->
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