fix: recover from invalid default workspace paths - #366
Conversation
(cherry picked from commit 789d7537a325d1c7d3aa03c387918dddd2d0897d)
PR Review: fix: recover from invalid default workspace pathsThanks for this fix! What this does
Why this mattersWithout this fix, users who have a stale or broken default workspace path would end up in a broken state where sessions inherit the unusable path. This is particularly impactful for users who have moved, deleted, or renamed their workspace directories. Code quality notes
Summary✅ Looks good to merge. The fallback behavior prevents a class of silent breakage where sessions silently carry forward an unusable workspace path. |
#366) - tests/test_default_workspace_fallback.py: 5 additional tests (dedup, RuntimeError, env var priority, mkdir on missing dir, unwritable path) - CHANGELOG.md: v0.50.18 entry; 922 tests (up from 915)
* fix: recover from bad default workspace paths (cherry picked from commit 789d7537a325d1c7d3aa03c387918dddd2d0897d) * fix: recover from invalid default workspace paths — 7 tests, CHANGELOG (#366) - tests/test_default_workspace_fallback.py: 5 additional tests (dedup, RuntimeError, env var priority, mkdir on missing dir, unwritable path) - CHANGELOG.md: v0.50.18 entry; 922 tests (up from 915) --------- Co-authored-by: Jordan SkyLF <jordan@skylinkfiber.net> Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
Merged into v0.50.18 ✅Thanks @Jordan-SkyLF — this is a clean, well-scoped fix for a real pain point. The three-function refactor ( What was added before merging:
Now live in v0.50.18. Docker users and anyone with a stale workspace path in their settings will self-heal on next server start. 🎉 |
|
Thanks @Jordan-SkyLF for the contribution! After pulling the latest master and comparing line-by-line, every change in this PR is already merged:
This was merged as part of a prior sprint that addressed the same issue (#357). Closing as superseded — thanks for the effort! |
* fix: recover from bad default workspace paths (cherry picked from commit 789d7537a325d1c7d3aa03c387918dddd2d0897d) * fix: recover from invalid default workspace paths — 7 tests, CHANGELOG (nesquena#366) - tests/test_default_workspace_fallback.py: 5 additional tests (dedup, RuntimeError, env var priority, mkdir on missing dir, unwritable path) - CHANGELOG.md: v0.50.18 entry; 922 tests (up from 915) --------- Co-authored-by: Jordan SkyLF <jordan@skylinkfiber.net> Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
* fix: recover from bad default workspace paths (cherry picked from commit 789d7537a325d1c7d3aa03c387918dddd2d0897d) * fix: recover from invalid default workspace paths — 7 tests, CHANGELOG (nesquena#366) - tests/test_default_workspace_fallback.py: 5 additional tests (dedup, RuntimeError, env var priority, mkdir on missing dir, unwritable path) - CHANGELOG.md: v0.50.18 entry; 922 tests (up from 915) --------- Co-authored-by: Jordan SkyLF <jordan@skylinkfiber.net> Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
Summary
Fix default workspace fallback so sessions do not retain a broken workspace path when the configured default is invalid or unavailable.
What this changes
api/config.pytests/test_default_workspace_fallback.pyWhy
When the default workspace cannot be used, the Web UI should recover to a safe fallback instead of carrying forward an unusable path.
Test plan
python -m pytest tests/test_default_workspace_fallback.py -q2 passed