Repository navigation
Conversation
statFile tested containment on the spelled paths only, so a file a picker or a drag names /private/tmp/demo/notes.md was outside a chat whose workspace was typed as /tmp/demo (the /folder command keeps the typed spelling), and its attachment chip said outside this workspace. Keep the spelled test first and, only when it fails, resolve both sides; a change recorded under the workspace's own spelling is found too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fix: a FIFO newly reached through the resolved spelling (and one already inside the workspace by spelling) was opened to sniff its first bytes, which waits for a writer and holds files.stat or attachments.add. Only a regular file is opened now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… keys Review fixes: the binary sniff reads through skills.ReadRegularHead, which opens nonblocking and checks the descriptor, so a FIFO or device put in a file's place between the stat and the open cannot hold the request. A change recorded under the path relative to the workspace (how a tool call usually names a file) is found for either spelling of the same file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AbirAbbas
force-pushed
the
fix/app-file-stat-alias
branch
from
October 29, 2026 23:17
643f0d7 to
60325a9
Compare
Collaborator
Author
|
Closing unmerged: the Mac push stopped early to save usage. What this fixes and what is left is tracked in #2054. The branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while running the engine on macOS (Apple M4 Pro, macOS 15.6), where
/tmpand/varare links into/private.What was wrong (app mode)
statFile(cmd/codeaf/appconvo.go, behindattachments.add,agents.createsources andfiles.stat) decided "inside this workspace" by comparing spelled paths only. One folder can be spelled two ways:/folder(/workspace,/project) command sets a new chat's folder to the typed text, and the engine keeps that spelling (engineWorkspace), e.g./tmp/demoor~/code/appwhere~/codeis a link./private/tmp/demo/notes.md.So a file in the chat's own folder got the chip "outside this workspace", and its change counts were not shown.
Reproduced over the app wire on this Mac (
codeaf app, spawned as the desktop spawns it; workspace typed/tmp/e3stat-…, attachments added as the picker spells them):attachments.add12dadd64a/private/tmp/e3stat-…/notes.mdoutsideexists/tmp/e3stat-…/notes.mdexistsexistsnotes.mdexistsexists/private/tmp/e3stat-…/gone.mdoutsidemissing/etc/hostsoutsideoutsideWhat changes
appCanonical, which already handles a missing leaf), and it is inside when its resolved place is.skills.ReadRegularHead(nonblocking open, descriptor checked), so a FIFO or device in the workspace — newly reachable through the resolved spelling, and already reachable before by spelling — can no longer hold the request.agents.list's workspace filter (ListAgents) compares spellings too, but the desktop never sends a workspace toagents.list(every call inapps/desktop/src/state/engine.tsandteamStartAgents.tspassesundefined), so it is left alone.Tests
New, in
cmd/codeaf/appconvo_alias_test.goandappconvo_alias_unix_test.go(each makes its own link, so they mean the same on Linux):TestAppFileStatUsesResolvedWorkspaceContainment— both spellings,files.statand the attachment chip; missing stays missing; elsewhere stays outside.TestAppFileStatFindsAChangeRecordedUnderTheWorkspaceSpelling— absolute and relative change keys.TestAppFileStatKeepsALinkInsideTheWorkspaceInsideTestAppFileStatNeverOpensAFIFO— fails after 5 s without the regular-file opener.Gates (on the Mac)
gofmt;go vet ./cmd/codeaf(darwin, linux);CGO_ENABLED=0 go build ./cmd/codeaffor darwin/arm64, linux/amd64 and windows/amd64. (GOOS=windows go vet ./cmd/codeaffails at12dadd64atoo, onappcheckout_test.go:495'ssyscall.Mkfifo; the new FIFO test is tagged!windows.)TestAppFilesAndAttachmentsRideOnTheMessage: pass; each new test fails at12dadd64a.cmd/codeaf(-run 'Attach|Stat|Files|Submission|Reads|Media|Convo'): only the 4TestAppMediaAttach*tests fail, all already failing at12dadd64aon the Mac (TMPDIRspelling in fixtures).go test -count=1 -p 6 ./...compared by test name with the12dadd64aMac baseline: running (results will be added here).12dadd64a: PR gate 40934499950 fails exactly app/v3's 5 (commentlaw, guard, session ×2, taxonomy). Full check 40934503719: first run hit a proxy.golang.org stream error in the size job and 4 session/factory tests that fail intermittently at12dadd64atoo (reproduced locally: 1 in 30 on the base); failed jobs re-run, results will be added here.12dadd64a;git merge-treeonto the new app/v3 (1c4ec8a25, pair: merge a computer's own chats when it joins, instead of replacing them #2031) is clean and pair: merge a computer's own chats when it joins, instead of replacing them #2031 touches none of these files.Codex review (adversarial, read-only)
missinginstead ofoutside→ kept (the same file in the workspace's own spelling already reads that way; the chip grants nothing); repeated workspace resolution → kept (miss path only;files.stathas no desktop caller); law-style capitals in a comment → fixed.pr: 0.The change entry follows app/v3's convention (
docs/changes/unreleased/0-app-<slug>.md,pr: 0, as in #2014–#2016).codeaf-changes checkreports "pr is missing" for every such entry on app/v3 (249 at the base).Manual verification
Over the app wire (the table above):
codeaf appspawned exactly as the desktop spawns it,agents.createwith a typed/tmp/…workspace andattachments.addwith the paths the picker and Finder produce, against the shipped12dadd64asidecar and this branch. Not done in the real window: typing/folderand picking or dragging a file need input, and this Mac has no Accessibility or Screen Recording permission for test tooling. The desktop sends these same calls (attachments_add→attachments.add,crates/core/src/engine/mod.rs).🤖 Generated with Claude Code