Skip to content

feat(remote): let phones observe and control runs started elsewhere - #359

Merged
sambitcreate merged 4 commits into
mainfrom
feat/remote-phone-run-observe-control
Oct 6, 2026
Merged

sambitcreate merged 4 commits into
mainfrom
feat/remote-phone-run-observe-control

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Paired phones can now observe runs that were started on the Mac desktop, in Telegram or by the scheduler. From the phone they can Stop those runs and answer their approvals and questions.

This is Aiden Remote contract revision 21, behind feature phone-run-control-v1. It adds two capabilities a phone can negotiate, runs:observe and runs:control. The phone requests them through POST /device/capabilities only when the Mac advertises the feature.

Server (main/services/aiden-remote-*)

  • Phones use the run-scoped routes already shared with multi-host peers:
    • GET /chats/{id}/runs/current/events
    • GET /runs/{id}/events, resumed with ?after or Last-Event-ID
    • POST /runs/{id}/cancel
    • POST /runs/{id}/approvals/{aid}/respond
    • POST /runs/{id}/questions/{pid}/respond
  • Access is checked per chat. Bot chats also need the Bot grants: bot:read to observe and bot:write to control.
  • The phone projection never carries tool details. It strips approval details, and it offers scopes only when canAllow (phoneMayAllow). No tool arguments or previews reach the phone.
  • The first responder wins. A phone that answers second gets 409 approval_resolved or question_already_resolved, with the winning decision or outcome.
  • Revoking a device closes its run feeds.
  • Older Macs never advertise the feature, so phones keep their current behaviour with them.

Protocol

  • contract.json moves to revision 21 and gains the phoneRunEvents fixture (13 frames for one run).
  • openapi.json and docs/aiden-remote-api-v1.md are updated to match.

iOS and Android

  • Strict run-event decoders:
    • run.started and run.ended. run.ended is the only run-level terminal.
    • Gap snapshots, which may have sequence 0.
    • approval_required / approval_resolved and question_required / question_resolved.
    • task_update and agents_update are rejected on run streams.
  • Client methods for the run routes. Control writes never retry automatically.
  • A foreign-run projection drives the existing live UI:
    1. When the phone attaches, the replay must be quiet for 400 ms before the run shows as live. A run that has already ended is not shown as live.
    2. The phone reconnects at most 3 times.
    3. A phone that answers second shows "Answered on Mac: allowed/denied", "Answered on Mac" or "Question expired on Mac".
  • When the phone has no stream of its own running, Stop and the approval and question cards send their requests to the run routes.

Contract revision note

Open PR #349 also claims revision 21. If #349 merges first, this PR must claim the next free revision before it merges, and update the server, iOS, Android and fixture contracts together, as AGENTS.md requires.

Decisions

  • Scope. This PR covers observing runs and Stop, approvals and questions. Steer/Queue on foreign runs is deliberately not offered: the Steer/Queue/Redirect UI is still limited to runs the phone owns.
  • When observation starts. The phone attaches to a foreign run only while the chat screen is open. It does not discover runs in the background. On Android the observer keeps running if the app leaves the foreground, so the live notification keeps updating.
  • Bot chats. Observing needs bot:read and controlling needs bot:write. Allowing a tool on an automation run also needs schedule:write; otherwise the approval is offered as deny-only.
  • Answering a prompt. The phone hides the prompt as soon as it sends an answer, so it never shows its own answer as "answered elsewhere". A failure other than 409 shows an error. The prompt then stays hidden until the next snapshot reconciles it.
  • Expiry. Run approvals carry no expiry on the wire, so phones show them with no countdown.
  • Hermex. Read-only, as required: no gateway tickets, no push and no phone slash commands.

Remaining

  • Steer/Queue on foreign runs.
  • Background discovery of foreign runs, for example a push or a chat-list badge when a run starts elsewhere.
  • Run approvals have no expiry.
  • Android has no localized strings for the "Answered on Mac" notices yet.

