Repository navigation
fix(session): keep published session paths machine-independent - #1591
huong8373tt-beep wants to merge 1 commit into
Conversation
Review was diff-only; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Thanks for picking up Slice 1 of #1579. I ran the built CLI at 7c6beb6 and at main with one Claude Code session per row of the Slice 1 table (record below). The root, monorepo, workspace child, no-repo and removed-directory rows are right, session migrate --push stores packages/api, a session with a relative cwd resumes in another directory with its turns, and an older CLI and this one each read the other's archive (session list, pull, resume), so no breaking-change handling is needed. The no-op index check also keeps a CRLF checkout clean, where main rewrites _index.json.
To fix before merge:
- [P1 blocking] A plain folder inside a non-git workspace archives as
"", notbackend.archivedCwdcallsdetectProjectConfig(cwd), whose non-git branch reads only<cwd>/.teamai, sows/backendnever findsws/.teamai. Walk up from the cwd to the workspace root, and add a test for this row. - [P1 blocking] A cwd spelled through a symlink loses its path, and macOS CI is red on it. The workspace root comes back as a real path (
sync.ts:61-64) and is compared with the cwd as given (:66), so/tmp/...on macOS gives../../…and then"". macOS Lint & Test (Node 22 and 24) fail atsession-sync.test.ts:111(expected '' to be '.') and:143. Realpath the cwd beforepath.relative, falling back when it no longer exists. - [P1 blocking] The hook commit breaks CI and is already on
main.87a8d1c5is the same patch as #1585, merged as0a8230db, but without its fixture update, sohooks-skill-retire.test.ts:75fails on Windows, Ubuntu and macOS. Rebasing ontomainand dropping it leaves this PR with no hook changes. - [P2 non-blocking] The CI review's
..cachepoint reproduces: a session inapp/..cachearchives as"".relative === '..' || relative.startsWith('..' + path.sep)fixes it. - [P2 non-blocking]
Closes #1579would close the issue with slices 2-4 undone. I'd usePart of #1579. - [P3 nit]
writeArchiveandsaveSessionLockedbecameasyncwith nothing to await (the latter's comment says it stays synchronous); and the index no-op check could live only inwriteIndex, comparing parsed entries.
Real-CLI record:
Built at 7c6beb65 (PR) and 64b031ed (baseline). Isolated HOME, empty GIT_CONFIG_GLOBAL, TEAMAI_NONINTERACTIVE=1.
teamai session push --source claude-code --session <id> --scrub -y --cwd <dir> (exit 0 for every row)
archived cwd (meta.json and _index.json) PR build baseline
app (git root) "." absolute
app/packages/api "packages/api" absolute
app/..cache "" absolute
ws/svc-a (child repo) "." absolute
ws (non-git workspace root) "." absolute
ws/backend (plain folder) "" absolute
scratch (no repo, no config) "" absolute
removed directory "" absolute
teamai session migrate m-mono -s claude-code -t claude-code --push --scrub -y exit 0, origin.cwd="packages/api"
teamai session resume claude-code_monorepo-subdir_20261027 --platform claude-code --cwd <other> exit 0, Messages: 4
Baseline reads the PR's archive: session list, session pull (9 sessions), session resume: exit 0.
PR reads the baseline's archive: session list (18 sessions), session resume: exit 0.
|
I reviewed the requested changes and prepared a focused follow-up locally. I will remove the unrelated Windows hook commit from this branch, fix the non-git child and symlink path cases, correct the |
Resolved: The earlier Review was diff-only; no PR code was run, built, or installed. |
998b7ae to
2d45872
Compare
Resolved: The unrelated Windows hook changes are absent from the current diff. The No additional confident findings in the specified diff. Review was diff-only; no PR code was run, built, or installed. |
Summary
cwdrelative to the git workspace root or configured non-git project root;meta.jsonand_index.json;..without rejecting valid descendants;Part of #1579 (Slice 1: relative archived
cwd).Validation
npx tsc --noEmit— passed;git diff --check— passed;..cachenames, and symlinked paths.Scope and compatibility
cwdis still used for local lookup and archive identity before publication.Disclosure and authorization
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.