Commit Graph
143 Commits
Author SHA1 Message Date
brennanb2025andOrca b66e9728c7 Carry the worktree head on PR-refresh candidates so fallback preservation is head-gated
Live validation caught a self-sustaining loop the unit seams missed: the
Checks panel passes its displayed PR number as the refresh fallback, and
the candidate path carried no worktree head, so main preserved a merged
branch PR head-blind — the merged view survived new local commits instead
of yielding to 'No pull request found'.

Thread currentHeadOid through GitHubPRRefreshCandidate, both renderer
candidate builders, the gh:prForBranch IPC, and the runtime RPC method —
the same shape the hosted-review path already used. Main's explicit-head
gate (equality or confirmed commit membership) now applies to every
renderer-driven lookup; true no-context callers keep the designed
deleted-head preservation.

Co-authored-by: Orca <help@stably.ai>
2026-07-03 18:17:04 -07:00
brennanb2025andOrca 84b99b28ae Cache definitive non-membership answers as long as confirmations
A merged PR's commit set is frozen, so a 200 response that lacks the PR is
as immutable as one that contains it — only errors (unpushed commits,
network) warrant the short retry TTL. Keeps a reused-branch worktree with
the checks panel open from re-probing GitHub every five minutes. Also adds
the review-requested why comments on the fallback gate and the preservation
seam.

Co-authored-by: Orca <help@stably.ai>
2026-07-03 17:39:53 -07:00
brennanb2025andOrca 96d139fe86 Show a merged branch PR when the worktree head is one of its own commits
A worktree can end up behind its own merged PR's final head — update-branch
merges or web-committed suggestions land on the remote branch and merge
without a local pull. The merged-implicit visibility rule required exact
head equality, so the Checks panel dropped to 'No pull request found —
Create a pull request…' and the sidebar merged badge vanished right after
a successful merge.

Keep the reused-branch guard, but before hiding a merged branch-matched PR
ask GitHub whether the worktree head is one of the PR's own commits
(commits/{sha}/pulls, bounded immutable-friendly cache, core rate-limit
guard, fail-safe to the old hide). Confirmed heads are stamped on PRInfo/
HostedReviewInfo as confirmedContainedHeadOid so the renderer agreement
points (hosted-review staleness, refresh fallback number, no-PR preserve,
sidebar merged badge) accept the same worktrees without refetch loops.

Old main commits carry no association with the PR, so reused branch names
stay hidden; commits never pushed to GitHub fail the probe and stay hidden.