Tests

  • npm run test:aiden-remote: 111 + 686 (685 pass, 1 skip) + 7 + 21, 0 fail.
  • npx tsc --noEmit: clean.
  • iOS (simulator, Xcode-beta): AidenRemotePhase0Tests, AidenRemoteClientTests and AidenChatTests pass.
  • Android: full :app:testDebugUnitTest, 36 files and 314 tests, 0 failures. This includes the new AidenForeignRunTest and new run-route tests in AidenRemoteClientTest.
  • No JS test files were added, so the CI test registry is unchanged.

🤖 Generated with Claude Code

CI flake (rerun once)

Contract revision 21 adds the phone-negotiable capabilities runs:observe and
runs:control behind feature phone-run-control-v1. Paired phones attach to the
run currently open on a chat, even when the Mac desktop, Telegram or the
scheduler started it, and can Stop it or answer its approvals and questions
through the run-scoped routes.

- Server: phone projection strips approval details and offers scopes only
  when the phone may allow; access is per chat, Bot chats also need bot
  grants; first responder wins with 409 approval_resolved or
  question_already_resolved; revoking a device closes its run feeds.
- iOS and Android: strict run-event decoders, run-scoped client methods,
  a foreign-run projection that settles the attach replay before going
  live, bounded reconnects, and "Answered on Mac" receipts for losers.
- Fixture phoneRunEvents pins the shared run stream on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

The new phone approval path bypasses schedule:write, and native observation/recovery has four reproducible failure modes. These should be addressed before merging.

Reviewed changes: Reviewed the complete server, protocol, iOS, and Android implementation of phone observation and control for runs started elsewhere.

  • Authority and Projection: Adds phone-negotiated run grants, per-chat authorization, redacted approvals, and first-responder control through the existing run routes.
  • Native Observation: Adds run SSE decoders, foreign-run reducers, attachment/reconnect handling, and integration with Stop, prompt cards, and ambient run status.
  • Contracts and Tests: Updates revision 21 fixtures, API documentation, and decoder/client/service coverage; 140 focused TypeScript tests, TypeScript checking, and the full checked-in Android unit suite passed. Isolated behavioral probes reproduced the five inline findings; iOS XCTest execution was unavailable on this Linux runner.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread main/services/aiden-remote-router.ts Resolved
- Phone-scoped allow of an automation approval on a foreign run needs
  schedule:write, matching the phone's own approvals.
- Android attaches to a run started elsewhere once a cold-opened chat
  loads, and a continuously streaming run goes live within a bounded
  settle deadline instead of waiting for a pause.
- iOS and Android restore a prompt whose local answer was not confirmed
  when a later snapshot still lists it.
- iOS and Android keep a finished foreign run's response visible when the
  terminal transcript read fails, and recover it with a bounded, fenced
  re-read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Android's new terminal-recovery path retains the response in memory but still hides it from the transcript when the final read fails.

