* refactor: remove cached-api in favor of direct fetch functions
* fix: update auto-pr test mocks for cached-api removal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: willsather <56037657+willsather@users.noreply.github.com>
Co-authored-by: willsather <will@sather.ws>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: handle expired tokens in GitHub connected accounts
* fix: use GitHub orgs API instead of memberships for org list
* fix: add debug logging for GitHub API errors in install-status
* fix: improve GitHub connected accounts UI and avatar handling
* fix: improve connected accounts loading and UI components
* style: format code for improved readability
---------
Co-authored-by: willsather <56037657+willsather@users.noreply.github.com>
* feat: add branch search with query parameter
* style: add newline at end of manifest.json
---------
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
* test: add comprehensive tests for delete message endpoint
* refactor: extract session auth checks into reusable helpers
* docs: add test:verbose script and align formatting in AGENTS.md
* style: format test file with consistent indentation
* test: add isolated test runner and update sandbox status mocks
* refactor: consolidate session auth checks into reusable helpers
* feat: extract PR generation helpers into separate module
* test: add comprehensive test coverage for PR generation helpers
* docs: remove completed API refactoring plan
* style: format function signatures and long lines
* test: refactor session API route mocks to use session-context
---------
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
* Improve React performance: parallelize fetches, dynamic imports, memoization
- Parallelize independent server-side data fetches with Promise.all in page.tsx
- Add next/dynamic for DiffViewer, CreatePRDialog, CreateRepoDialog modals
- Add optimizePackageImports for lucide-react in next.config.ts
- Memoize SessionChatContext provider value (36 properties)
- Memoize derived state (renderMessages, lastMessage, showThinkingIndicator)
- Convert sandboxUiStatus IIFE to useMemo
- Use messages.length in scroll effect dependency array
- Update audit doc to mark fixed items
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address remaining React best practices audit items
- Add loading.tsx/error.tsx for key route segments (Suspense boundaries)
- Replace hasMounted useState+useEffect with useSyncExternalStore
- Extract ChatSidebar component from monolithic SessionChatContent
- Replace direct fetch with SWR in CreateRepoDialog for cache sharing
- Convert conditional && rendering to explicit ternaries
- Remove unused react-hook-form, @hookform/resolvers, form.tsx, chat-context.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Move sidebar to session layout so it persists during chat navigation
The loading spinner was replacing the entire page (including sidebar)
when switching between chats, causing a jarring flash. By introducing a
Next.js layout at the session level, the sidebar stays mounted and only
the chat content area shows the loading state during navigation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Show session name and input shell in chat loading state
Instead of a full-page spinner, the chat loading state now preserves
the header (with real session/repo name from layout context) and an
input area shell so only the messages area shows the loading spinner.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix input height mismatch in loading skeleton and suppress overlay flash
Use a real disabled textarea in the loading skeleton so height matches
the actual input exactly. Also hide the sandbox overlay during initial
reconnection (idle state) to prevent the Resume/Create buttons from
flashing briefly on navigation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Improve web chat route responsiveness by removing fetch waterfalls, caching repeated setup work, and trimming initial session payloads.
* Improve chat UI responsiveness with memoized message grouping and smarter polling backoff.
* Improve GitHub repo fetch performance with cached installation queries
* Fix chat auto-scroll during streaming updates
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix: refresh expired GitHub OAuth tokens instead of silently failing
GitHub Apps with expiring user tokens issue tokens that expire after ~8h.
The OAuth exchange was ignoring refresh_token and expires_in from GitHub's
response, so after expiration all GitHub API calls returned 401, causing
the connector page to show a blank state.
Store refresh_token/expiresAt during OAuth exchange, and add inline token
refresh logic to getUserGitHubToken (mirroring the existing Vercel token
refresh pattern). Existing users will need to reconnect GitHub once to
pick up a refresh token.
* fix: harden GitHub token refresh against DB persistence failures
Return the refreshed token even if persisting to the database fails,
preventing a permanently broken GitHub connection when the refresh
token has already been consumed. Also add response.ok check before
parsing the refresh response body.
* Improve public repo PR flow with fork and compare fallbacks
* fix: preserve fork head owner when branch is already pushed
* fix: gate fork fallback on permission errors only
Non-permission push failures (e.g. rejected/non-fast-forward) now fall
through to informative error handling instead of triggering fork creation.
* fix: tighten permission error heuristic and use actual fork repo name
- Replace broad substring matches ('permission', '403', 'denied') in
isPermissionPushError with specific git error patterns to avoid false
positives from commit messages or ref names.
- Parse actual fork repo name from GitHub API response in ensureForkExists
instead of assuming it matches the upstream repo name, handling cases
where GitHub appends a suffix due to naming conflicts.
* fix: resolve GitHub App install redirect loop
The install flow was stuck in a circular loop because `cookies()` from
`next/headers` combined with `Response.redirect()` silently drops
Set-Cookie headers — the state cookie was never sent to the browser, so
CSRF validation always failed on the callback.
- Switch install and callback routes to `NextResponse.redirect()` with
`response.cookies.set()` to ensure cookies are in redirect responses
- Add three-path install routing: OAuth for unlinked accounts,
direct install for linked accounts without installations,
select_target picker for accounts with existing installations
- Chain OAuth callback to install flow when code arrives without
installation_id, so account linking + app install is one continuous flow
- Relax state validation to only require matching state when an OAuth
code is present (not for installation-only callbacks)
- Return GitHub user ID from OAuth exchange for install chaining
- Add externalUserId to getGitHubAccount return type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix GitHub app install flow sync gaps
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: unified GitHub App install + OAuth flow with per-org install UI
Replaces the two-step OAuth-then-install flow with a single GitHub App
installation flow that handles OAuth authorization inline (via GitHub's
'Request user authorization during installation' setting).
- Add app callback OAuth code exchange so install + account link happen
in one redirect
- Use /installations/select_target URL to always show the account/org
picker (fixes redirect to existing personal install settings)
- Add per-org install via target_id for direct org install links
- Add /api/github/orgs/install-status endpoint returning per-org
install state with GitHub IDs
- Rebuild accounts settings page with per-org status rows, install/
configure actions, request-access guidance, and post-return toasts
- Delete the separate OAuth link routes (no longer needed)
- Add sonner for toast notifications
- Update repo-selector-compact wording to 'Install to organization'
- Document GitHub App setup requirements (public app, OAuth during
install, callback URL) in .env.example and AGENTS.md
* Fix GitHub app callback auth and installation sync pagination
* Fix GitHub reconnect after disconnect skipping install page
After disconnecting GitHub, the app only revoked the OAuth token but the
GitHub App installation remained. Clicking Connect again sent users to
the install page which redirected to existing installation settings
instead of re-authorizing.
Use a github_reconnect cookie set during disconnect to route reconnects
through the OAuth authorize URL, re-linking the account and syncing
existing installations without requiring a fresh app install.
* Fix installation upsert conflict and initial repo push token
* Fix repo creation to use installation tokens and add owner picker
Use installation tokens for org repo creation (createInOrg) and user
OAuth tokens for personal accounts. Add account/org picker to the
create repo dialog so users select where to create the repository.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix repo creation push token and missing installation handling
Return an error when the requested owner has no GitHub App installation
instead of silently falling back to the user's personal account. Use
installation token for push only on org repos — personal accounts use
the OAuth token that created the repo to avoid permission gaps when the
installation has "selected repositories" access.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: migrate from tasks to sessions/chats model
Restructure the data model to support sessions containing multiple chats
that share a sandbox. This enables multi-chat workflows within a single
session context.
- Rename tasks to sessions throughout the codebase
- Add chats table with foreign key to sessions
- Update all API routes to use session/chat ownership verification
- Migrate hooks from use-tasks to use-sessions/use-session-chats
- Add new session-starter and session-list components
- Update sandbox management to work with session-based model
* style: fix formatting issues in web app
* Add token usage reporting for subagents
Display input tokens inline in task views next to tool count and duration.
Shows tokens while streaming and final count on completion.
Changes:
- Add messageMetadata callback to task tool to attach usage data
- Add token display to TUI and web task-group-view components
- Add tokens to task-renderer completion views
- Refactor web task-renderer to use proper types instead of casts
- Switch tool-call.tsx to narrow on part.type instead of derived string
- Add SubagentUIMessage type for proper typing of subagent output
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Consolidate formatTokens and improve type safety
- Move formatTokens to shared package to eliminate duplication across 4 files
- Add getToolSummary helper with proper type narrowing (replaces unsafe cast)
- Simplify IIFE patterns to ternary expressions in task renderers
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Migrate from custom blob snapshots to native Vercel snapshots
Replace the custom tarball-based snapshot system with Vercel's native
snapshot API. This simplifies the codebase and removes the @vercel/blob
dependency.
Key changes:
- snapshot() now uses native SDK method (automatically stops sandbox)
- Restoration happens at sandbox creation via source: { type: 'snapshot' }
- Added backwards compatibility for legacy blob URLs (https://)
- Removed SnapshotOptions, renamed RestoreOptions to LegacyRestoreOptions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix code review issues from snapshot migration
- Configure git user after native snapshot restoration in vercel and hybrid sandboxes
- Only render expanded input when non-empty in task-renderer
- Restore getToolSummary fallback for unknown tool types
- Remove legacy blob snapshot code (isLegacySnapshot, restoreLegacySnapshot, LegacyRestoreOptions)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Extract configureGitUser utility and remove legacy blob comments
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add sandbox snapshot reliability plan
Documents two approaches for ensuring sandboxes are snapshotted before
timeout even when clients are inactive:
- Approach A: Snapshot after every assistant response + auto-extend
- Approach B: Cron-based snapshot for sandboxes near expiration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Preserve sandbox type on stop/snapshot for correct restoration
- Add isSandboxActive() type guard and clearSandboxState() helper
- Update API routes to use isSandboxActive() for active sandbox checks
- Preserve sandbox type in sandboxState when stopping/snapshotting
- Fix snapshot restoration to not create sandbox first (was preventing
snapshot restore due to sandboxId taking precedence over snapshotId)
- Update frontend task context to preserve type on state clearing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add expiresAt tracking to sandbox state for client-side expiration checks
Store expiresAt timestamp in persisted sandbox state so the client can
immediately determine if a sandbox has expired without making a network
call. This fixes the issue where the UI shows "active" for expired
sandboxes until a network call fails.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix sandbox timeout snapshot and cleanup flow
- Add canOperateOnSandbox() to allow operations on expired sandboxes
- Make DELETE /api/sandbox idempotent (return success if already stopped)
- Fix snapshot response parsing to use snapshotId instead of downloadUrl
The client was looking for 'downloadUrl' but the API returns 'snapshotId',
causing the task's snapshotUrl to never be updated locally. This made the
UI show "Create sandbox" instead of "Resume sandbox" after timeout.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* add comment
* Fix sandbox utils type safety and snapshot restore race condition
- Add comprehensive JSDoc comments to isSandboxActive and canOperateOnSandbox
- Extract hasRuntimeState helper to reduce code duplication
- Fix clearSandboxState to use explicit switch instead of type cast
- Add null check for getState result in extend route
- Prevent snapshot restore while sandbox is running (race condition fix)
- Only pass type and snapshotId when restoring (avoid stale sandboxId)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Consolidate sandbox timeout configuration into single file
- Create apps/web/lib/sandbox/config.ts with timeout constants
- Replace hardcoded 300_000 values across web app with shared constants
- DEFAULT_SANDBOX_TIMEOUT_MS for new sandboxes
- EXTEND_TIMEOUT_DURATION_MS for timeout extensions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix sandbox timeout propagation and client display on refresh
- Add timeout option to ConnectOptions and pass through to Vercel SDK
- Pass DEFAULT_SANDBOX_TIMEOUT_MS when creating sandboxes in web app
- Return expiresAt from reconnect endpoint for accurate client display
- Calculate remaining timeout from expiresAt on reconnect (not default)
- Pass remainingTimeout when restoring from snapshot
- Display remaining seconds next to sandbox status indicator
Previously, the timeout was only sent to the client but not to the SDK,
causing sandboxes to use the SDK's 300s default. On refresh, the client
would also reset to the default instead of showing actual remaining time.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* update
* Fix timeout propagation when restoring hybrid sandbox from snapshot
Pass remainingTimeout to VercelSandbox.connect() during snapshot restoration,
matching the pattern in vercel/connect.ts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add hybrid sandbox architecture research and test scripts
- Document hybrid sandbox design for eliminating cloud sandbox startup latency
- Add test scripts validating JustBash + Vercel parallel startup approach
- Test tarball loading, handoff mechanism, serialization, and pending ops replay
- Document serialization API design decision (class-level methods on JustBashSandbox)
- Add tar dependency for GitHub tarball extraction
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add serialization API to JustBashSandbox for serverless persistence
Implement serialize() and fromSnapshot() methods to enable JustBash state
persistence across serverless request boundaries. This is a key building
block for the hybrid sandbox architecture.
Changes:
- Add serialize() instance method to export sandbox state
- Add fromSnapshot() static factory to restore from snapshot
- Export JustBashSnapshot type from @open-harness/sandbox
- Update createJustBashSandbox() return type to JustBashSandbox
- Use FsEntry type directly from just-bash library
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add JustBash persistence for serverless (Milestone 1)
- Add justBashSnapshot column to tasks table for storing serialized
JustBash state across serverless request boundaries
- Fix JustBashSandbox to use native bash.readFile/writeFile methods
instead of shell commands (preserves whitespace correctly)
- Fix fromSnapshot to restore empty directories
- Add test endpoint at /api/test/justbash-persistence to validate
persistence flow (create -> serialize -> restore -> verify)
Results: 6ms restore time, 769 bytes state size, all files persist
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add GitHub repo loading in JustBash (Milestone 2)
- Add tarball utility to download and extract GitHub repos
- Filter binary files and lock files to reduce snapshot size by 87%
- Add JustBash init endpoint (/api/sandbox/justbash)
- Add test endpoint (/api/test/justbash-repo)
- Integrate JustBash support into chat route
- Support both JustBash and Vercel sandbox modes
Milestone 2 results:
- Tarball load: 345ms (target < 500ms)
- Restore time: 2ms (target < 10ms)
- Full repo + modifications persist across requests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add JustBash web integration experiment notes
Documents the experimental changes tested to bypass Vercel sandbox
and use JustBash directly in the web app. Includes warnings that
this is not a production-ready approach.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add background Vercel startup (Milestone 3)
- Add vercelStatus, vercelStartedAt, vercelError fields to tasks schema
- Create /api/sandbox/vercel-background endpoint for background startup
- Create /api/test/hybrid-background test endpoint
- Add test script: scripts/test-milestone3.ts
Results: JustBash ready in 727ms, Vercel in 8.75s (12x speedup)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add seamless handoff from JustBash to Vercel (Milestone 4)
- Add pendingOperations and sandboxMode columns to tasks schema
- Create HybridSandbox wrapper class that tracks write operations
- Add handoff API endpoint (GET status, POST perform handoff)
- Add test endpoint and script for Milestone 4 validation
Results: All writes replay correctly (5 ops), files verified in Vercel,
git works after handoff, handoff time 2.98s (< 5s target).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add Milestone 5: Chat route integration plan
Documents the steps needed to integrate HybridSandbox into the
web chat route for seamless automatic handoff from JustBash to Vercel.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Implement hybrid sandbox for instant startup (Milestone 5)
- Modify /api/sandbox to use JustBash immediately (~300-500ms) instead of
blocking for Vercel (~10s). Vercel starts in background.
- Update /api/chat to wrap JustBash in HybridSandbox for write tracking
- Add automatic handoff: when Vercel ready, replays pending ops and switches
- Fix sandbox validation to handle hybrid placeholder IDs after handoff
- Add test endpoint and script for Milestone 5 validation
User can now start chatting immediately after task creation. Vercel
capabilities (git, npm) become available after background startup completes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Keep reconnects on Vercel-only path for now
Hybrid approach only for new tasks. Reconnects use Vercel directly
to preserve uncommitted changes. Hybrid reconnect with snapshot
restoration is a future improvement.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* add sandbox consumer abstraction desing
* Rename sandbox abstraction concepts for clarity
- getSandbox() → connectSandbox() (better conveys connection semantics)
- SandboxPayload → SandboxState (captures round-trip nature)
- JustBashState/VercelState/HybridState → *Config (these are init params)
- Flatten discriminated union (remove nested state property)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add folder restructure as prerequisite for sandbox abstraction
- Create sandbox-folder-restructure.md documenting the reorganization
of sandbox implementations from single files into self-contained folders
- Update sandbox-abstraction-design.md to reference the folder
restructure as a prerequisite and colocate state types with
their implementations (*/connect.ts pattern)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Rename state.ts to factory.ts in sandbox design docs
Factory better describes the purpose - it's a factory function that
takes config and returns the right sandbox instance.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Restructure sandbox package into self-contained folders
Reorganize sandbox implementations from single files into folders to
enable cleaner separation between sandbox classes, config types, and
future connect functions for the abstraction layer.
- Add shared types.ts with Source, FileEntry, PendingOperation
- Move LocalSandbox to local/sandbox.ts with index.ts re-export
- Move VercelSandbox to vercel/sandbox.ts with config.ts for types
- Move JustBashSandbox to just-bash/sandbox.ts with snapshot.ts
- Update package.json exports for bundler compatibility
- Use extensionless imports for Next.js Turbopack compatibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Mark sandbox folder restructure as complete in docs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update todos
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Implement unified sandbox abstraction layer
Add connectSandbox() factory function that provides a single entry point
for creating, restoring, or reconnecting to any sandbox type. The state
shape determines behavior internally.
Changes:
- Add SandboxState union type and ConnectOptions interface
- Add state types (JustBashState, VercelState, HybridState)
- Add connect functions for each implementation
- Add getState() and status to all sandbox classes
- Move HybridSandbox from apps/web to packages/sandbox/hybrid/
- Add SandboxStatus type for lifecycle tracking
The consumer API is now:
const sandbox = await connectSandbox(state, { env, gitUser, hooks });
const newState = sandbox.getState(); // round-trip ready
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update AGENTS.md: do not use .js extensions in imports
The .js extension causes module resolution issues with Next.js/Turbopack.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add technical debt note for .js extension cleanup
packages/shared still uses .js extensions in imports which can cause
issues with Next.js/Turbopack.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* update todos
* step 8 migrate web ui to unified sandbox
* Improve hybrid sandbox reconnect and handoff handling
- Simplify ReconnectResponse type and handle pre-handoff hybrid state
- Add race condition documentation and stop unused Vercel sandboxes
- Add error tracking for pending operation replay during handoff
- Fix missing sandboxInfo dependency in handleKillSandbox callback
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Mark sandbox abstraction migration steps 7-8 as complete
Web app now uses unified sandboxState API and old schema fields
have been removed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* add plans
* Implement hybrid sandbox completion plan with unified API
- Add HybridHooks interface with onCloudSandboxReady/onCloudSandboxFailed
- Add SandboxConnectConfig discriminated union for type-safe config
- Add HybridConnectOptions with registerBackgroundTask support
- Update connectHybrid to automatically start cloud sandbox in background
- Migrate web app sandbox route to use unified connectSandbox API
- Remove direct provider imports from web app (now uses abstraction)
- Export new types: HybridHooks, HybridConnectOptions, SandboxConnectConfig
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Replace registerBackgroundTask with callback-based scheduleBackgroundWork
Change the background task API from promise-based to callback-based for
framework-agnostic serverless support:
- Next.js after(): scheduleBackgroundWork: (cb) => after(cb)
- Vercel waitUntil(): scheduleBackgroundWork: (cb) => waitUntil(cb())
- Cloudflare Workers: scheduleBackgroundWork: (cb) => ctx.waitUntil(cb())
The callback approach defers execution until the runtime invokes it,
allowing each framework to control when work begins.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Always use hybrid sandbox and spin up cloud in background
- Simplify sandbox route to always use hybrid mode (remove Vercel fallback)
- Start cloud sandbox in background even without a source/repo
- Add getState() to Sandbox interface to avoid instanceof checks
- Add debug logging for background sandbox startup flow
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix null safety issues in HybridSandbox state transitions
- Fix potential null pointer dereference in `current` getter by adding
explicit null checks instead of non-null assertion
- Handle "switching" state properly in both `current` and `getState()`
- Throw descriptive error if sandbox reaches invalid state
- Ensure vercel-based state is returned during/after handoff to prevent
stale JustBash state from being persisted
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add sandbox type switcher to task input
Add a dropdown selector in the task input toolbar that allows users to
choose between hybrid, vercel, and just-bash sandbox types. The selected
type is passed via URL parameter to the task detail page where it's used
when creating the sandbox. The sandbox type is shown in the header tooltip
when hovering over the active indicator.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* add potential plan
* update sandbox labels
* Add documentation for git simulation in in-memory sandboxes
Documents the approach, architecture, and implementation details for
simulating git commands in in-memory sandboxes. Includes rationale for
why this approach is NOT appropriate for scratchpad-style sandboxes
(like JustBash) where a file browser is more suitable.
Preserved for future reference if needed for sandboxes where changes
are meant to be integrated into real codebases.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Disable diff button for in-memory sandboxes
The diff feature relies on git which isn't available in just-bash mode.
Button is now disabled with a tooltip explaining the limitation.
Also fixed the button to be disabled by default until diff data exists.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix sandbox status indicator for in-memory sandboxes
Update sandbox type in client state immediately after creation instead
of requiring a page refresh. Hide the stop/pause button for just-bash
sandboxes since they're in-memory and don't need to be stopped.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Disable timeout for in-memory sandboxes
Return timeout: null for just-bash sandboxes from the API. The client
now respects this by skipping the countdown timer and showing the
sandbox as always-active with an "in-memory" label.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Hide create repo button for in-memory sandboxes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove hybrid sandbox test files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* update lock
* Fix sandbox state persistence for all sandbox types
The chat route was only persisting state for HybridSandbox instances,
causing file modifications to be lost when using just-bash or vercel
sandbox types. Changed to check for getState method existence instead,
matching the pattern in /api/sandbox/route.ts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* do not open diff panel for just-bash
* Skip snapshot save for just-bash sandboxes
just-bash sandboxes persist state via getState() after each message,
so filesystem snapshots are unnecessary and unsupported.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix race condition in hybrid sandbox state persistence
The chat route's onFinish was overwriting the sandboxId set by
background work. Now checks if background work has already set
a sandboxId before persisting state, preventing the race condition.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Make sandbox creation work without a repository
* Add createRepository function to GitHub client
* Add create-repo API endpoint with git operations
* Add Switch component from radix-ui
* Add CreateRepoDialog component
* Support sandboxes without repos and add create repo flow
* fix: security and validation improvements for create-repo flow
- Fix command injection vulnerability in git config commands by escaping shell args
- Add explicit validation for cloneUrl/owner/repoName after repo creation
- Improve error messages to inform users when repo was created but push failed
- Sanitize taskTitle input (limit length, strip special chars) for AI prompt
- Align UI validation text with server-side rules (include periods)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update apps/web/app/api/github/create-repo/route.ts
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
* Initialize git repo in empty sandboxes for diff viewer compatibility
Empty sandboxes (no source repo) now get git init + an empty initial commit,
allowing git diff HEAD to work consistently. This fixes the diff viewer
failing with "not a git repository" for tasks created without a clone URL.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>