20 Commits

Author SHA1 Message Date
Will Sather
cee13abfaa
feat: replace manual oauth with better-auth (#820)
* feat: replace manual oauth with better-auth

* fix: lint

* chore: refactor accounts to unify github + vercel

* feat: enhance auth config with host allowlisting

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* fix: add newline at end of manifest.json

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* fix: update betterAuth database schema mappings

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* fix: sanitize redirects and preserve destination in github flow

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* feat: enhance GitHub app callback with installation sync tracking

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* build: add BETTER_AUTH_SECRET to turbo env

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

* refactor: update sign-in callback to skip onboarding

Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
Co-authored-by: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
2026-04-20 15:40:13 +01:00
open-agents-bot[bot]
a54a012c57
feat: add diff stats to merge readiness (#665)
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-04-10 11:13:44 +00:00
nicoalbanese
9634c36ae7 test: add github client merge readiness tests 2026-04-09 15:36:39 +00:00
willsather
e9979f5b42 feat: add PR title and body to merge readiness response 2026-04-08 16:36:30 +00:00
willsather
acecb6f8a3 feat: add check logs API and improve merge dialog error display 2026-04-07 15:20:12 +00:00
willsather
8b4039d8a7 feat: improve merge dialog check failure handling 2026-04-07 15:20:12 +00:00
openharness[bot]
ff194dfe5e
feat: implement auto-merge PR creation with improved error handling (#607)
* test: add comprehensive PR route tests

* refactor: improve auto-merge with nodeId and error handling

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-04-05 11:03:53 +00:00
openharness[bot]
733b35d532
feat: display required status checks in merge dialog (#586)
* feat: display check run status in merge dialog

* feat: fetch required checks from branch protection

* style: improve formatting in merge-pr-dialog

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-04-03 13:06:02 +01:00
openharness[bot]
81c2655352
fix: handle Vercel 404/403 errors gracefully in sandbox lifecycle management (#529)
* fix: handle 403/404 gracefully and prevent duplicate lifecycle kicks

* fix: handle 404 errors as graceful shutdown in reconnect logic

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-20 18:17:22 +00:00
openharness[bot]
4ad3769545
feat: add polling for pull request mergeability (#497)
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-19 18:41:31 +00:00
openharness[bot]
477ca47edf
feat: add ability to close pull requests with session archival (#488)
* 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>
2026-03-19 16:28:04 +00:00
openharness[bot]
f64e06b204
feat: add draft pull request creation support (#400)
* feat: add draft pull request creation support

* feat: replace draft toggle with dropdown PR creation mode selector

* style: format code and update bun-types

---------

Co-authored-by: willsather <56037657+willsather@users.noreply.github.com>
Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-19 06:55:15 -07:00
openharness[bot]
39189d7b6d
feat: add PR merge button with readiness validation for sessions (#387)
* feat: add merge readiness API endpoint for sessions

* test: add validation for invalid JSON and null head owner cases

* feat: add check run details to merge readiness dialog

* feat: add PR refresh and open buttons to merge dialog

* refactor: remove merge & archive button from session chat

* refactor: extract toDateStr helper function

* refactor: simplify conditional logic and remove redundant code

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
2026-03-08 18:07:22 +00:00
openharness[bot]
7570722280
feat: display Vercel deployment URL in navbar for sessions (#330)
* feat: add Vercel deployment URL display in navbar

* fix: change deployment button text from "View Deployment" to "Preview"

* Update apps/web/lib/github/client.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* feat: refresh diff cache in background after chat response (#327)

* feat: refresh diff cache in background after chat response

* refactor: wrap diff cache update with Next.js after() API

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>

* feat: disable git buttons while sandbox is spinning up (#328)

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>

* docs: increase sandbox inactivity timeout from 20 to 30 min (#329)

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>

* Na/d572fa41 (#331)

* feat: disable git buttons while sandbox is spinning up

* fix: remove git button disabled state check

* style: format pr deployment route

* feat: extract Vercel deployment URL from metadata

---------

Co-authored-by: nicoalbanese <49612682+nicoalbanese@users.noreply.github.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: openharness[bot] <260704009+openharness[bot]@users.noreply.github.com>
2026-03-02 16:05:48 +00:00
Nico Albanese
4dacdf9b3b
feat: detect existing PRs and persist branch info after message completion (#263)
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.
2026-02-23 11:56:09 +01:00
Nico Albanese
68e5f53a34
Fix PR generation fork fallback and permission error detection (#187)
* 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.
2026-02-18 12:40:18 +01:00
Nico Albanese
a6177acd41
feat: unified GitHub App install + OAuth flow with per-org install UI (#165)
* 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>
2026-02-10 20:43:44 +01:00
Nico Albanese
1b69da92e7
Add GitHub repository creation feature for tasks (#67)
* 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>
2026-01-12 16:26:59 +00:00
Nico Albanese
6b58d6808a
Add task management and PR creation features (#64)
* init scaffold

* add archive functionality

* update

* remove focus change

* update homepage styles

* add new branch button

* add persistence

* add create pr button

* fix critical errors

cc

* cc critical fixes

* critical fixes

* add diff viewer plan

* more critical fixes

* cc critical fixes

* Guard initial task message without sandbox

Prevents chat requests when tasks lack cloneUrl or sandboxId.

* fix: enforce task sandbox ownership

* chore: update todos

* fix: sync PR branch with sandbox

* Add helper functions for branch management

* Create git-status API endpoint

* Add branch status detection to create PR dialog

* Add commitOnly parameter to generate-pr API

* Convert PR dialog to multi-step wizard UI

* Add readFile tool visibility task to todos

* Add OctokitResult type for auth status
2026-01-12 11:47:59 +00:00
Nico Albanese
0d28d0105a
Add GitHub authentication and repository management (#63)
* Add GitHub OAuth authentication routes

* Add GitHub API endpoints for repos and user data

* Add session and crypto utilities

* Add database schema and client setup

* Add database migrations

* Add GitHub utility functions and client

* Add authentication components and hooks

* Add repo info to chat context

* Add GitHub token to sandbox API

* Pass GitHub token to chat sandbox

* Integrate repo selection and display in chat

* Add dependencies for auth and database

* Add branch selector API endpoint

* Create branch selector component

* Add UI component library base components

* Add cmdk and popover dependencies

* Replace input field with branch selector component

* update repo selector to be combo box

* fix scroll gutter bg

* update branch selector component width

* remove storage and update todos

* fix cc comments

* add caching

* cc fixes
2026-01-11 18:32:06 +00:00