Co-authored-by: Orca <help@stably.ai>
2026-07-03 17:24:33 -07:00
Brennan BensonandNeil 5b7611ddcb fix(win): release PR-refresh aliases when a worktree is removed (#6861)
The OOM reports (F0BDMD16LJ2 and the taifunk many-worktree sessions)
show memory creeping over long sessions with churning worktrees. One
contributor: in pr-refresh-coordinator, many local worktrees that track
the same linked PR coalesce into a single queue entry whose 'aliases'
map keeps one entry per worktree. Aliases were only pruned when a
candidate was re-enqueued as invalid — never when a worktree was simply
removed/closed — so the maps grew unbounded across a session.

Add pruneWorktreePRRefreshAliases(worktreeId) and call it from
removeWorktreeMetadataAndTransientState (the existing central
worktree-removal cleanup, alongside removeWorktreeMeta /
forgetWorktree / deleteWorktreeHistoryDir). It drops the removed
worktree's aliases, deletes the queue entry when none remain, and
rebinds the representative candidate if the removed worktree owned it.

Covered by 3 new coordinator tests (accumulate-then-prune, keep-entry-
on-remaining-aliases with candidate rebind, no-op for unknown worktree)
plus two test-only inspection helpers.

Co-authored-by: Neil <neil@stably.ai>
2026-06-30 00:55:54 -07:00
NeilandOrca 46646d7ff1 chore(lint): upgrade oxlint to 1.71 + enable 7 new rules (autofixed backlog) (#6841)
* chore(lint): upgrade oxlint to 1.71 and enable 7 new rules

Upgrade oxlint 1.67.0 -> 1.71.0 (1.72 was blocked by the repo's 3-day
minimum-release-age supply-chain guard; nothing here needs it). The
bump is a no-op on the existing config.

Enable 3 error rules (backlog autofixed to zero in this commit) and
4 warn rules (surface signal without gating CI):

error (autofixed, behavior-preserving):
- unicorn/prefer-node-protocol        (~1531 sites: bare builtin -> node:)
- typescript/no-import-type-side-effects (~36: all-inline-type -> import type)
- unicorn/no-array-reverse            (19: copy-then-reverse -> toReversed)

warn (real signal, current fires are test-only/correct):
- unicorn/no-array-fill-with-reference-type  (aliasing footgun guard)
- typescript/no-unsafe-function-type         (bans bare Function type)
- unicorn/prefer-array-flat-map              (map().flat() -> flatMap())
- unicorn/prefer-regexp-test                 (.match() in bool ctx -> .test())

mobile/.oxlintrc.json extends root, so it inherits all 7; the autofix
ran from root and covered mobile/ too.

Verification (all green): oxlint 0 errors (root+mobile+aux configs),
oxfmt clean, typecheck (node+cli+web), vitest 22795 passed / 0 failed,
builds (electron-vite + web + cli) succeed. node: rewrites confirmed to
skip embedded SSH/CLI string payloads (AST-only); all toReversed sites
verified to operate on fresh copies or write-once locals.

* chore(lint): bump mobile oxlint to 1.71 so inherited rules parse

mobile/ is a standalone pnpm project pinning its own oxlint@1.67, which
lacks unicorn/no-array-fill-with-reference-type (needs >=1.70). Since
mobile/.oxlintrc.json extends the root config, mobile CI's 'cd mobile &&
oxlint' failed to parse the new rule. Bump mobile to match root (1.71).

Verified in mobile/: oxlint 0 errors, oxfmt --check clean, tsc --noEmit
pass, vitest 978 passed / 0 failed.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-06-29 22:38:29 -07:00
NeilandAlexander Kirilin 4776ac1fe5 fix: include legacy commit statuses in PR checks (#6556)
Co-authored-by: Alexander Kirilin <github@alexanderkirilin.com>
2026-06-29 19:04:09 -07:00
Jinjing a978222184 Clarify auto-merge UI and errors when direct merge is available (#6777)
GitHub rejects enabling auto-merge on a PR that is already mergeable
with a "Pull request is in clean status" error.

* Suppress "Enable auto-merge" option in the UI when direct merge
  is available, while retaining "Disable auto-merge".
* Translate the GitHub "clean status" GraphQL error into an actionable
  message recommending direct merge.
2026-06-29 14:40:53 -07:00
Jinjing 1c30d28113 Surface GitHub check suites awaiting approval (#6717)
* Surface GitHub check suites awaiting approval to unblock merge

- Query the check-suites API endpoint to find suites with an
  "action_required" conclusion, which are often workflows awaiting
  "Approve and run" and do not have any associated check runs.
- Map the "action_required" status distinctly instead of treating it as
  a standard failure or omitting it entirely.
- Update the UI to render these suites with a warning icon, a dedicated
  "Action required" label, and a localized hint explaining that manual
  approval is required on GitHub.
- Count "action_required" checks as failed/blocking when deriving overall
  PR and task statuses so the UI does not report all checks passing.

* Enhance visibility and handling of action-required PR check suites

* Include check suite IDs in pending approval check names and URLs to
  allow navigating directly to the specific workflow run.
* Add an "action required" count badge to PR dialog and page checks tabs.
* Prioritize action-required checks in the checks preview summary.
* Use correct check run state for the action-required fallback hint in
  the right sidebar details panel.
* Add translations for the new status across all supported locales.
2026-06-29 12:05:57 -07:00
Jinjing 7c6f88ba6e fix: address review findings (#6666) 2026-06-28 16:53:32 -07:00
Jinjing cea920a3e4 Harden failed check details links (#6661)
* fix: harden failed check details links

* chore: remove tracked node_modules symlink
2026-06-28 16:17:32 -07:00
Jinjing 3d3453c216 Propagate upstream errors from branch-based PR discovery (#6660)
Previously, transient errors during candidate branch discovery (such as
rate limits or network issues) were silently ignored, leading to a
false "no-pr" result and causing the sidebar PR state to flicker.

Now, track and return any pending error encountered during branch
lookups, propagating it as an upstream error if no PR is successfully
recovered.
2026-06-28 16:17:01 -07:00
Brennan BensonandOrca a71b865867 Show PR status for branch worktrees at a merged PR head (#6607)
Co-authored-by: Orca <help@stably.ai>
2026-06-28 11:22:07 -07:00
Brennan BensonandNeil 85d626b998 Fix fork PR detection for same-name upstreams (#6446)
Co-authored-by: Neil <neil@stably.ai>
2026-06-26 14:49:19 -07:00
Jinjing dd0fa77882 Enhance PR auto-merge controls and switch to GraphQL mutation (#6405)
- Centralize and align auto-merge eligibility logic across web and
  mobile clients.
- Use the `enablePullRequestAutoMerge` GraphQL mutation instead of
  `gh pr merge --auto` to prevent immediate merges on clean branches.
- Fall back to `gh pr merge --auto` when a merge queue is required on
  the base branch.
- Hide the auto-merge control when only optional checks are pending.
2026-06-25 22:00:34 -07:00
Brennan BensonandOrca c10b77d160 Reduce Git refresh subprocess fanout (#6324)
Co-authored-by: Orca <help@stably.ai>
2026-06-25 13:00:44 -07:00
Brennan BensonandOrca c37ab96b57 Remove split terminal from onboarding checklist (#6340)
Co-authored-by: Orca <help@stably.ai>
2026-06-25 01:49:56 -07:00
Jinjing 35c3f86c82 Style commit text area to match input tokens and fix disabled state (#6339)
* Style commit text area to match input tokens and fix disabled state

- Update borders and shadows to match standard input tokens.
- Style the disabled state explicitly to prevent Chromium's user-agent
  styles from washing out the field outline.
- Add dark mode background styling overrides.

* Improve timeline items assertions in work-item-details test

Extract timelineItems to a local variable and add an explicit null check to prevent TypeScript compilation errors when calling the .at method.
2026-06-25 01:18:31 -07:00
Jinjing 56bf9eb333 Add GitHub issue timeline activity feed to details dialog (#6330)
* Add GitHub issue timeline activity feed to details dialog

Fetch and display issue timeline events (assignments, mentions, closes,
reopenings, and project board column moves) in a unified activity tab
within the GitHub item details dialog.

- Query the GitHub REST timeline endpoint up to a bounded 300 items.
- Merge comments and timeline events into a single sorted conversation.
- Render tailored icons, links, and localizable messages per event.
- Ensure issue reply targets are not incorrectly filtered by stale PR state.
- Correctly update local item state from details payload.

* Cap issue timeline pagination by supported activities

Count only mapped, supported timeline items instead of raw REST events
when checking the maximum item threshold. This prevents pagination from
stopping early when pages contain many unsupported event types.
2026-06-24 23:22:42 -07:00
Brennan BensonandNeil 6574e764d7 Bound Windows PR refresh crash storms (#6203)
Co-authored-by: Neil <neil@stably.ai>
2026-06-24 00:21:56 -07:00
Jinwoo HongandOrca ce403c09d5 Add GitHub task close reason parity (#6141)
Co-authored-by: Orca <help@stably.ai>
2026-06-23 15:18:46 -07:00
Brennan BensonandOrca a2fd8c11c2 Reduce source-control background load during refreshes (#6189)
Co-authored-by: Orca <help@stably.ai>
2026-06-23 15:06:38 -07:00
Brennan BensonandOrca 8c4f57e8ef Reduce repeated git probes during worktree refresh (#6153)
Co-authored-by: Orca <help@stably.ai>
2026-06-23 11:07:49 -07:00
Jinjing 89eb4b3f55 fix: show merged PR for current branch head (#5877) 2026-06-20 17:56:38 -07:00
Jinjing 16347ab799 Handle clean local merges when hosting provider reports conflicts (#5942)
When the hosting provider (GitHub) reports conflicts but a local merge
simulation is clean, we now mark the conflict summary as locally clean.

This state is surfaced in both the desktop and mobile sidebars with a
clear explanation and a copyable set of commands to trigger a remote
mergeability recalculation via an empty commit and push.
2026-06-20 17:08:58 -07:00
Jinjing 97dc6d63e3 Accept merged fallback PRs during branch lookup (#5908)
Ensure that when a visible fallback PR has been merged (e.g., outside
Orca with a deleted head branch), it is still accepted and refreshed by
branch lookup instead of being discarded as an implicit merged PR.

* Add `acceptMergedFallbackPR` option to GitHub branch lookups
* Enable this option during manual and background refreshes of fallback PRs
* Plumb the new option through preload APIs, IPC handlers, and RPC protocols
2026-06-20 03:30:18 -07:00
Jinwoo Hong 972078f2c4 Fix paste ownership, input bounds, and IPC validation
Supersedes #5745, #5746, and #5747.
2026-06-19 17:14:55 -07:00
Brennan BensonandOrca fd9e79a77a Celebrate onboarding and agent wins with GitHub star prompts (#5642)
Co-authored-by: Orca <help@stably.ai>
2026-06-17 22:21:32 -07:00
Jinwoo HongandOrca 9e8c71d130 Fix CI test drift after runtime changes (#5655)
Co-authored-by: Orca <help@stably.ai>
2026-06-17 18:04:12 -07:00
0ec3882cb8 Add project Windows runtime selection (#5519)
* Add project Windows runtime selection

* Fix project Windows runtime selection

Co-authored-by: Orca <help@stably.ai>

* fix: preserve WSL shell variables

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Neil <neil@stably.ai>
2026-06-17 16:08:14 -07:00
Jinjing c548e85f57 Persist and repair target base branch for PR and MR worktrees (#5540)
* Resolve and fetch the review target branch (compareBaseRef) during PR and MR worktree creation.
* Persist this ref on worktree metadata instead of pinning the head SHA.
* Dynamically repair existing worktrees with stale commit SHA compare bases in the Source Control UI using linked review metadata.
2026-06-16 15:51:55 -07:00
Jinjing f6fec257eb Ignore merged pull requests found by implicit branch matches (#5524)
Merged pull requests are historical branch matches and should not be
treated as implicit review context unless the worktree has an explicit
PR link. Showing them as implicit review context leaves nothing
meaningful to unlink after the branch has been rebased or merged.
2026-06-16 15:39:57 -07:00
Jinjing d36782a4a8 Respect repository auto-merge setting and forward merge method (#5453)
- Retrieve and propagate `autoMergeAllowed` from GitHub repo metadata.
- Suppress auto-merge action in UI if disallowed by the repository.
- Support specifying the merge method (e.g., squash) when auto-merging.
2026-06-15 20:48:36 -07:00
Brennan Benson 9e6afad545 Prevent large diffs from freezing the diff view (#5409) 2026-06-15 14:39:56 -07:00
Bjarke Hesthaven Søndergaard dbc3407e07 fix: resolve PR workspaces on SSH remotes (fetch via dedicated RPC) (#5320) 2026-06-13 14:51:14 -07:00
Jinjing 36e439907a Implement GitHub issue close reasons and tabbed comment composer (#5235)
- Support closing GitHub issues with specific reasons ('completed', 'not planned', or duplicate) via main-process mutations and gh CLI wrappers.
- Replace the legacy comment composer with a tabbed layout supporting a real-time markdown preview, image/attachment inputs, and state transition buttons.
- Refactor assignee and label popovers into dedicated reusable components to clean up the item dialog.
2026-06-11 19:49:41 -07:00
Jinjing ac216d5727 Route task PR queries by upstream source (#5176)
* Route task PR queries by upstream source

Implements the routing described in docs/tasks-pr-upstream-source.md so task PR and issue queries stay scoped to the selected source.

* rm design doc
2026-06-11 00:58:26 -07:00
KayleeandNeil 528a887ab5 Target the fork branch from fork-PR worktrees (#4394)
Creating a worktree from a cross-repository (fork) PR previously named the
local branch with the maintainer's branch prefix (e.g. `me/866`) and pushed to
origin instead of the contributor's fork, so maintainer edits never reached the
PR. Fork PRs now adopt the contributor's branch name (matching same-repo PRs)
and resolve a fork push target, with a non-blocking warning when the PR
disables maintainer edits and an indicator showing where a push will land.

- pr-start-point: return branchNameOverride/headSha/maintainerCanModify for
  cross-repo PRs (previously only same-repo PRs received these)
- github client: surface maintainer_can_modify alongside the fork push target
- composer: warn (but still allow) when "Allow edits from maintainers" is off
- source control: show the fork push target (owner:branch) before pushing
- extract fork-remote cleanup and setup into dedicated, unit-tested modules

Adds unit suites for the cleanup multi-fork matrix, fork-remote setup,
push-target resolution, the warning decision, and the push-target label.

Note: pre-commit react-doctor hook bypassed — its warnings in useComposerState
are pre-existing (identical count on base) and not enforced by CI.

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-06-07 19:51:36 -07:00
Jinwoo HongandOrca 3ac29ab251 Fix git probe fanout during concurrent refreshes (#4670)
Co-authored-by: Orca <help@stably.ai>
2026-06-04 17:59:09 -07:00
Trevin ChowandNeil abfe9bd329 Default repo avatars to the GitHub upstream owner and flag forks (#4522)
* Default repo avatars to the GitHub upstream owner and flag forks

Make the GitHub owner avatar the default repo icon and surface it as the
primary choice in the icon picker (the "Image" tab becomes "Avatar",
moves first, and opens by default). For forks, resolve the upstream/
parent owner so the avatar reflects the source repo instead of the
personal fork, and show a fork indicator (GitFork glyph + "Fork of
owner/repo" tooltip) next to the repo in the sidebar and settings.

Fork detection prefers the offline `upstream` remote, falling back to a
`gh repo view --json isFork,parent` lookup; the resolved upstream is
stored on the repo. Existing repos self-correct via a one-time startup
backfill (local repos) and a lazy backfill when their icon settings open
(SSH repos); new repos resolve at add-time. Reset now restores the
default (re-detecting the upstream) instead of clearing to the Folder
icon.

* Harden repo upstream avatar handling

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-06-02 20:55:35 -07:00
Brennan BensonandOrca e86d094f4d Fix PR conflict file details on legacy Git (#4441)
Co-authored-by: Orca <help@stably.ai>
2026-06-01 22:07:24 -07:00
Jinjing 472a2a95be fix: address review findings (#4328) 2026-05-31 16:42:19 -07:00
Jinjing c5ba94ce96 fix: address review findings (#4327) 2026-05-31 16:17:30 -07:00
Neil 08ee240b7c fix: clear stale pr refresh backoff entries (#4207) 2026-05-31 08:17:54 -07:00
Neil 92b05098db fix: bound github project owner caches (#4164) 2026-05-31 06:38:25 -07:00
Neil 09d2227a04 fix: bound github merge metadata cache (#4154) 2026-05-31 06:12:38 -07:00
Neil 9d66aceaa6 fix: clear visible pr refresh state on window destroy (#4148) 2026-05-31 06:04:54 -07:00
Neil 81e850d0af fix: prune github owner repo cache (#4081) 2026-05-31 03:40:28 -07:00
Jinwoo-HandOrca 1c1677eaad Hydrate task PR merge methods
Co-authored-by: Orca <help@stably.ai>
2026-05-31 02:43:16 -07:00
Neil e8b859118f Use GitHub merge method metadata for PR actions 2026-05-31 02:43:16 -07:00
Neil c3c265d926 fix: parse github https remotes with auth (#4014) 2026-05-31 01:20:15 -07:00