Repository navigation
fix(mobile): enable Grok native chat in folder workspaces - #11751
brennanb2025 wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThe chat readability hook now supports 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Greptile SummaryThis PR extends
Confidence Score: 5/5Safe to merge. The change is tightly scoped to catalog dispatch and ID matching, all failure modes are handled fail-closed, and the new logic is exercised by comprehensive tests. The new code path follows the same defensive patterns already established for repo workspaces — stale-request cancellation via the active flag, a double-keyed guard at the return site, and explicit fail-closed returns for every exceptional condition. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| mobile/src/session/use-mobile-native-chat-readability.ts | Adds folder-workspace readability branch: routes folder: to folderWorkspace.list, validates via resolveFolderWorkspaceSummary, and applies the existing eligibility rule. Existing repo and floating workspace paths are unmodified. |
| mobile/src/session/use-mobile-native-chat-readability.test.ts | Adds six new test cases for folder workspace readability, covering local/runtime/SSH admission, missing catalog entries, RPC rejection, empty route IDs, duplicate catalog entries, and missing connectionId. |
Reviews (2): Last reviewed commit: "fix(mobile): fail closed on ambiguous fo..." | Re-trigger Greptile
|
Folder chat lookup and Grok phone chat support are now on main, including #27212. This earlier folder-only patch can be closed. |
Summary
Mobile now resolves
folder:<id>native-chat readability through the existing read-only folder-workspace catalog. This lets a supported Grok session in a local or runtime-owned folder become readable once mobile has a valid session entry carrying both the folder route and real provider session ID.The change is deliberately narrow: it does not create or refresh mobile
session.tabssnapshots, change session identity, add providers, alter transcript parsing/rendering/sending, or broaden SSH eligibility. Malformed, ambiguous, unavailable, and unsupported cases remain fail-closed.Before / after
Before: Mobile treated the synthetic
folder:<id>route as a repository ID and searchedrepo.list. Folder workspaces are not repositories, so their connection authority could not resolve and native-chat readability stayed false.After: Folder routes request
folderWorkspace.list, match the underlying folder ID exactly once, and use that record's explicitconnectionId. Local (null) and runtime-owned (runtime-ssh-*) authorities satisfy the existing readability rule. Direct Model-A SSH folders, blank or unknown routes, duplicate IDs, missing or malformed authority metadata, rejected requests, and unsuccessful responses remain unavailable. Repository workspaces continue to userepo.listunchanged.Screenshots
No valid native-chat acceptance screenshot was captured or published.
/tmp/pr11751-folder-session-loading.pngis explicitly excluded: it showed the Terminal route stuck onLoading tabs, and its deep link incorrectly placed afolder:<id>value in the session-ID segment. It is not evidence for this PR.There is no visual-design change in the diff.
Native QA gap
Exact-head setup was proven on iPad simulator
C589AF84-2F0C-4978-952B-748933DE6804: the installed Release app contains an embedded JavaScript bundle built froma89846e9e26d29a7423e8c93998d24d9b2f021cb(SHA-2566e9b6f16b30c076b828a1a1c134d385a28f28491a424a89c3cecf4e4cb554af3). The isolated helper remains on port 3100.Backend/runtime fixture proof also succeeded. A read-only runtime catalog query returned the live Grok terminal for folder route
folder:2573f8cc-8e3a-4e16-bf2b-95f8bae2eb1d, real provider session ID019fb802-68c6-7400-a38e-6afcc8d2690e, and a transcript containingFOLDER-GROK-READY.Native acceptance is blocked upstream of this PR's readability hook: after bounded foreground, reconnect, relaunch, and catalog-refresh attempts, the paired mobile host never surfaced the folder or a corresponding folder
session.tabssnapshot. Therefore no supported agent-history/resume entry could supply bothworktreeId=folder:2573f8cc-8e3a-4e16-bf2b-95f8bae2eb1dand the real provider session ID. Native chat never rendered.Accordingly, this QA does not claim transcript rendering/readability, keyboard or dictation, composer/send, unsent-draft retention, scrolling, drawer/navigation, switching away/back, reconnect, or foreground recovery. Those remain pending behind the separate folder catalog/session-entry rough edge. Runtime-owned relay/direct-host behavior, direct-SSH exclusion, physical iOS devices, and Android also remain unverified natively.
Testing
f936e7fc9c7defebc40398a1ddf2ce50e93c7dfc: the folder-workspace regression test failed withexpected false to be truebecause the hook requestedrepo.list.expected true to be false; the hardened implementation was restored before commit.cd mobile && node_modules/.bin/vitest run src/session/use-mobile-native-chat-readability.test.ts src/session/mobile-native-chat-eligibility.test.ts— 2 files, 19 tests passed.cd mobile && node_modules/.bin/vitest run— 375 files passed; 2,782 tests passed and 3 skipped.cd mobile && node_modules/.bin/tsc --noEmit— passed.cd mobile && node_modules/.bin/oxlint— passed.cd mobile && node_modules/.bin/oxfmt --check .— passed.git diff --check— passed.a89846e9e26d29a7423e8c93998d24d9b2f021cbagainst fetchedorigin/mainfdb58695e9d08738c1cc16fd1c0b1f0e7937ca18— clean.AI Review Report
The requested direct recovery loop used fresh
gpt-5.6-solreviewers with xhigh reasoning. This was not a formal Orca orchestration dispatch, and no formal dispatch provenance is claimed.The first reviewer found one fail-open boundary defect: duplicate folder IDs were order-dependent, and an omitted
connectionIdwas treated as local. The follow-up commit requires one exact match and explicitnullor string authority, adds blank-route and malformed-catalog coverage, and leaves legacy repository compatibility unchanged. A fresh same-model/xhigh reviewer then returned CLEAN ata89846e9e26d29a7423e8c93998d24d9b2f021cb.The final static review covered stale async responses, duplicate IDs in both orders, local/runtime/direct-SSH authority, direct and relay transport, folder workspaces versus git worktrees, unsupported agents, request volume, payload exposure, and adjacent native-chat eligibility/readability. Effect cleanup and keyed state prevent a previous route result from leaking after tab, workspace, client, or host changes. Folder resolution remains one read-only catalog request per route resolution.
Security Audit
This uses an already registered, authenticated, end-to-end-encrypted, read-only RPC method. The existing response contains the folder catalog, but this hook reads only
idandconnectionId; it does not log or persist catalog paths, credentials, linked items, or other metadata.Blank routes, unknown IDs, duplicate matches, omitted or non-string authority, rejected requests, and unsuccessful responses fail closed. Local
nulland runtime-ownedruntime-ssh-*values remain readable; direct SSH values remain blocked. No command execution, filesystem access, auth change, secret handling, dependency, persistence, or new IPC/RPC surface was added.Notes
The missing mobile folder
session.tabssnapshot is preserved as a separate confirmed folder catalog/session-entry rough edge; it is not expanded into PR #11751. Irreversible long-response clipping is also a separate finding and remains out of scope.No simulator helper was stopped. Native QA remains pending, and the iPad lane is ready for coordinator release after the other lane finishes. This PR must not be merged as part of this review.