Reviewed changes: Reviewed 0bae07d4 against the previous Pullfrog review, with the full PR diff as context.

  • Enforced Automation Authority. Required schedule:write for phone-scoped automation approval allows, while preserving Deny and desktop behavior.
  • Repaired Android Attachment. Retried observer admission after cold chat loading and bounded replay settlement so continuous output becomes visible with Stop available.
  • Restored Prompt Recovery. Cleared local-answer suppression after failed control writes so authoritative snapshots can restore pending approvals and questions without resending writes.
  • Added Terminal Read Recovery. Preserved native live buffers and added bounded, ownership-fenced transcript retries; reviewed the new behavioral coverage. All 141 focused server tests, all 318 Android unit tests, and TypeScript checking passed. iOS XCTest execution was unavailable because this Linux runner has no xcodebuild.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment on lines +2053 to +2056
} else if (client != null) {
// Keep the response the user was watching until the transcript that
// holds it is accepted. Only the chat is re-read; nothing is resent.
scheduleForeignRunReconciliation(client)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Render retained output while terminal reconciliation is pending

This branch preserves _liveText, but the Android transcript still renders its live row only when isStreaming is true (AidenChatDetailScreen.kt:130,771). After done/run.ended, the state is terminal, so a failing final chat GET still removes the answer from the screen until a retry succeeds, or indefinitely if the retries exhaust. The new test passes because it checks stored model text rather than whether the response remains rendered.

Technical details
# Retained terminal response is hidden by the Android transcript gate

## Affected sites
- `android/app/src/main/java/sbtbiswas/AidenOnTheGo/features/chat/AidenChatViewModel.kt:2050-2056` keeps the terminal state and retains live output on a failed transcript read.
- `android/app/src/main/java/sbtbiswas/AidenOnTheGo/features/chat/AidenChatDetailScreen.kt:130,770-789` derives `isStreaming` from a nonterminal state and omits the entire `live_stream` item otherwise; live text is collected only inside that item.
- `android/app/src/test/java/sbtbiswas/AidenOnTheGo/AidenChatTest.kt:289-299` verifies retained text and later transcript recovery, but does not exercise the rendering gate.
- `ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift:4431` already allows rendering a response with nonempty live text after streaming ends.

## Required outcome
- Keep the previously visible foreign response rendered while its authoritative transcript is unavailable, including after the bounded retries are exhausted.
- Remove the retained presentation only after accepted transcript handoff or superseding ownership/removal, without re-enabling Stop for an ended run.
- Cover the rendered response through terminal delivery, a failing transcript read, and successful recovery; assert the handoff leaves one visible answer.

@very-hermes-bot

very-hermes-bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: f24cb17a6b95cc97b139ffdd91e56fcee02eb64f
Generated: 2026-10-06T15:13:15+00:00
Reviews: 1

Summary

This PR implements Aiden Remote contract revision 24 (noted as revision 21 in the PR description, but correctly standardized to 24 across the schema, server, Android, iOS, and fixture contracts), allowing mobile clients (iOS and Android) to observe and control Aiden agent runs initiated on the desktop, via Telegram, or by scheduled tasks.

Key additions:

  • Server routes & security: Adds /chats/{chatId}/runs/current/events, /runs/{runId}/events, /runs/{runId}/cancel, /runs/{runId}/approvals/{approvalId}/respond, and /runs/{runId}/questions/{promptId}/respond. Authorization is strictly guarded via requirePhoneRunGrant(...) verifying runs:observe / runs:control, device pairing, and chat/bot permissions. Approvals project a safe representation (summary, scopes, canAllow) without exposing raw tool arguments.
  • Replay & conflict resolution: Bounded event journaling (AidenRemoteRunEventJournal, up to 256 frames) allows mobile clients to attach mid-run or recover after network hiccups. First-responder-wins semantics return HTTP 409 Conflict (approval_resolved / question_resolved) to losing responders with safe user receipts.
  • Mobile clients: Android (AidenChatViewModel.kt, AidenForeignRunProjection.kt) and iOS (AidenChatFeature.swift, AidenChat.swift) project foreign run event streams into native chat UI, Live Activities, and system notifications.

The review identified two logic bugs in the iOS implementation where event settle debouncing and capability retry handling diverge from Android, risking spurious Live Activities on finished runs and missed observation when opening a chat during connection setup.


Confidence Score: 5/5


📁 Important Files Changed
  • main/services/aiden-remote-server.ts: Implements HTTP endpoints for current run discovery, run event streaming, cancellation, and approval/question responses with requirePhoneRunGrant checks.
  • main/services/aiden-remote-host-runs.ts: Bridges host run coordinators to remote clients, manages event journaling, and handles first-responder-wins resolution.
  • main/services/aiden-remote-contracts.ts: Defines contract revision 24 schema, capabilities (runs:observe, runs:control), and event types.
  • android/app/src/main/java/sbtbiswas/AidenOnTheGo/features/chat/AidenChatViewModel.kt: Implements Android foreign run lifecycle, settle window, bounded deadline, and stream reduction.
  • android/app/src/main/java/sbtbiswas/AidenOnTheGo/protocol/AidenForeignRunProjection.kt: Pure Kotlin state projection and event reducer.
  • ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift: Implements iOS foreign run observation, Live Activities lifecycle, and UI bindings.
  • ios/AidenOnTheGo/Models/AidenChat.swift: Pure Swift state projection and event reducer.

Findings

[P2] logic: iOS foreign run settle timer does not debounce incoming replay events

  • File: ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift:2317-2349

Description:
When attaching to a chat's current run, retained journal frames replay from sequence 0. The client must wait for a quiet period before presenting the run as live; if the run already completed, the replay will quickly arrive at a terminal event (run.ended), preventing the phone from displaying a flash of "live" activity for historical runs.

In ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift:

if foreignRun == nil {
    foreignRun = AidenForeignRunProjection(runId: event.runId)
    scheduleForeignRunSettle(context: context, generation: generation)
}

scheduleForeignRunSettle is only called on the very first frame when foreignRun == nil. On all subsequent replayed frames (events 2, 3, ... N), scheduleForeignRunSettle is bypassed because foreignRun != nil. The initial Task.sleep(for: .milliseconds(400)) runs without ever being rescheduled or cancelled by subsequent events.

If journal replay takes >400ms (e.g. over cellular, high network jitter, or large replay journals), foreignRunSettleTask expires while replay frames are still streaming in. At that point, projection.isEnded is still false, so the task invokes goLiveWithForeignRun(...), starting iOS Live Activities and marking foreignRunIsLive = true. A few milliseconds later, the remaining replayed frames finish with run.ended, triggering immediate teardown and notification cancellation for a run that may have completed hours earlier.

In contrast, Android's AidenChatViewModel.kt:189-218 cancels and reschedules foreignSettleJob on every pre-settle event and caps the wait with FOREIGN_RUN_MAX_SETTLE_MILLIS = 1_200L.

Recommendation:
In applyForeignRunEvent, debounce settle while !foreignRunIsLive:

if foreignRun == nil {
    foreignRun = AidenForeignRunProjection(runId: event.runId)
}
if !foreignRunIsLive {
    scheduleForeignRunSettle(context: context, generation: generation)
}

In scheduleForeignRunSettle, incorporate a bounded maximum deadline (foreignRunMaxSettleInterval, e.g. 1.2s) matching Android so continuous active generation still transitions to live within a reasonable timeframe.


[P2] logic: iOS fails to retry foreign run observation when capabilities or connection settle after load

  • File: ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift:1688 (and 2214-2228)

Description:
In ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift, startForeignRunObservationIfNeeded(context:) is only invoked once, inside load() (line 1688).

The method guards on:

guard ...
      coordinator.server?.canObserveForeignRuns == true,
      let installation = coordinator.installationStore.activeInstallation,
      installation.hasNegotiatedAccess(to: .runsObserve),
      ... else { return }

If a chat is opened while the client is still connecting, reconnecting, or negotiating capabilities with the Mac server (canObserveForeignRuns or runsObserve not yet negotiated), the guard exits and drops the attempt.

Because iOS never re-evaluates foreign run observation, an open chat view will never observe foreign runs even after the connection finishes connecting and capabilities are confirmed. The user is forced to leave the chat and navigate back in to trigger load().

In Android (AidenChatViewModel.kt), retry hooks are registered in three critical lifecycle points:

  1. startProgressObservation() (line 633): When the chat detail becomes foregrounded.
  2. reconcileProgressAccess() (line 843): When server capabilities or active installations update.
  3. acceptLatestTranscript(...) (line 1161): When an uncached chat finishes loading its transcript.

Recommendation:
Call startForeignRunObservationIfNeeded from startProgressObservation() and whenever server capabilities / installations reconcile in AidenChatFeature.swift, matching Android's retryForeignRunObservation() pattern.


📊 Sequence Diagram
sequenceDiagram
    autonumber
    actor User as Mobile User (Phone)
    participant Client as Mobile Client (iOS/Android)
    participant Host as Aiden Remote Host (Mac Server)
    participant Coordinator as Desktop Run Coordinator

    Note over User,Host: Phone opens chat while desktop run is active
    Client->>Host: GET /chats/{chatId}/runs/current/events (auth: bearer + runs:observe)
    Host-->>Client: HTTP 200 SSE Stream (Replay frames seq 0..N)

    loop Replay & Settle Window
        Client->>Client: Reduce events into AidenForeignRunProjection
        Client->>Client: Reset 400ms settle debounce (max deadline: 1200ms)
    end

    Note over Client: Replay settles (run not ended) -> Go Live
    Client->>User: Display live streaming text, start Live Activity

    opt Approval Required
        Coordinator->>Host: Tool execution requires confirmation
        Host-->>Client: event: approval_required {approvalId, summary, canAllow, scopes}
        Client->>User: Render approval card (Once / Always)
        User->>Client: Tap "Allow Once"
        Client->>Host: POST /runs/{runId}/approvals/{approvalId}/respond {decision: "allow_once"}
        alt First Responder (Phone wins)
            Host->>Coordinator: Forward resolution
            Host-->>Client: HTTP 200 {status: "resolved"}
        else Already Answered (Mac or another phone answered first)
            Host-->>Client: HTTP 409 Conflict {error: "approval_resolved", responder: "desktop"}
            Client->>User: Show receipt ("Answered elsewhere on desktop")
        end
    end

    Coordinator->>Host: Run completes
    Host-->>Client: event: run.ended {state: "done"}
    Client->>Host: GET /chats/{chatId}/transcript (reconcile canonical transcript)
    Host-->>Client: HTTP 200 Complete Transcript
    Client->>User: Update transcript UI & dismiss Live Activity
Loading

Last reviewed commit: f24cb17a6b95
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review — 4 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread main/services/aiden-remote-protocol.ts Outdated
* version 1; the revision is published on `/health` and in the shared fixture.
*/
export const AIDEN_REMOTE_CONTRACT_REVISION = 20 as const;
export const AIDEN_REMOTE_CONTRACT_REVISION = 21 as const;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1 · logic] Contract revision 21 collides with main where revisions 21 and 22 are already claimed
Confidence: 0.95

