* feat(github): configurable quick-action presets and PR branch checkout
- Add workspace-scoped action presets (icon, label, hint, prompt template) for PRs and Issues, editable from GitHub settings with reset-to-defaults.
- When starting a task from a PR, check out the PR head branch directly in the worktree instead of branching off main.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(github): extract action-preset service to keep service.go under line limit
Splits the preset CRUD methods out of the oversized service.go and applies prettier formatting to three frontend files flagged by CI.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(github): address review feedback on action presets
- Prevent infinite refetch loop when fetching presets fails by tracking attempted workspaces in a ref instead of re-entering the effect on every loading-state change.
- Drop unused savePR/saveIssue helpers from the hook; only save() is consumed.
- Reorder the init spread in updateGitHubActionPresets/resetGitHubActionPresets so callers can't accidentally overwrite method/body.
- Tighten the GitHubActionPreset.icon type with string & {} so known icon keys keep autocomplete.
- Sharpen the eye-icon test to assert the exact IconEye mapping.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(github): address second round of review feedback
- Seed preset editor drafts from current store state via lazy initializers so a warm mount shows the user's saved customisations instead of silently reverting to defaults when Save is clicked.
- Guard Reset button with its own in-flight state to prevent double-firing.
- Stop freezing resolved defaults into the stored row on a partial update; persist only what the store has for the untouched kind so future default improvements still reach those workspaces.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor(github): tighten quick-actions editor UI
Replace the stacked PR/Issue editors and multi-line preset cards with a tabbed layout and single-line rows. Each row shows icon · label · hint inline; an "Edit prompt" toggle reveals the template textarea only when needed. Drops the redundant section headings, up/down reorder buttons, and verbose template helper label (hint moved into the textarea placeholder).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(github): widen icon select trigger so the icon is visible
The icon select trigger had a fixed 40px width which the SelectTrigger's built-in chevron, padding, and icon gap all competed for, clipping the icon out of view. Drop the width override so the trigger sizes to its content.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* feat(github): add /github page for PRs and issues
Dedicated page under /github lists pull requests and issues across the
authenticated user's repos with preset filters, custom GitHub search
queries, per-repo narrowing, saved queries, and one-click task launching
for any PR or issue.
Performance:
- Cache user PR/issue search responses for 30s with singleflight to
coalesce concurrent misses, so preset switching and pagination avoid
upstream round trips.
- Replace the per-row PR status fetch (N+1) with a batch endpoint
POST /api/v1/github/prs/statuses that fans out concurrently on the
backend with a semaphore and caches per-PR.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* style: apply Prettier formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address review feedback on PR cache + status batching
- Harden searchCacheKey against separator collisions from
user-controllable customQuery (length-prefix encoding).
- Drop repositories.loaded hydration when inner workspace fetch fails
so the client refetches instead of trusting a partial snapshot.
- Guard useGitHubSearch with a monotonic request counter to drop
stale responses when filter+page changes overlap.
- Fix usePRStatuses teardown: depend only on composed key so a new
array identity per render doesn't cancel the in-flight batch.
- Correct godocs (duplicate, outdated state:open claim).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address additional review feedback
- Restore state:open for issue watcher: buildIssueSearchQuery no
longer injects it as a default, so existing watches were starting
to surface closed issues. Inject state:open in buildIssueFilter so
only the watcher path is affected; the /github page presets already
set their own state qualifiers.
- countCheckResults now excludes in-progress checks from the denominator
so a `1/3` badge reflects pass rate on completed checks, not a mix of
running and failed. The pending state is still carried via ChecksState.
- usePRStatuses retries after a transient fetch error (only mark the
key as completed once the fetch resolves). This also fixes missing
badges under React Strict Mode's intentional double-mount, since the
first effect's cleanup fires before the response lands and the guard
stays unset for the second mount to retry.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(github): add tests for my-github hooks
Covers use-committed-query, buildParams from use-github-search,
use-saved-presets readStorage validation, use-known-repos recordForKey
accumulator semantics, and use-pr-statuses batch fetch lifecycle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address review feedback on search cache and repo accumulator
- Clamp perPage before composing the search cache key so identical
pages (e.g. perPage=150 and =100) share a cache entry instead of
creating duplicates keyed on the raw value.
- Add resetKnownReposStore and call it on /github unmount so the
module-level repo accumulator doesn't carry across navigations.
- Rename use-pr-statuses test to match its assertion (it verifies
stale statuses are cleared when the key changes and fetch fails).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* style: apply Prettier formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(web): distinguish blocked from dirty in PR mergeable badge
GitHub's blocked state (required reviews/checks/branch protection)
is not a merge conflict, so don't label it "Conflicts". Surface it
as "Blocked" with the pending tone; keep "Conflicts" for dirty.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: address remaining /github code review comments
- Route PR status + batch through handleSearchError so ErrNoClient
surfaces as 503 instead of 500 (matches the search endpoints).
- Sort workflow steps by position in the quick-task-launcher default
pick, matching the convention in issue-watch-dialog.
- Make PresetItem keyboard-accessible: role=button, tabIndex, and
Enter/Space handling on the wrapping div (it contains a nested
delete button, so it can't itself be a button).
- Extract useRepoOptions out of useGitHubPageState to bring the hook
back under the 100-line complexity limit.
- Honor ctx.Done() when acquiring the PR-status batch semaphore so a
cancelled HTTP request releases queued goroutines instead of
running each upstream fetch to completion.
- Clarify parsePaginationQuery doc: the upper bound (100) is enforced
by clampSearchPage in the client layer, not here.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(web): address /github review follow-ups
- Merge duplicate @/lib/utils imports in pr-list.
- Use rel="noopener noreferrer" on external PR/issue links (codebase
convention) and add cursor-pointer per the UI guidelines.
- Rewrite onOpenSaveDialog as an explicit if-block so the callback
returns void rather than boolean | void.
- Use PaginationEllipsis in its own PaginationItem so the ellipsis
and the adjacent page link are separate list items instead of
visually fused into a single cell.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor(web): derive QuickTaskLauncher dialog state from props
Replaces the useEffect+setState anti-pattern with useMemo-derived state
driven directly by the payload prop. Drops the eslint suppression that
was needed for react-hooks/set-state-in-effect.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(backend): accept github_url in task creation and clone on launch
Add github_url field to task creation DTO and propagate through HTTP/WS
handlers and service layer. When a task is created with a GitHub URL
instead of a local repository, the service resolves (or creates) the
repository record via FindOrCreateRepository and triggers a clone/fetch
via repoclone.Cloner during executor pre-flight.
Wire RepoCloner into the orchestrator executor so remote repositories
are fetched before the agent process starts. On resume, RepoUpdater
performs a fetch to ensure the worktree is up-to-date.
* feat(backend): add GitHub branches endpoint for remote repos
Add ListRepoBranches to the GitHub client interface (GHClient,
PATClient, NoopClient, MockClient) and expose it via
GET /api/v1/github/repos/:owner/:repo/branches.
The mock controller gains POST /api/v1/github/mock/branches for
seeding branch data in E2E tests.
* feat(web): add GitHub URL input to task create dialog
Add a toggle in the task create dialog that switches between the
existing repository selector and a free-text GitHub URL input. When a
valid GitHub URL is entered (owner/repo parsed), branches are fetched
from the new backend endpoint and auto-selected.
The dialog state, effects, validation, and submit logic are extended to
support the github_url flow alongside the existing repository flow.
* test(e2e): add tests for task creation from GitHub URL
Add E2E tests verifying:
- Full flow: toggle to GitHub URL mode, enter URL, create task, verify
agent runs and completes in session view
- Toggle behavior: switching between GitHub URL and repository selector
modes updates UI correctly
* fix(web): dynamic URL input sizing and extract RepoSourceInput
Replace fixed-width GitHub URL input with size-based auto-sizing
(matching InlineTaskName pattern). Extract RepoSourceInput component
from DialogHeaderContent to stay within cyclomatic complexity limits.
Add testId prop to Combobox and wire it to ExecutorProfileSelector
for E2E test targeting.
* test(e2e): add worktree executor test and fix GitHub URL repo seeding
Update GitHub URL E2E tests to pre-seed a repository with GitHub
provider info pointing to the local git repo, avoiding actual clone
attempts during task creation.
Add test for GitHub URL task creation with worktree executor type,
verifying the full flow including executor profile selection.
Extend ApiClient with listExecutors and provider fields on
createRepository for test seeding.
* fix(backend): use protocol-aware clone URL for provider-backed repos
The ensureRepoCloned function was hardcoding HTTPS clone URLs via
repositoryCloneURL(), but the user's git setup may require SSH.
Add BuildCloneURL to the RepoCloner interface so the executor uses
the Cloner's configured protocol (SSH/HTTPS) instead of always
generating HTTPS URLs. Falls back to HTTPS if BuildCloneURL fails.
This fixes workspace loading issues (terminal, file tree) for cloned
repos when the user has SSH-only authentication configured.
* test(e2e): enhance GitHub URL test with terminal and changes panel verification
* feat(web): add inline validation for GitHub URL input
- Show inline error for invalid URL format (not matching github.com/owner/repo)
- Show inline error when repository is not found or not accessible
- Mock client returns error for unknown repos (matches real GitHub API)
- E2E tests for invalid URL, nonexistent repo, and error-clearing on valid input
* fix(web): fix GitHub URL branch auto-select and E2E test stability
- Pick branch by name (main/master) for GitHub URL mode instead of
using selectPreferredBranch which returns origin-prefixed names
- Add test timeout for worktree executor test
- Use shorter filename in terminal test to avoid xterm line-wrap issues
* fix(web): fix GitHub URL dialog polish and wrong-repo bug
UI fixes:
- Align toggle button text with dropdown text content (pl-3)
- Match GitHub URL input height to dropdown trigger (min-h-9)
- Position error text absolutely to prevent layout shift
- Remove redundant toast on repo-not-found (inline error suffices)
Bug fix:
- Prevent repo auto-select from overriding GitHub URL mode by
guarding useRepositoryAutoSelectEffect with useGitHubUrl
- Reorder getRepositoriesPayload to check useGitHubUrl first,
preventing stale repositoryId from winning over the GitHub URL
Add E2E test verifying correct repo usage across consecutive tasks.
* fix(web): fix dialog height mismatch and error text overlap
- Use exact h-9 on GitHub URL input to match dropdown trigger height
- Move error text from absolute-positioned overlay to inline next to
the toggle button, preventing overlap while keeping layout stable
* fix(web): make GitHub URL input auto-size to content
Reduce minimum size from 30 to 20 and shorten placeholder so the
"/ task-name" sits closer to the URL text, matching the dropdown's
compact w-auto behavior.
* fix(web): polish GitHub URL input sizing, floating error, and placeholder color
- Match input height (h-7) and padding (px-2) to Combobox trigger button
- Size input width to exactly fit placeholder text
- Show validation error as floating popover below input instead of inline
- Keep placeholder text grey even when input has error state
- Extract useGitHubUrlState hook to fix max-lines-per-function lint
* fix(backend): return proper HTTP status codes from GitHub branches endpoint
Add GitHubAPIError type to distinguish upstream GitHub API status codes.
The branches endpoint now returns 404 (not 500) for non-existent repos,
which the logging middleware correctly logs as DEBUG instead of ERROR.
* feat(web): show error toast when a task session fails to start
Add session failure notification plumbing: WS handler detects FAILED
state with error_message, pushes to Zustand store, and a global bridge
component shows an error toast via the ToastProvider. Also adds
data-testid attributes to toast elements and types error_message on
the session state changed payload.
* style: fix prettier formatting in task-create-dialog and related files
* fix(web): extract ToastList component to fix max-lines-per-function lint
* fix: address code review feedback for GitHub URL task creation
- Preserve 403 status instead of collapsing to 401 in branches endpoint
- Use clone-generic error instead of remote-docker-specific in ensureRepoCloned
- Trim whitespace in GitHub URL validation (backend + frontend)
- Add GitHubURL field to wsUpdateTask path
- Fix DefaultBranch mapping to prefer repoInput.DefaultBranch over BaseBranch
- Clear githubBranchesLoading on early-return paths to prevent stuck state
- Gate GitHub branch loading by mode to avoid false loading states
- Encode owner/repo in API path for special characters
- Add aria-label, aria-invalid, aria-errormessage for accessibility
* fix(e2e): improve diff-update test stability with fresh locator and longer timeout
* fix(backend): add --paginate flag to gh api branches call for repos with >100 branches
* fix: address second round of code review feedback
- Add pagination support to PATClient.ListRepoBranches for repos with >100 branches
- Validate owner/repo in mock controller addBranches endpoint
- Use aria-describedby instead of aria-errormessage for broader AT support
- Add aria-live region to toast container for screen reader announcements
- Assert absence of FIRST_MODIFICATION in diff-update E2E test
* fix(backend): downgrade HTTP request logger from error to warn for 4xx/5xx responses
* fix: address third round of code review feedback
- Validate repositoryID/localPath in UpdateRepositoryLocalPath
- Copy slices in mock client to prevent external mutation
- Extract GitHub header constants and shared setter in PATClient
- Redact clone URL from logs to prevent credential leaks
- Guard against persisting empty localPath after clone
- Show fallback toast message when FAILED state has no error_message