Repository navigation
fix: scope session listing and continue to the header cwd - #226
Merged
Merged
Conversation
The default session directory name is a lossy encoding of the cwd (path separators collapse to '-'), so /tmp/case/project-a and /tmp/case/project/a map to the same directory. SessionManager.list() and continueRecent() only filtered by the session header cwd when an explicit non-default sessionDir was supplied, so under a collision the current project's listing showed the other project's sessions and --continue appended to whichever file was newest, ignoring its header cwd. Both now always match the header cwd; listAll() still scans every project directory. Regression tests cover the colliding-paths scenario at the native and Step facade levels (issue #156).
Provider requests and the public getPiUserAgent() helper identified the client as `step`, while the update checker already sends `stepcode`. Use `stepcode` in both user-agent builders so the client is attributed consistently across requests.
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.
Summary
-), so/tmp/case/project-aand/tmp/case/project/amap to the same directory.SessionManager.list()andSessionManager.continueRecent()only filtered by the session headercwdwhen an explicit non-defaultsessionDirwas supplied, so under a collision the current project's listing showed the other project's sessions and--continueappended to whichever file was newest, ignoring its headercwd.cwd;listAll()still scans every project directory, and sessions without a headercwdremain reachable through the global listing paths.Testing
pnpm --filter @step-harness/coding-agent test -- test/session-manager/file-operations.test.ts test/step-session-wrapper.test.ts(regression tests fail without the fix, pass with it)test/session-manager,session-cwd,session-info-modified-timestamp,step-resume-command-compat,step-pi-storage-wrapper,step-session-file-compat,feedback-session-root,sdk-session-manager,step-sdk-wrapperapps/clisession-selector and resume-command testspnpm check)