Repository navigation
fix(workspace): name a workspace by its resolved path - #1798
Open
ningmao-hlyz wants to merge 2 commits into
Open
ningmao-hlyz wants to merge 2 commits into
ningmao-hlyz wants to merge 2 commits into
Conversation
Member
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
ningmao-hlyz
added a commit
to ningmao-hlyz/CodeAF
that referenced
this pull request
Oct 9, 2026
A folder reached through a symlink became two projects, two conversation histories and two engines: engineWorkspace and /project stopped at filepath.Clean, so each spelling hashed to its own enginehost host directory and its own project row. Resolve symlinks (filepath.EvalSymlinks) at both doors where a person's path becomes a key: engineWorkspace (--daemon/--status/--stop and the host's workspace name) and runProjectCommand (the project pin). Fixes Agent-Field#1761
ningmao-hlyz
force-pushed
the
fix/1761-symlink-workspace-keys
branch
from
October 9, 2026 16:50
fd94fdf to
fa7d438
Compare
Author
done |
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.
Fixes #1761.
What changed
A folder reached through a symlink became two projects, two conversation
histories and two engines. Both doors where a person's path becomes a key now
resolve symlinks with
filepath.EvalSymlinksbefore keying:engineWorkspace(cmd/codeaf/engine.go) — the resolver every enginecommand goes through (
--daemon,--status,--stop) and the source ofthe host's workspace name. It stopped at
filepath.Clean, sosha256(Clean(...))inenginehost.whereminted one host directory perspelling:
--status <link>missed the engine started at<dir>./project(internal/tui3/projectcmd.go) — the pin stored the raw typedspelling, so home keyed the folder under the alias while a launch from the
resolved path (already canonicalized by
v3OpenTarget) keyed it under thetarget: two project rows, one folder.
Regression test:
cmd/codeaf/engine_symlink_test.godrives a symlink throughengineWorkspaceand asserts both spellings land on the same directory, andthat a plain path still resolves to itself.
Changelog entry:
docs/rules/changelog.mdnames the entry for its pullrequest, and the number exists only once the pull request does — so it
arrives in the next push as
docs/changes/unreleased/<this-pr>-symlink-workspace-keys.md(
kind: fixed,surface: [engine, workspace]). The first red oncheckis that workflow, not a mistake.
How it was checked
go build ./cmd/codeaf ./internal/tui3— exit 0 (go1.26.5).go test ./cmd/codeaf -run TestEngineWorkspace -count=1 -v— both testspass:
TestEngineWorkspaceResolvesSymlink,TestEngineWorkspaceKeepsNonSymlinkPathUnchanged(ok … 2.434s). To runthis on Windows the other
cmd/codeaftest files were moved aside for therun and put back — see the limitation below.
GOOS=linux go vet ./cmd/codeaf ./internal/tui3— exit 0, the platform CIruns, so every test file (including the added one) typechecks there.
gofmton the committed blobs — clean (engine.go,projectcmd.go,engine_symlink_test.go).8761488a: a stdlib probe mirroringenginehost.whereshowed
sha256(Clean(<link>))≠sha256(Clean(<real>))— two spellings,two host directories — and that
EvalSymlinkscollapses both spellings toone host directory.
Honest limitation:
cmd/codeaf's test package does not build on Windows atall —
carried_child_test.gousesfakeFolderProgram, which lives behind//go:build !windows; the identical failure exists at base8761488a. Sothe full suite cannot run on my Windows checkout and defers to CI on Linux
(where
GOOS=linux go vetpasses).Checklist
(the number does not exist until the pull request does; see
docs/rules/changelog.md).or refusal moved (keying fix only), so
internal/manual/chat/isunchanged.
.github/known-red.txt.cmd/codeaf/engine.go,cmd/codeaf/engine_symlink_test.go,internal/tui3/projectcmd.go.