-
Notifications
You must be signed in to change notification settings - Fork 46
fix workspace bug #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix workspace bug #289
Conversation
🦋 Changeset detectedLatest commit: d639183 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
🐳 Docker Images PublishedDefault (no Python): FROM cloudflare/sandbox:0.0.0-pr-289-a50189dWith Python: FROM cloudflare/sandbox:0.0.0-pr-289-a50189d-pythonVersion: Use the |
Fixes a bug in the workspace related to sandbox functionality.
ghostwriternr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good core fix, but the tests are overly verbose and redundant. We should be able to have the same level of guards with much more minimal tests.
ghostwriternr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nits, lgtm otherwise!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude Code Review
All previous feedback has been addressed - the fallback now uses home directory and tests are comprehensive.
Critical Issue: Changeset Description
The changeset description is too vague for release notes:
fix workspace bugUsers need to understand what was fixed. Update to:
---
"@cloudflare/sandbox": patch
---
Fix session initialization failure when /workspace directory doesn't exist
Session creation now falls back to the home directory when the specified
working directory (default: /workspace) doesn't exist, preventing
"Unknown Error" failures. This resolves issues with deleted or unmounted
workspace directories.Implementation Review
The core fix is solid:
- ✅
stat()check correctly handles symlinks (follows them by default) - ✅ Fallback to home directory is appropriate for shell sessions
- ✅ Debug logging provides troubleshooting context
- ✅ Test coverage is excellent (unit + E2E)
Minor Suggestions
Documentation clarity (session.ts:49-56): The comment "This only affects where the shell starts" is misleading. The shell's cwd persists and affects subsequent commands until changed. Consider:
/**
* Initial working directory for the shell.
*
* This determines where the shell starts and becomes the default working
* directory for subsequent commands (until changed via cd). Individual
* commands can override this via exec options.
*
* If the specified directory doesn't exist when the session initializes,
* the session will fall back to the home directory.
*/Config constant (session.ts:149): Consider extracting process.env.HOME || '/root' to CONFIG for consistency with DEFAULT_CWD.
Verdict: Approve after changeset description is updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude Code Review
The fallback logic is sound and tests are comprehensive. However, three items from the previous review were marked resolved but not actually implemented:
- Changeset description still says "fix workspace bug" (too vague)
- homeDir constant not extracted to config.ts
- Missing comment about what happens if homeDir doesn't exist
Please address these before merging.
No description provided.