The branch claims contract revision 21, but origin/main has already merged PR #349 and PR #352 which claimed revisions 21 and 22 respectively.

Repair: Merge origin/main and bump the contract revision to 23 across protocol definitions, OpenAPI, fixtures, iOS, and Android.

Suggested change
export const AIDEN_REMOTE_CONTRACT_REVISION = 21 as const;
export const AIDEN_REMOTE_CONTRACT_REVISION = 23 as const;

Comment on lines +2021 to +2034
canRespond = canControl,
hasRequiredWriteCapability = hasWrite,
hostCanAllow = approval.canAllow,
canAllow = canControl && approval.canAllow && hasWrite,
scopes = approval.scopes ?: listOf(AidenApprovalScope.ONCE)
)
}
_pendingQuestion.value = projection.pendingQuestion?.let { question ->
AidenPendingQuestion(
id = question.promptId,
questions = question.questions,
expiresAt = question.expiresAt ?: FOREIGN_PROMPT_EXPIRY,
canRespond = canControl
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 · logic] Android approval and question prompts bypass per-chat response capability checks
Confidence: 0.9

presentForeignRun assigns canRespond and canAllow based solely on runs:control without checking capabilities.canRespond (approval:respond) or canRespondToQuestions() (questions:respond).

Repair: Require capabilities.canRespond for approvals, canRespondToQuestions() for questions, and chat:write for canControlForeignRun.


/** Phones never receive host-only approval facts (contract revision 21). */
export function isPhoneRunDevice(device: { type?: string }): boolean {
return device.type !== undefined && device.type !== "mac" && device.type !== "linux";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 · logic] Omitted device type in isPhoneRunDevice leaks full desktop run projections
Confidence: 0.92

isPhoneRunDevice requires device.type !== undefined, so devices where type is omitted by legacy adapters evaluate to false and receive the full desktop projection rather than the redacted phone projection.

Repair: Remove the device.type !== undefined check so any non-desktop device defaults to the phone projection.

Suggested change
return device.type !== undefined && device.type !== "mac" && device.type !== "linux";
return device.type !== "mac" && device.type !== "linux";

Comment on lines +7791 to +7794
if foreignRun == nil {
foreignRun = AidenForeignRunProjection(runId: event.runId)
scheduleForeignRunSettle(context: context, generation: generation)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 · logic] iOS foreign run settle timer is not debounced across incoming replay events
Confidence: 0.88

scheduleForeignRunSettle is only called on the very first event rather than debounced across all pre-live events, firing at 400ms even if historical replay frames are still streaming.

Repair: Reschedule the settle timer on each received event while foreignRunIsLive is false so the run only transitions to live after a 400ms quiet window.

…ontract revision 24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sambitcreate
sambitcreate enabled auto-merge October 6, 2026 14:09

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues found in the merge delta. The existing Android terminal-output rendering finding remains open, so this is not an approval.

Reviewed changes: Reviewed 310d0bee against the previous Pullfrog review at 0bae07d4, with the complete current PR diff as context.

  • Merged Current Main. Preserved the incoming transcript-window and busy-composer changes alongside foreign-run observation and control.
  • Integrated Cold-Load Admission. Kept Android's observer retry after successful latest-transcript acceptance, using the merged window-aware read path.
  • Advanced the Contract. Moved phone run control to revision 24 across the server, shared fixture, native test expectations, API documentation and OpenAPI, following main's revision 23.

Validation passed: 176 focused TypeScript tests, 147 focused Android unit tests, and npx tsc --noEmit. iOS XCTest execution was unavailable because this Linux runner has no xcodebuild; exact-head hosted CI was still in progress when inspected.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

The release toolchain makes the memberwise init private because the
parser has private stored properties, so AidenRunSSEParser's
minimumEventID call failed the generic-iOS test build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues found in the initializer fix. The existing Android terminal-output rendering finding remains open, so this is not an approval.

Reviewed changes: Reviewed f24cb17a against the previous Pullfrog review at 310d0bee, with the complete current PR diff as context.

  • Added Explicit Parser Initialization. Made AidenSSEFrameParser construction accessible while preserving the default event-ID floor of 1 for ordinary streams and the explicit floor of 0 for run snapshots.

Validation passed: an isolated probe compiled and exercised the production frame parser using Swift 6.4 in Swift 6 mode; npm run test:ios-release passed all 32 Node tests and 20 Ruby tests. Native XCTest execution was unavailable because this Linux runner has no xcodebuild; exact-head iOS build and simulator CI was still running when inspected.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment on lines +2252 to +2254
val current = projection ?: return
if (current.isEnded) return
reconnects += 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 · logic] Initial foreign run observation failure halts reconnection loop and reconnect counter is not reset on Android
Confidence: 0.95

If client.currentRunEvents fails before receiving an event, projection is null and line 2252 returns immediately instead of retrying up to MAX_FOREIGN_RUN_RECONNECTS times, and reconnects is never reset to 0 when receiving frames.

Repair: Check if (projection?.isEnded == true) return to allow retries on initial failure, and reset reconnects = 0 inside feed.collect upon receiving an event.

@sambitcreate
sambitcreate merged commit 2ede9c9 into main Oct 6, 2026
44 of 46 checks passed
@sambitcreate
sambitcreate deleted the feat/remote-phone-run-observe-control branch October 6, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants