Repository navigation
Conversation
Retire protocol 2 hosts and clients, preserve mounted navigation during unknown status, and fence requests and subscription replay by logical generation. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change retires protocol 2 and raises mobile and runtime compatibility minimums to protocol 3. Host status parsing now distinguishes absent fields from unreadable fields. Host status probes use bounded retries, timeout budgets, generation fencing, and conservative fallback gates. Merge Risk: 🔵 Low · up to Protocol verification and recovery behavior are covered, but malformed host status data can still leave one parser case untested and may deliver invalid capabilities to mobile consumers, potentially causing recovery or UI failures for malformed responses. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives detailed problem, behavior, compatibility, testing, and validation information. However, it omits the required Linked Issue, Visual Proof, checklist, and several template sections. It also conflicts with the PR objectives about the RPC admission policy: the description says the policy was removed, while the objectives say it blocks requests. Resolution Add the required template sections, including a valid Linked Issue, Visual Proof or an explicit N/A with a reason, Testing checklist status, Notes, and Checklist items. Resolve the inconsistency about whether the RPC admission policy remains in this PR. ✨ Finishing Touches 💡 1📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: cff3cb87-1af2-44df-a45f-d2663a83e467
📒 Files selected for processing (16)
mobile/src/components/HostProtocolGate.test.tsmobile/src/components/HostProtocolGate.tsxmobile/src/components/ProtocolBlockScreen.tsxmobile/src/transport/host-logical-client.tsmobile/src/transport/host-protocol-admission.test.tsmobile/src/transport/host-protocol-admission.tsmobile/src/transport/host-status-gates.test.tsmobile/src/transport/host-status-gates.tsmobile/src/transport/protocol-compat.test.tsmobile/src/transport/protocol-compat.tsmobile/src/transport/protocol-version.tsmobile/src/transport/stable-logical-rpc-client.tssrc/main/runtime/orca-runtime-tests/runtime-availability.spec.tssrc/main/runtime/rpc/methods/agent-session.test.tssrc/shared/protocol-compat.test.tssrc/shared/protocol-version.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| it.each([ | ||
| null, | ||
| {}, | ||
| [], | ||
| true, | ||
| { protocolVersion: '3', minCompatibleMobileVersion: 3 }, | ||
| { protocolVersion: 3, minCompatibleMobileVersion: null } | ||
| ])('keeps malformed status %j unknown', async (result) => { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🌐 Web query:
Vitest it.each array table entries spread as multiple arguments
💡 Result:
In Vitest, when you use test.each (or its alias it.each) with an array of arrays, each inner array is automatically spread as individual arguments to your test callback function [1][2]. For example, if you provide a table of data like this: test.each([ [1][3], [1][3][4], [3][1][4], ])('add(%i, %i) -> %i', (a, b, expected) => { expect(a + b).toBe(expected) }) Vitest will execute the test three times, spreading the inner array elements into the parameters a, b, and expected for each run [1][5]. This behavior differs from test.for, which does not automatically spread the inner arrays. If you were to use test.for with the same data, you would receive the entire inner array as a single argument, requiring you to destructure it inside the callback [1][6]: test.for([ [1][3], [1][3][4], [3][1][4], ])('add(%i, %i) -> %i', ([a, b, expected]) => { expect(a + b).toBe(expected) })
Citations:
- 1: https://main.vitest.dev/api/test.html
- 2: https://vitest.dev/api/test
- 3: https://vitest.dev/
- 4: GitHub pull request 2280 in vitest-dev/vitest (link omitted to avoid creating a cross-reference)
- 5: https://github.com/vitest-dev/vitest/blob/v4.1.7/docs/api/test.md
- 6: https://vitest.dev/api/test.html
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions
Length of output: 42075
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- relevant test file ---'
sed -n '360,430p' mobile/src/components/HostProtocolGate.test.ts
printf '%s\n' '--- bound implementation and nearby tests ---'
rg -n -C 8 'readHostProtocolVerdict|HostProtocolGate' mobile/src
printf '%s\n' '--- Vitest configuration and version ---'
rg -n -C 3 '"vitest"|vitest|test\.each|it\.each' mobile/package.json package.json mobile/vite.config.* mobile/vitest.config.* 2>/dev/null || trueRepository: stablyai/orca
Length of output: 28159
Wrap each malformed-status case in a single-element tuple.
Vitest spreads each inner array in it.each into the test arguments. The bare [] entry therefore passes no argument, so result is undefined instead of an array. This leaves the Array.isArray(status) branch in readHostProtocolVerdict untested.
it.each([
- null,
- {},
- [],
- true,
- { protocolVersion: '3', minCompatibleMobileVersion: 3 },
- { protocolVersion: 3, minCompatibleMobileVersion: null }
- ])('keeps malformed status %j unknown', async (result) => {
+ [null],
+ [{}],
+ [[]],
+ [true],
+ [{ protocolVersion: '3', minCompatibleMobileVersion: 3 }],
+ [{ protocolVersion: 3, minCompatibleMobileVersion: null }]
+ ])('keeps malformed status %j unknown', async (result: unknown) => {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| it.each([ | |
| null, | |
| {}, | |
| [], | |
| true, | |
| { protocolVersion: '3', minCompatibleMobileVersion: 3 }, | |
| { protocolVersion: 3, minCompatibleMobileVersion: null } | |
| ])('keeps malformed status %j unknown', async (result) => { | |
| it.each([ | |
| [null], | |
| [{}], | |
| [[]], | |
| [true], | |
| [{ protocolVersion: '3', minCompatibleMobileVersion: 3 }], | |
| [{ protocolVersion: 3, minCompatibleMobileVersion: null }] | |
| ])('keeps malformed status %j unknown', async (result: unknown) => { |
There was a problem hiding this comment.
ℹ️ No critical issues — one rough edge worth a look, plus two nits.
Reviewed changes
- Retire protocol 2 —
MIN_COMPATIBLE_RUNTIME_CLIENT_VERSION/SERVER_VERSION(shared) andMIN_COMPATIBLE_DESKTOP_VERSION(mobile) move from 2 to 3, retiring desktop ≤ v1.4.4 and mobile ≤ v0.0.7 under a documented four-pairings wire matrix. - Fail-closed admission gate — new
HostProtocolAdmissionallows only four bootstrap methods untilstatus.getverifies protocol 3; the stable logical client rejects other RPCs locally and withholds subscriptions and viewport updates. - Verification + retry —
useHostStatusGatesadds an 8sstatus.gettimeout, 1/2/4s bounded retries, generation fencing viauseSyncExternalStore, and aretryStatusescape hatch; refused/malformed status now yieldsunknownrather than a fabricated mismatch. - Recovery UI —
ProtocolBlockScreengains anunknownmode (Retry + Back to hosts, no upgrade prompt);HostProtocolGateoverlays already-mounted navigation instead of unmounting it.
ℹ️ Fail-closed admission surfaces transient errors in mounted screens
The "reject locally, don't queue or replay" decision is sound for the worktree catalog, which recovers via its existing 3s poll — but during the unverified window, worktree.ps and the metadata calls reject with a plain Error('Host compatibility has not been verified'), which use-host-worktree-catalog.ts classifies as setCatalogError('network_error') (STA-3123's "a failed request must not look like 0 worktrees"). Every host open/reconnect therefore enters a spurious network-error state until the next poll clears it — brief and largely hidden behind the overlay, but a genuine misclassification. More broadly, any screen whose fetch fires exactly once on the connected transition (no poll or focus retry) stays empty after verification, since nothing re-triggers it.
Technical details
# Fail-closed admission surfaces transient errors in mounted screens
## Affected sites
- mobile/src/transport/stable-logical-rpc-client.ts:96 — rejects unverified methods with a plain Error indistinguishable from a transport failure
- mobile/src/host-screen/use-host-worktree-catalog.ts:121 — maps any thrown rejection to setCatalogError('network_error')
## Required outcome
- mounted-route RPCs withheld during verification are not classified as network failures, and screens that fire once still load after verification completes
## Suggested approach (optional)
- reject with a distinguishable error type (e.g. an admission-pending error) that catalog/error-classification code can recognize and ignore, or publish a verification signal mounted screens can subscribe to for refetch
## Open questions for the human (optional)
- is the deliberate "no replay" stance acceptable given per-screen polling/focus already covers the main screens, or does the lane intend a verification-completion signal later?ℹ️ Nitpicks
settleUnknownsetsunverifiedfalse while a retry is still scheduled, so the "Unable to verify this host" Retry screen flashes between the automatic 1/2/4s backoff (spinner during each probe, Retry screen during backoff) before settling.- Several renderer test fixtures still advertise
minCompatibleRuntimeClientVersion: 2alongsideruntimeProtocolVersion: 3(e.g.web-runtime-session-terminal-legacy-create.test.ts,web-runtime-session-terminal-host-authority.test.ts,components/agent/AgentSettingsDialog.test.tsx). They pass — a protocol-3 client is compatible with a min-2 server — but now misrepresent a real host's floor after the retirement; onlyagent-session.test.tswas bumped to 3.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The admission gate pushed stable-logical-rpc-client.ts past the 300-line limit. Move the subscription records, their attach/detach lifecycle, the admission reconcile pass and the terminal viewport update into their own module; behavior is unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Extracted the logical subscription registry — moved the subscription records, their attach/detach lifecycle, the admission reconcile pass, and the terminal viewport update out of
stable-logical-rpc-client.tsinto a newLogicalSubscriptionRegistrymodule, bringing the client back under its 300-line limit. The move is behavior-preserving: the per-record admission gate, generation-fenced callbacks, attach-before-dispose replay ordering, and the suspend/close detach-vs-dispose split all carry over unchanged, andcreateStableLogicalRpcClientnow delegates to the registry rather than reimplementing it.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Admission gates every RPC the app makes, but the only thing that opened it was a status.get issued by HostProtocolGate, which mounts under /h/ alone. The launch screen therefore never verified: its notification and accounts subscriptions never attached and its six card RPCs all rejected into empty catch blocks. A relay/direct cutover reset admission and dropped the same subscriptions for good outside that route. openHostLogicalClient now starts a verifier that owns the probe, on connect and on each generation bump, and useHostStatusGates reads its verdict instead of issuing a second status.get. A request written in the same state-listener pass that starts the probe still lost the race by one round trip, so the logical client now holds a denied request until that probe answers rather than refusing it. Nothing unverified reaches the host; the refusal is only deferred. The request dispatch and the cutover error moved into their own modules to make room. A host that already answered once stays pending through its bounded retries, so a single post-cutover hiccup no longer buries a live terminal under a modal error card. The status probe budget now spans connect, so 8s is the real per-attempt ceiling rather than 16s. An absent protocol field reads as 0 again, matching src/shared/protocol-compat.ts, so a very old desktop gets the update screen instead of an unactionable Retry. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Moved verification from the route onto the logical client — new
host-protocol-verifier.ts(startHostProtocolVerifier+attachHostProtocolVerification) drives thestatus.getprobe on the client itself, andopenHostLogicalClientwraps its client with it. This fixes the launch-screen fencing:useHostStatusGatesonly mounted under/h/, so a home-screen client was never probed and its admission gate stayed shut forever.useHostStatusGatesnow reads the client's verification snapshot viauseSyncExternalStoreand dropped itshostIdargument and its duplicate probe. - Held unverified requests during the probe window — new
LogicalRequestDispatcher(extracted fromstable-logical-rpc-client.ts) now holds an unverified request written while astatus.getis in flight, re-checking admission when the probe settles, instead of rejecting immediately. This covers the race where a screen's connect effect fires a round trip ahead of the probe; requests with no probe in flight still fail closed.HostProtocolAdmissiongainedbeginProbe/endProbe/whenProbedto expose that distinction. - Read absent protocol fields as 0 —
readHostProtocolVerdictnow treats missing/null fields as protocol 0 (viareadProtocolField), matching the shared evaluator, so an old desktop that omits the fields gets the actionable update screen rather than aRetryloop; present-but-unreadable fields stayunknown.LogicalClientCutoverErrorwas also extracted into its own module.
The held-request, cutover, close, and retry paths are all generation-fenced and covered by exact-assertion tests (call sequences, verdict kinds, generation numbers, probe counts). openHostLogicalClient remains the sole production construction site, so every production client verifies itself.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The protocol 2 to 3 bump was additive: browser screencast methods, a capability string, and a binary backpressure return value. No existing field changed meaning, units or nullability. So a retired desktop asked to do something it does not know about answers method-not-found rather than misapplying the request, and the fence was buying a better error message on three surfaces at the cost of a race class that produced two blocking review findings. Removed: HostProtocolAdmission and its bootstrap allow-list and probe window, the hold path and the request dispatcher it forced, and every admission check in the stable client and the subscription registry. The verifier goes with it. It existed because admission was enforced app-wide while the probe was route-scoped; with no fence, every consumer of the verdict is a mounted component, so the probe belongs in the hook again. That also drops the cutover-error module, which only existed to break an import cycle the dispatcher created. Kept, because each stands on its own: the three-minimum retirement bump, the fail-closed verdict so a failed or unreadable status.get no longer reads as compatible, Retry and Back-to-hosts on the recovery screen, a host that already answered staying pending through its bounded retries instead of being buried under a modal card, the status budget spanning connect so 8s is the real per-attempt ceiling, and absent protocol fields reading as 0 to match src/shared/protocol-compat.ts. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The split was lint collateral, not design. The base client sat at 297 effective lines against a 300 ceiling; the fence's admission calls pushed it over and it was carved up to fit. With the admission code gone the subscriptions fit inline again, so the transport returns to exactly what main ships: stable-logical-rpc-client.ts and its test are now byte-identical to aac38d6, and 297 effective lines is back under the ceiling with no per-file bump. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…lient" This reverts commit 03a2d4c.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
mobile/src/components/HostProtocolGate.tsx (1)
77-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate the stale reference to the admission gate.
The comment states that "the logical client's admission gate fences mounted effects." This PR removes the admission fence from
mobile/src/transport/logical-subscription-registry.tsandmobile/src/transport/stable-logical-rpc-client.ts. Mounted children now issue RPCs and subscriptions freely while the verdict is unknown. The overlay blocks touches, but it does not fence effects.The comment justifies keeping children mounted during the pending window. A reader may assume a transport-level fence that no longer exists.
♻️ Proposed comment update
- // Preserve nested navigation; the logical client's admission gate fences mounted effects. + // Preserve nested navigation. The overlay blocks in-tree touches only — + // mounted effects still issue their own RPCs while the verdict is unknown.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 187aaa57-e230-4e98-b6ab-8f77dbcb2ea6
📒 Files selected for processing (6)
mobile/src/components/HostProtocolGate.test.tsmobile/src/components/HostProtocolGate.tsxmobile/src/transport/host-status-gates.test.tsmobile/src/transport/host-status-gates.tsmobile/src/transport/logical-subscription-registry.tsmobile/src/transport/stable-logical-rpc-client.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| hostId, | ||
| client, | ||
| generation, | ||
| hostCapabilities: status.capabilities ?? EMPTY_HOST_CAPABILITIES, |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
# Description: Compare capabilities validation between the status probe and the runtime capability probe,
# and find every consumer that calls array methods on hostCapabilities.
set -eu
echo '--- runtime-capability-probe validation ---'
fd -t f 'runtime-capability-probe.ts' mobile/src --exec sed -n '1,60p' {}
echo '--- hostCapabilities consumers ---'
rg -nP --type=ts -C 3 '\bhostCapabilities\b'
echo '--- DesktopStatus definition ---'
fd -t f 'host-worktree-rpc-types.ts' mobile/src --exec sed -n '1,40p' {}Repository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -eu
echo '--- host-status-gates.ts ---'
sed -n '1,190p' mobile/src/transport/host-status-gates.ts
echo '--- status response/type bindings ---'
rg -n -P -C 4 'status\.capabilities|capabilities\??:|type .*Status|interface .*Status|status\.get' mobile/src mobile -g '*.ts' -g '*.tsx' | head -n 240
echo '--- repository conventions ---'
printf '%s\n' 'No repository-knowledge capability requested; inspect the directly bound source and contracts.'Repository: stablyai/orca
Length of output: 29342
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings
Length of output: 28114
🏁 Script executed:
#!/bin/bash
set -eu
echo '--- DesktopStatus definition ---'
fd -t f 'host-worktree-rpc-types.ts' mobile/src --exec rg -n -C 8 'DesktopStatus|capabilities' {}
echo '--- protocol verdict implementation ---'
fd -t f 'protocol-compat.ts' mobile/src --exec sed -n '1,240p' {}
echo '--- direct host capability consumers ---'
sed -n '1,90p' mobile/src/agent-history/worktree-navigation-actions.ts
sed -n '35,55p' mobile/src/components/HostProtocolGate.test.tsRepository: stablyai/orca
Length of output: 5708
Validate capabilities before storing it as string[].
If status.capabilities is not an array of strings, the type assertion does not validate it. The assignment then violates HostStatusGates.hostCapabilities: string[], and consumers that call .join() or .includes() can throw.
- hostCapabilities: status.capabilities ?? EMPTY_HOST_CAPABILITIES,
+ hostCapabilities:
+ Array.isArray(status.capabilities) &&
+ status.capabilities.every((value) => typeof value === 'string')
+ ? status.capabilities
+ : EMPTY_HOST_CAPABILITIES,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| hostCapabilities: status.capabilities ?? EMPTY_HOST_CAPABILITIES, | |
| hostCapabilities: | |
| Array.isArray(status.capabilities) && | |
| status.capabilities.every((value) => typeof value === 'string') | |
| ? status.capabilities | |
| : EMPTY_HOST_CAPABILITIES, |
…client" This reverts commit 585ce9a.
A cold start whose first status.get failed flashed the full-screen "Unable to verify this host" card for the whole backoff second, then recovered. main never did that: its gate latched resolved hosts in resolvedHostIdRef, so the overlay could not return once a host had answered, and a failure fell through to a fail-open verdict. This PR replaced that latch with a condition that has no memory. A probe with retries left is now pending regardless of whether this client has answered before, so the spinner covers the backoff window and only an exhausted ladder settles and offers Retry. That restores the effect of main's latch without restoring fail-open: four consecutive failures still reach an actionable card rather than silently proceeding with capabilities the host never confirmed. Frames before, one failure then success on the first retry: cold start t=0 no-content|ERROR-CARD cutover t=0 CONTENT|SPINNER|OVERLAY Both are now the spinner. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
ℹ️ No critical issues — one behavioral rough edge, plus stale references to the removed fence.
Reviewed changes
- Removed the RPC admission fence — deleted
HostProtocolAdmission,LogicalRequestDispatcher, thehost-protocol-verifier, and the cutover-error module; the status probe moved back into the mounted route'suseHostStatusGateshook, which now takeshostIdagain. - Inlined the generation-fenced
sendRequest—createStableLogicalRpcClientfences requests and releases in-flight requests on cutover/close directly, withLogicalClientCutoverErrordefined in the same file. - Stripped admission from the subscription registry — subscriptions replay immediately on cutover with no per-record gate, and terminal viewport updates are no longer withheld.
- Kept the retirement and fail-closed verdict — the 2→3 minimum bump, absent-fields-as-0 read, 8s
budgetSpansConnecttimeout, bounded 1/2/4s retries, and the Retry/Back-to-hosts recovery UI all remain.
ℹ️ PR description still describes the removed admission fence
The What changes and Tests and coverage limits sections document the HostProtocolAdmission bootstrap allow-list, the held-request path, openHostLogicalClient supplying an admission policy at its sole construction site, and per-generation admission-latch tests — all removed by this commit. A reviewer or future maintainer reading the body will expect unverified RPCs to be rejected locally, which they no longer are; worth refreshing the prose to match the fail-closed-at-the-UI-gate design.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Reviewed changes
- Folded the logical subscription registry back into the stable client — reverted the
5993da0extraction, sostable-logical-rpc-client.tsand its test are byte-identical tomainagain and drop out of the PR diff entirely. The registry module and its context type are deleted; subscription attach/detach, replay, viewport update, and generation-fenced callbacks return to inline form with no behavioral change. The commit message confirms the split was onlymax-linescollateral from the now-removed admission code, and 297 effective lines sits under the 300 ceiling with no per-file bump.
No new issues in this commit. The two open threads from the prior review (host-status-gates.ts retry flash, HostProtocolGate.tsx stale comment) are in files this fold-back does not touch, so they remain outstanding.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The previous commit's claim was wrong and mutation testing caught it. settleUnknown writes its own unknown record, so "a record exists for this generation" became true after the first failure and was read as "already answered". The card therefore returned at the second attempt, about a second in, not after the fourth. Separate the two questions the record was answering: whether this generation has any record at all, which decides whether a proven verdict gets clobbered, and whether the ladder has attempts left, which decides whether we are still pending. Only the second belongs in the settle condition. That left provenThisGeneration with no reader. statusPending has one consumer, HostProtocolGate, which reads it only inside a branch that already requires an unknown verdict, and provenThisGeneration is false by construction there. Removed rather than kept as untestable defence. Two tests were missing and are added: the card's position in the ladder is now pinned by call count rather than by presence, and a proven generation is pinned against having its capabilities wiped by a transient reconnect failure. Both mutations survived until they existed. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Reviewed changes
- Folded the logical subscription registry back into the stable client — reverted the
5993da0extraction, sostable-logical-rpc-client.tsand its test are byte-identical tomainagain and drop out of the PR diff entirely. The registry module and its context type are deleted; subscription attach/detach, replay, viewport update, and generation-fenced callbacks return to inline form with no behavioral change. The commit message confirms the split was onlymax-linescollateral from the now-removed admission code, and 297 effective lines sits under the 300 ceiling with no per-file bump.
No new issues in this commit. The two open threads from the prior review (host-status-gates.ts retry flash, HostProtocolGate.tsx stale comment) are in files this fold-back does not touch, so they remain outstanding.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Reviewed changes
- Folded the logical subscription registry back into the stable client — reverted the
5993da0extraction, sostable-logical-rpc-client.tsand its test are byte-identical tomainagain and drop out of the PR diff entirely. The registry module and its context type are deleted; subscription attach/detach, replay, viewport update, and generation-fenced callbacks return to inline form with no behavioral change. The commit message confirms the split was onlymax-linescollateral from the now-removed admission code, and 297 effective lines sits under the 300 ceiling with no per-file bump.
No new issues in this commit. The two open threads from the prior review (host-status-gates.ts retry flash, HostProtocolGate.tsx stale comment) are in files this fold-back does not touch, so they remain outstanding.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Reviewed changes
- Folded the logical subscription registry back into the stable client — reverted the
5993da0extraction, sostable-logical-rpc-client.tsand its test are byte-identical tomainagain and drop out of the PR diff. The registry module and its context type are deleted; subscription attach/detach, replay, viewport update, and generation-fenced callbacks return to inline form with no behavioral change. 297 effective lines sits under the 300 ceiling with no per-file bump.
No new issues in this commit. The two open threads from the prior review remain outstanding in files this fold-back does not touch.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Reviewed changes
- Withheld the recovery card until the retry ladder is exhausted —
settleUnknownnow setsunverifiedfromdelay !== undefined, so a failed probe stays under the spinner through all four attempts and only surfaces the recovery card once the 1/2/4s ladder runs out. This resolves the retry-flash regression raised in the prior review;everVerifiedRefwas dropped and theprovenThisGenerationcheck renamed tosameGeneration, which now only guards against wiping a generation's proven record. - Strengthened the gate tests — added a
surfaces the recovery card only once all four attempts have failedassertion pinning thespinner → cardprogression across attempts, plus cold-start and proven-generation reconnect cases; existing card assertions now run the ladder down first viaexhaustStatusRetries.
No new issues in these commits. The stale HostProtocolGate.tsx:77 comment from the prior review remains open and untouched by this change.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The render fence required loaded.generation === generation, and migrateTo bumps the generation on every cutover, so a LAN<->relay switch reset the verdict to unknown and covered the host with an opaque, touch-blocking overlay for a status.get round trip — on a host proved compatible seconds earlier. main never did this; its fence is host + client only. Generation is a write-side concern and is already enforced three ways, so it comes out of the read side and stays an effect dep, which keeps the re-probe. The cutover test asserted the spinner was present, pinning the regression as intent; it now requires the overlay to be absent. Re-adding the clause fails it. Also drop three unreachable `generation !== readGeneration()` guards — each was removed independently with 45/45 still passing, because a plain RpcClient has no getGeneration and the logical client rejects cross-generation replies first — and correct a comment claiming an admission gate fences mounted effects. There is no admission gate; the overlay covers the UI, not the requests. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Stopped blanking a proven host on transport cutover —
useHostStatusGatesdrops the generation requirement from itsprovencache key, so a same-host/same-client cutover keeps the already-proved capabilities and verdict visible whilestatus.getre-verifies in flight, instead of flashing the "Checking host compatibility" overlay on every cutover. The cutover test now asserts no overlay appears while the probe is pending. - Relied on effect-cancellation for stale-probe fencing — removed the
generation !== readGeneration()guards fromprobeandsettleUnknown; thecancelledcleanup flag (withgeneration/hostId/clientstill effect deps) plus the stable client's own generation-fencedsendRequestalready cover the same stale-completion window, and a failing cutover probe still converges to the recovery card after the retry ladder. - Corrected the stale gate comment — the
HostProtocolGateoverlay comment now states mounted effects are not fenced by an admission gate, resolving the last open line-level finding.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Closing unmerged — superseded by the decision to drop the protocol gate. The PR's premise was fail-closed RPC admission. The RPC fence was removed during review (an overlay is not a fence — it blocked the user, not the requests), and after that removal What remained did not justify merging:
Nothing depends on this PR: lane A's The branch
If the malformed/non-object hardening is ever wanted, it is ~12 self-contained lines in |

Problem and decision
Mobile treated a failed or refused
status.getas compatible, so a host that could not answer read as verified. Jinwoo's 2026-09-09 retirement decision raises all three minimum protocol versions from 2 to 3: runtime client, runtime server, and mobile's desktop minimum. The runtime and mobile protocol versions remain 3.An earlier revision of this branch also added an RPC-level admission fence that withheld every ordinary request until a
status.getverified the host. That has been removed. The protocol 2 to 3 bump was additive: it added browser screencast methods, abrowser.screencast.v1capability, and a binary backpressure return value in the E2EE channel. No existing field changed meaning, units or nullability. A retired desktop asked to do something it does not know about answers method-not-found; it does not misapply the request. The fence was buying a better error message on the three surfaces the block screen does not cover, at the cost of a race class that produced two blocking review findings. Version skew that does need fencing is already handled per feature by capability strings, at a finer granularity than a protocol number can express, because a capability also fences a protocol-3 host that lacks it.Who is affected
Desktop through v1.4.4 and mobile through mobile-v0.0.7 use protocol 2 and are retired. Desktop v1.4.5 and mobile-v0.0.8 are the first releases at protocol 3. The first platform-specific tags are mobile-ios-v0.0.15 and mobile-android-v0.0.14, both at protocol 3; earlier mobile releases used the common
mobile-v*namespace. Already-released protocol-3 hosts and mobile apps remain compatible. Active install counts on the retired releases are unknown.Verified with
git show v1.4.4:src/shared/protocol-version.ts,git show v1.4.5:src/shared/protocol-version.ts, the corresponding mobile protocol files at the four mobile tags, and a version-sorted enumeration of the three mobile tag namespaces. This change requires upgrades for retired pairings; it does not require identical app versions.What changes
status.getthat fails, is refused, or answers with a protocol field that is present but unreadable now producesunknown, never a fabricated version mismatch and never a pass. An unreadable answer joins the same bounded retry schedule as a network failure rather than settling straight to the recovery screen.0, matching the documented?? 0kill-switch semantics insrc/shared/protocol-compat.ts, so a desktop old enough to omit the fields gets the actionable "Update Orca on your computer" screen with a Releases link. Only a field that is present and malformed leaves the verdict unknown.ProtocolBlockScreenwith Retry and Back to hosts, without telling users to upgrade on a transient failure.mainachieved the same effect with a resolved-host latch in the gate, which an earlier revision of this branch replaced with a condition that had no memory. A generation that has already proved its capabilities keeps them through a failed reconnect probe.budgetSpansConnect, so the connect wait comes out of the same budget. Without it the wait gets its own fulltimeoutMsand an attempt can run to roughly 16s. Failures retry after 1, 2 and 4 seconds, then stop until Retry or a connection change. Effect cleanup cancels timers, and host, client and logical-generation provenance prevents a stale completion from approving a replacement session.orcadentry constructs the sameOrcaRuntimeService, whose status producer publishes the shared protocol and minimum values and their mobile aliases. There is no separate hardcoded protocol-2 floor in these paths.No structural change survives from the removed revision.
stable-logical-rpc-client.tsand its test are byte-identical tomain; the transport is untouched by this PR.Wire compatibility: four pairings
This changes published minimum values in
status.get, not its shape. There are no new fields and no new opcodes, and no change to what either side publishes beyond those values. "Old" below means a build from before this PR, which can have protocol 2 or 3.desktop-too-old, as is a host old enough to omit the protocol fields entirely. An already-released protocol-3 host is allowed, provided its advertised mobile minimum is met.mobile-too-oldupdate screen. An already-released protocol-3 mobile app remains compatible. The old app's existing fail-open behavior on a failed status probe cannot be changed retroactively.Both clients evaluate the two bounds, so an advertised
minCompatibleMobileVersion: 4is blocked even when the host's own protocol is 3. This applies equally to local desktop and headless/SSH runtimes; no execution routing, provider-specific behavior, Git command, or workspace-kind assumption changes.Tests and coverage limits
The mobile component suite exercises the real
HostProtocolGate, status hook, evaluator, recovery component and stable logical client against a scripted physical sender. It verifies host protocol 2 and, separately, mobile minimum 4 at the visible gate. It covers first connection, reconnect, same-object logical cutover with the subscription replay riding the cutover, a stale old-generation success, persistent refusal, bounded retries, retry cancellation, Retry recovery, Back-to-hosts routing, host and client switching, a host that stays under the spinner through its post-cutover retries and only then reaches the card, an ok response with unreadable protocol fields rejoining the retry schedule, the status budget spanning connect, and absent versus unreadable protocol fields at both the evaluator and the gate.Seven targeted source mutations were run against the affected test files and all seven were killed: dropping
budgetSpansConnect, settling immediately instead of holding through the retries, never settling at all, treating the existence of an unknown record as proof the host answered, clobbering a proven generation's capabilities on a failed reconnect, reading an absent protocol field as unknown, and letting an unreadable ok response through without a retry. Three of those survived their first run and the tests that kill them were written in response; two of the three were live defects rather than missing coverage.The real host status producer is covered by
runtime-availability.spec.tsthroughsrc/main/runtime/orca-runtime.test.ts. Shared compatibility tests cover both directions of the retired floor. Execution-host registry and remote-pairing verification tests derive their below-floor fixtures from the constants, so no edits were needed there.A true phone/device E2E was not run: this lane has no isolated phone/device harness, and no visible app or emulator was launched. The CI coverage above is component-to-sender integration plus the actual host producer suite, not a claim that direct E2EE framing, relay networking, or a physical phone ran end-to-end.
Gates
All commands ran with
ORCA_BACKGROUND_LAUNCH=1against the committed tree. Each exited 0:pnpm --dir mobile typecheck: exit 0. Actual output:$ tsc --noEmit.pnpm --dir mobile test: exit 0. Actual output:Test Files 518 passed (518);Tests 4268 passed | 3 skipped (4271).pnpm exec oxlint --format githubfrom the repo root: exit 0. Actual output:Found 0 warnings and 0 errors.;Finished in 5.5s on 23771 files using 18 threads.pnpm exec oxfmt --check <changed files>(frommobile/): exit 0. Actual output:All matched files use the correct format.pnpm run check:code-quality:changed: exit 0. Actual output:code quality: 0 new finding(s) across 12 changed file(s).;type-aware code quality: 0 new finding(s) across 12 changed file(s).;React Doctor: 0 new finding(s) across 12 changed file(s).;Changed-code quality gate passed since aac38d698ff7.pnpm run check:react-doctor:changed: exit 0. Actual output:Bugs › 2 warnings.pnpm tc: exit 0.pnpm test src/shared/protocol-compat.test.ts src/shared/execution-host-registry.test.ts src/shared/remote-pairing-verification.test.ts src/main/runtime/rpc/methods/agent-session.test.ts src/main/runtime/orca-runtime.test.ts: exit 0. Actual output:Test Files 5 passed (5);Tests 1320 passed | 1 skipped (1321).React Doctor's two warnings are one
no-set-state-after-await-in-effectfinding athost-status-gates.ts:58, reported once from each of the two project scans. It is pre-existing onmain, where the same hook already awaitsstatus.getand then sets state, which is why the changed-code gate reports zero new findings. The async paths check cancellation and the captured logical generation before writing state, and the host-switch, cancellation and late old-generation response tests verify that guard. No rule was disabled and nomax-linesbump was added.Lead note
Part of the mobile RPC contract foundation (step 0, lane B). Not merged by the lead; owner merges after review. Physical-phone E2E was not run; see coverage limits above.