You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On mobile Source Control for folder workspaces (folder:<id>), unrouted git RPCs (git.branchCompare, history, sync) throw selector_not_found. The loader treated that as transient and retried, so users hit a slow loop then a bare error.
Focused fix
Detect folder: worktree ids on mobile
Do not retry selector_not_found for folder workspaces (structural, not create-race)
Skip git.branchCompare for folders; fail-fast clear message for unrouted sync/history RPCs
Branch card label falls back to “Folder workspace” when head/branch are unset
Out of scope: main-process routing for every folder git RPC (desktop still gates SC for folders)
Preserves
git.status / routed multi-repo folder status still attempted
Git worktree SC path unchanged (retries for real create-race still apply)
No new desktop Source Control surface for folder workspaces
Evidence
Unit tests: mobile-folder-workspace-selector.test.ts, mobile-git-history.test.ts (33 related tests green)
User-regression-tradeoffs
Folder SC history/sync show explicit unsupported instead of hanging on retries — intentional degrade until product routes those RPCs
Mobile source-control logic now distinguishes synthetic folder: workspaces from real worktrees. Folder workspaces receive restricted Git RPC access, skip unsupported history and branch-comparison requests, and use adjusted retry behavior and branch labels. Tests cover workspace detection, RPC authorization, label formatting, history handling, and loader predicates.
Priority: Normal
Severity of issue fixed: Medium
Merge Risk: Low · up to eac97
Folder workspaces on mobile now fail fast instead of retrying. If folder status cannot be resolved, users may still see a generic error instead of the clear "not available" message. This is a small, low-effort follow-up and is not a merge blocker.
Pre-merge checks: 3 · 1 · 1
Failed checks: 1 warning · 1 inconclusive
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check
The description follows the repository template in substance. It explains the problem and the fix, and it lists what is preserved and what is out of scope. It links issue #11153 with "Closes #11153". …
Restructure the description to use the template headings. Add an ELI5 and a plain-language What Changed section that describes the before and after user experience. Add a Why section that explains why detection and degradation was chosen ov…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title "fix(mobile): stop folder-workspace SC selector_not_found retries" describes the main change: folder workspaces on mobile no longer retry selector_not_found. The changeset also adds branch-c…
Linked Issues check
Issue #11153 is the only direct linked issue. Its coding requirements, using the 'detect and degrade' option, are met at head eac97e5:
All changes stay within mobile folder-workspace Source Control handling, as the PR summary describes. The changed files are mobile-folder-workspace-selector.ts and its test, mobile-git-history.ts …
Full details: Title check
Explanation
The title "fix(mobile): stop folder-workspace SC selector_not_found retries" describes the main change: folder workspaces on mobile no longer retry selector_not_found. The changeset also adds branch-compare skipping, fail-fast guards for unrouted git RPCs, and a "Folder workspace" branch label, which the title does not mention. Those are secondary to the primary retry fix. The title is specific and uses a conventional commit prefix.
Full details: Linked Issues check
Explanation
Issue #11153 is the only direct linked issue. Its coding requirements, using the 'detect and degrade' option, are met at head eac97e5:
Folder selector detection [#11153]: isMobileFolderWorkspaceId in mobile-folder-workspace-selector.ts tests the folder: prefix.
No retry for selector_not_found on folder workspaces [#11153]: use-mobile-source-control-loaders.ts retries only when shouldRetryMobileStatusSelectorNotFound(worktreeId) is true. Transient refresh errors keep their existing retry path.
git.branchCompare skipped for folder workspaces [#11153]: loadBranchCompare returns early when shouldLoadMobileBranchCompare is false and leaves the compare state idle.
Fail-fast clear message for unrouted sync and history RPCs [#11153]: useMobileGitRequestssendGitRequest calls mobileFolderWorkspaceGitRpcGuard before client.sendRequest. This covers git.upstreamStatus, git.fetch, git.pull, and git.push. fetchMobileGitHistory throws MOBILE_FOLDER_WORKSPACE_UNSUPPORTED_MESSAGE before sending git.history. The message is 'Not available for folder workspaces'.
Branch card label fallback [#11153]: formatMobileFolderAwareBranchLabel returns 'Folder workspace' when branch and head are unset for a folder id. use-mobile-source-control-state.ts uses this helper.
Automated tests [#11153]: the PR adds mobile-folder-workspace-selector.test.ts and extends mobile-git-history.test.ts. The PR reports 33 related tests green. I did not run them.
Residual uncertainty: the issue names a 'clear not supported state'. The PR shows this through thrown error text and the branch label, not a dedicated sync or history UI state. I did not inspect the sync and history components that display these errors. I also did not inspect mobile-branch-compare.ts, mobile-repo-base-ref-operations.ts, or mobile-git-mutation-operations.ts for direct git.* calls that bypass the guards. The issue-listed RPC paths are covered.
Full details: Out of Scope Changes check
Explanation
All changes stay within mobile folder-workspace Source Control handling, as the PR summary describes. The changed files are mobile-folder-workspace-selector.ts and its test, mobile-git-history.ts and its test, use-mobile-git-requests.ts, use-mobile-source-control-loaders.ts, and use-mobile-source-control-state.ts. Each change supports a #11153 objective: detection, retry gating, branch-compare skip, RPC guard, or branch label. The guard also blocks git.commit and other unrouted git.* methods. This extends the same unrouted-RPC requirement and is not unrelated work. The PR adds no desktop Source Control surface and no main-process routing. Those items are listed as out of scope in the PR description, and the summary shows no such changes.
Residual uncertainty: the diff text could not be read. Both diff calls returned changed blobs as missing. This assessment relies on the whole-PR summary and the head file contents I read.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Full details: Description check
Explanation
The description follows the repository template in substance. It explains the problem and the fix, and it lists what is preserved and what is out of scope. It links issue #11153 with "Closes #11153". It does not follow the template headings: there is no ELI5, What Changed, Why, Visual Proof, Testing checklist, AI Disclosure, Review, Agent skill upstream boundary, or Checklist section. The author gives no visual before/after for the mobile UI change, although the branch card label changes. The Testing section lists only unit tests and does not state whether the change was tested manually on a device. The description also states that 33 tests are green, but it does not list the commands run (pnpm lint, typecheck, test, build).
Resolution
Restructure the description to use the template headings. Add an ELI5 and a plain-language What Changed section that describes the before and after user experience. Add a Why section that explains why detection and degradation was chosen over routing the RPCs. Add Visual Proof for the branch card label change, either as before and after media or as an explicit N/A with a reason. In Testing, state whether manual testing on mobile was done, and list the commands run (pnpm lint, typecheck, test, build). Complete the AI Disclosure section if AI tools were used. Complete the Agent skill upstream boundary checkbox and the Checklist items.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
CodeRabbit: replace denylist with allowlist (git.status/git.diff) so
git.commit and other unrouted methods fail closed for folder workspaces.
Co-Authored-By: Grok Companion <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Loader behavior is not tested
These tests check the helpers, but never run useMobileSourceControlLoaders with a folder workspace. They would still pass if the loader stopped using either helper, letting repeated requests return unnoticed.
Add loader tests that assert a folder selector_not_found causes exactly one git.status request, successful folder status sends no git.branchCompare request, and real worktrees still retry.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '195,260p' mobile/src/source-control/use-mobile-source-control-loaders.ts
rg -n "shouldRetryMobileStatusSelectorNotFound|MOBILE_FOLDER_WORKSPACE_UNSUPPORTED_MESSAGE" mobile/src
Repository: stablyai/orca
Length of output: 4768
Script executed:
set -u
printf'%s\n''--- selector helper ---'
nl -ba mobile/src/source-control/mobile-folder-workspace-selector.ts
printf'%s\n''--- loader imports and function context ---'
nl -ba mobile/src/source-control/use-mobile-source-control-loaders.ts | sed -n '1,275p'printf'%s\n''--- loader state consumers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'useMobileSourceControlLoaders' -e "kind === 'error'" -e "screenState.message" -e "screenState.kind" mobile/src/source-control mobile | sed -n '1,240p'printf'%s\n''--- relevant diff ---'
git diff --no-ext-diff --unified=30 15c9dfc702c90efaeafe8deb069757b2b1721454 eac97e5182f496d440b0a86a1bd8e2f3fcb0b8a7 -- mobile/src/source-control/use-mobile-source-control-loaders.ts mobile/src/source-control/mobile-folder-workspace-selector.ts mobile/src/source-control/mobile-git-history.ts
Repository: stablyai/orca
Length of output: 41145
Map folder status refusals to the unsupported message.
When folder git.status returns selector_not_found, the loader stops retrying but displays the raw refusal.message or generic fallback. Use MOBILE_FOLDER_WORKSPACE_UNSUPPORTED_MESSAGE for this folder-specific failure while preserving worktree retries and the existing status attempt.
Suggested fix
import {
+ isMobileFolderWorkspaceId,+ MOBILE_FOLDER_WORKSPACE_UNSUPPORTED_MESSAGE,
shouldLoadMobileBranchCompare,
shouldRetryMobileStatusSelectorNotFound
} from './mobile-folder-workspace-selector'
...
- throw new Error(refusal.message || 'Unable to load source control')+ const message =+ refusal.code === 'selector_not_found' && isMobileFolderWorkspaceId(worktreeId)+ ? MOBILE_FOLDER_WORKSPACE_UNSUPPORTED_MESSAGE+ : refusal.message || 'Unable to load source control'+ throw new Error(message)
Thanks for keeping this up to date. I'm closing it along with #11153: the phone hides Source Control for folder workspaces, so these retries can't happen on main, and an allowlist would guard a path the phone never takes. If folders get Source Control on the phone later, we'll come back to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On mobile Source Control for folder workspaces (
folder:<id>), unrouted git RPCs (git.branchCompare, history, sync) throwselector_not_found. The loader treated that as transient and retried, so users hit a slow loop then a bare error.Focused fix
folder:worktree ids on mobileselector_not_foundfor folder workspaces (structural, not create-race)git.branchComparefor folders; fail-fast clear message for unrouted sync/history RPCsPreserves
git.status/ routed multi-repo folder status still attemptedEvidence
mobile-folder-workspace-selector.test.ts,mobile-git-history.test.ts(33 related tests green)User-regression-tradeoffs
Closes #11153
Made with Orca 🐋