Skip to content

feat: check sandbox snapshot on login, trigger setup if missing#9

Merged
sweetmantech merged 7 commits intomainfrom
sweetmantech/myc-4217-bash-onlogin-if-missing-github-snapshot-call-post-v2
Feb 12, 2026
Merged

feat: check sandbox snapshot on login, trigger setup if missing#9
sweetmantech merged 7 commits intomainfrom
sweetmantech/myc-4217-bash-onlogin-if-missing-github-snapshot-call-post-v2

Conversation

@sweetmantech
Copy link
Copy Markdown

Summary

  • Adds useSetupSandbox hook that runs once after Privy authentication
  • Checks GET /api/sandboxes for existing snapshots; if none exist, fires POST /api/sandboxes/setup in the background
  • Ensures every user has a GitHub repo + snapshot provisioned before they start using the terminal

Changes

  • New: app/hooks/useSetupSandbox.ts — client hook for background sandbox provisioning
  • Modified: app/components/TerminalPage.tsx — integrates the hook

Test plan

  • Log in with a new account → verify POST /api/sandboxes/setup is called
  • Log in with an existing account that has a sandbox → verify setup is NOT called
  • Verify no UI changes or error messages appear (silent background provisioning)
  • Verify the hook only runs once per login session (refresh should not re-trigger)

🤖 Generated with Claude Code

Adds useSetupSandbox hook that runs once after Privy authentication.
Checks GET /api/sandboxes for existing snapshots, and if none exist,
fires POST /api/sandboxes/setup in the background to provision a
GitHub repo + snapshot before the user starts using the terminal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bash Ready Ready Preview Feb 12, 2026 2:38pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 12, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-4217-bash-onlogin-if-missing-github-snapshot-call-post-v2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Matches the existing pattern in lib/recoup-api/ — uses production URL
in prod and test URL otherwise.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deduplicates the env-based URL logic from three files into a single
shared constant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These are top-level fields on the GET /api/sandboxes response, not
nested inside the sandboxes array.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sweetmantech sweetmantech merged commit 3204e62 into main Feb 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant