Repository navigation
feat(sessions): resolve each tool's session store through locate (#1221) - #1404
Conversation
Code Erosion ReportInformational — never blocks the merge.
Scanned 480 files / 106487 SLOC · high-CC functions 838/9460 * On TypeScript, Rule hits (TS verbosity layer)Standalone
70 distinct lines flagged across |
The PR description documents sufficient testing: a representative real-CLI migration at |
|
Agreed that the two defaults differ on Windows. Nothing reads |
a443f10 to
2741a21
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
2741a21 to
e1b652a
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
e1b652a to
60f4152
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
60f4152 to
a27d1dd
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
a27d1dd to
b37754b
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
b37754b to
354649b
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
354649b to
82ec440
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
82ec440 to
aa86d3f
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
aa86d3f to
164b375
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
Each TOOLS entry now declares its session platforms, and each platform declares its store and resume command in SESSION_PLATFORM_FACTS. locate(tool, 'sessions') and the session adapters resolve the store in one place, sessionStoreDir, so a store follows the tool's recorded root or home. CodeBuddy sessions now follow a moved home (CODEBUDDY_CONFIG_DIR, or a recorded one) instead of always ~/.codebuddy.
…der the same profile home (#1221)
164b375 to
40e4480
Compare
|
No new findings in the specified PR diff.
Nothing from the PR was run, built, or installed. |
jeff-r2026
left a comment
There was a problem hiding this comment.
Verified on main 703d1c9: tsc, lint, build pass; related unit and E2E tests pass; CI green.
Summary
This PR is step F of #1221. Each tool's session store comes from its descriptor and
locate, so a moved home moves the store too.sessionStoreDirresolves atool-homestore in this order: the member's recordedtoolRootsentry, when teamai applies it, then the tool's home (recorded or env move), then the default. A recorded root is checked against HOME, asteamai initchecked it when it recorded the root. Only the default store sits underos.homedir(), which on Windows is%USERPROFILE%whatever HOME says.locatereads that home fromHost.profileHome, solocateand the adapters name the same default store. An entry teamai ignores, such astoolRoots.codebuddy, falls through to the tool's home, soCODEBUDDY_CONFIG_DIRstill moves the store. The adapters and the registry read it, and nothing else joins a store path. SoCODEBUDDY_CONFIG_DIR=/xputs CodeBuddy's sessions in/x/projects, which is where CodeBuddy 2.176.0 writes them (getHomeProjectsDir()).Tools with no adapter state what is known:
sessions'none': a known store teamai does not readsession-manager.js, OpenClaw 2026.10openclaw-state-db, Kiro and Trae docs'unknown'Two points differ from the issue text:
RELOCATABLE_TOOLSandtoolRootSegmentignore their entries, so the matrix asserts an ignored entry rather than the move the issue's check describes.ide-history.ts,cursor-store.tsand the dashboard readers stay as they are. They read IDE data directories, and no tool home moves those.The adapters' static
isAvailableandgetDefaultStoragePathhad no callers once the registry passed each adapter its store, so they are gone.Evidence
Before: on
origin/main, withCODEBUDDY_CONFIG_DIR=<sandbox>/cb-moved,teamai session migrate <id> -s claude-code -t codebuddyreportstool_unavailable, and nothing is written under<sandbox>/cb-moved/projects.After:
teamai session migrate <id> -s claude-code -t codebuddyat a443f10, withCODEBUDDY_CONFIG_DIR=<sandbox>/cb-moved:locate-sessions.test.tsruns the store matrix throughdescribeLocateMatrix. It covers the default, recorded and env homes for Claude, Codex, Cursor (a recordedcursor-dataroot moves it,cursor-configdoes not), CodeBuddy, WorkBuddy and OpenCode (XDG_DATA_HOMEmoves it,XDG_CONFIG_HOMEdoes not), plus the ignored internal-build roots, an ignoredcodebuddyentry besideCODEBUDDY_CONFIG_DIR, and thenoneandunknownrows.locate-sessions.test.tsputs a Windows default store under the profile home when HOME isD:\memberand the profile isC:\Users\member, and keeps a recordedcursor-dataroot onD:.cursor-tool-roots.test.tskeeps a recorded root whenos.homedir()is not HOME, and still puts the default store underos.homedir().session-platform-facts.test.tschecks the descriptor and the facts against each other: every listed platform has facts, everytool-homestore names the tool that lists it, and no platform is listed twice.At 9ad889d (the stack top, which carries this diff):
npx tsc --noEmit,npm run lintandnpm run buildpass, andnpx vitest runpasses 17137 tests in 576 files (21 skipped).Merge Danger
Door: two-way
Data at rest does not change. Only the directory that sessions are read from and written to moves, and only for a member whose tool home moved.
Blast Radius: sessions
For a member who set
CODEBUDDY_CONFIG_DIR,teamai sessionnow lists the sessions CodeBuddy wrote under the moved home. Sessions an earlier release migrated into~/.codebuddy/projectswhile the variable was set stay there. CodeBuddy never read them, and teamai no longer lists them.