Require explicit Pi workspace transfers#37
Conversation
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPi now starts with an empty remote workspace, adds ChangesExplicit workspace transfer workflow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant Pi
participant CelestoComputer
participant LocalWorkspace
Developer->>Pi: run /celesto push
Pi->>LocalWorkspace: validate project root
Pi->>CelestoComputer: upload workspace
CelestoComputer-->>Pi: return revision
Pi-->>Developer: persist revision and report transfer
Developer->>Pi: run /celesto sync
Pi->>CelestoComputer: retrieve remote changes
CelestoComputer-->>LocalWorkspace: copy changes and preserve conflicts
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
pi/src/index.ts (1)
322-339: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winSilent deletion, no last word to the user.
Shutdown drops the owned computer the moment
!state.keep, no final sync, no word said about it — by design, understood. But if there's a revision on record (meaning the man's been doing real work on that remote box), deleting it without so much as a warning at exit time is asking for trouble down the line./celesto statustells him the cleanup policy if he goes looking, but nobody goes looking on their way out the door.A short notify before the delete — "unsynced changes will be lost" — costs nothing and saves someone's evening.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pi/src/index.ts` around lines 322 - 339, In the session_shutdown handler, before deleting an owned computer when !state.keep, notify the user through ctx.ui.notify that unsynced changes will be lost, then preserve the existing updateStatus, delete, error handling, and runtime cleanup flow.pi/tests/extension.test.ts (1)
16-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winGuard's tested, the push handler itself isn't.
This covers
assertSafeLocalRootin isolation nicely. But the/celesto pushcommand — the upload, the revision persisted, the skipped-file count in the notify — has no test riding on it yet. Given it's a new destructive action against the remote box, a test throughcelestoPiExtensionexercising a fake computer would be worth the ink.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pi/tests/extension.test.ts` around lines 16 - 25, The existing test only exercises assertSafeLocalRoot, so add an integration-style test through celestoPiExtension for the /celesto push command using a fake computer. Verify the handler performs the upload, persists the revision, and reports the skipped-file count in its notification while preserving the existing unsafe-root rejection behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pi/src/index.ts`:
- Around line 384-388: Update the error notification in the catch handling
around assertSafeLocalRoot to remove the misleading “Run /celesto push to retry”
guidance. Preserve errorMessage(error) and clearly direct the user to exit Pi
and restart from a valid directory, consistent with the assertion’s existing
message.
- Around line 364-393: The push path in the action === "push" branch must
protect the remote workspace from overwrites and concurrent pushes. Before
calling uploadInitialWorkspace, reject pushes when the persisted state already
has a revision, and acquire/reuse the same synchronization guard used by
performSync so only one push or sync can run at a time. Ensure the guard is
released and status cleanup still occurs on every success or failure path.
---
Nitpick comments:
In `@pi/src/index.ts`:
- Around line 322-339: In the session_shutdown handler, before deleting an owned
computer when !state.keep, notify the user through ctx.ui.notify that unsynced
changes will be lost, then preserve the existing updateStatus, delete, error
handling, and runtime cleanup flow.
In `@pi/tests/extension.test.ts`:
- Around line 16-25: The existing test only exercises assertSafeLocalRoot, so
add an integration-style test through celestoPiExtension for the /celesto push
command using a fake computer. Verify the handler performs the upload, persists
the revision, and reports the skipped-file count in its notification while
preserving the existing unsafe-root rejection behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 77437b25-d10f-4d88-be0f-801439777021
📒 Files selected for processing (4)
README.mdpi/README.mdpi/src/index.tspi/tests/extension.test.ts
Summary
/celesto pushcommand and refuse filesystem-root or home-directory pushes/celesto syncTesting
cd pi && npm run checkSummary by CodeRabbit
New Features
/celesto pushto explicitly copy a local project to the remote workspace.Updates
/celesto syncnow transfers changes only after an explicit push.keep.Documentation