Add default folders for new Cowork sessions - #484
Open
zhouzhuozhzh-maker wants to merge 1 commit into
Open
Conversation
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.
Problem
Folder grants are currently session-scoped, so people who use the same working directories across conversations must add them again every time. There is no account-level starting set, even though each session already owns a persisted read-only/read-write root snapshot.
Solution
Why this approach
The session root list remains the permission owner. Account defaults are copied only when a session has no persisted record; they are not a live global grant. This prevents a later Settings change from silently expanding an existing conversation. Missing configured paths stay visible in Settings but are not granted to new engines.
Code/project sessions retain their existing explicit-workspace boundary; the defaults apply to the multi-root Cowork surfaces that expose additional folders.
Verification
.venv/bin/pytest tests/test_multiroot.py tests/test_settings.py -q— 21 passed.venv/bin/pytest -q— 1174 passed, 1 skippednpm testinsurfaces/gui— 111 passednpm run e2einsurfaces/gui— 168 passednpm run buildinsurfaces/gui— production build passedgit diff --check— cleanRisk and compatibility
No persisted session or database migration is required. Older prefs without default_roots resolve to an empty list. Existing sessions retain their stored roots, and invalid or missing directories are never added to a new engine.
Screenshot
Fixes #437