* feat: add ability to close pull requests with session archival
* style: format multiline elements for readability
---------
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
Add automatic branch and PR detection that runs after each agent message
completes, replacing the previous approach of only checking when the
Create PR dialog was opened. The branch name and any existing PR info
are now persisted to the session DB and reflected in the nav/sidebar.
* 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.
* 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>
* 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>