Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(mobile): port worktree setup progress and agent handoff #12177

Mergedjuliusmarmingemerged 1 commit intomobile-worktree-setup/cancellation fromrefs/pull/12177/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Mobile only reported “Setting up worktree…” during a task’s worktree bootstrap. It now shows the four setup stages beneath the working header, with timing and checkout progress, and a Details trigger that opens a native sheet with setup script output. iOS uses a UIKit navigation bar with Done; Android uses a native Material bottom sheet. Cancellation and Work locally remain in the sheet.

Match the web handoff: once the agent’s turn is live, the stage list collapses. A setup script that continues in the background moves into a small header control that opens Details. A clean finish removes setup; failures stay reachable. The working pill remains during agent work and is suppressed only while the setup header owns progress. Reuse the existing web visibility rules through client-runtime without changing web behavior.

Validation: 383 focused mobile and web behavior tests pass; mobile, web, and client-runtime typechecks pass; targeted lint has no errors. React Doctor reports no errors (91/100, four warnings about branching and the fixed four-row sheet). The maintainer verified the preview build on a physical iPhone and confirmed the final handoff behavior works. Cancellation settlement is covered separately by the lower PR.

UI evidence: the maintainer explicitly waived fresh matching base/head screenshots and the interaction recording after verifying the preview on a physical iPhone. The earlier simulator artifacts are unavailable and are not being presented as current evidence.

Implemented with GPT-6 in Codex.

Summary by CodeRabbit

  • New Features

    • Added visible worktree setup progress to mobile thread views, including setup phases, elapsed time, failures, cancellation, and available actions.
    • Setup details can be opened in a dedicated sheet, with progress information and setup output.
    • Setup transitions to a compact working status once the agent starts.
    • Worktree setup state remains visible and consistent across live updates and recorded thread activity.
  • Bug Fixes

    • Prevented duplicate setup entries from appearing in thread feeds.
    • Preserved setup failure visibility in the dedicated setup display.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—13.6 KiB—15.1 KiB✅
      CodexThread snapshot wire—7.1 KiB—7.3 KiB✅
      CodexLive turn WebSocket wire—6.6 KiB—7.8 KiB✅
      CodexLive turn WebSocket decoded—57.1 KiB—66.4 KiB✅
      CodexLive turn messages—10—21✅
      ClaudeTotal thread wire—13.6 KiB—15.1 KiB✅
      ClaudeThread snapshot wire—7.1 KiB—7.3 KiB✅
      ClaudeLive turn WebSocket wire—6.6 KiB—7.8 KiB✅
      ClaudeLive turn WebSocket decoded—57.9 KiB—66.4 KiB✅
      ClaudeLive turn messages—10—21✅

      Baseline: unavailable · PR result: 917c389 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.9 KiB
      • Claude decoded thread snapshot: 114.6 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds substantial mobile worktree setup UI and changes bootstrap cancellation and local handoff behavior across mobile and shared client-runtime code. The workflow is not a small isolated change, and unresolved high-severity findings concern whether the local fallback is exposed and actually enqueued.

      Adjust the Minimum Blocking Severity for this repo — including turning it Off — in [Settings](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Team

      Run ID: 2a71a1c1-c560-440b-8976-e74a36fed58f

      📥 Commits

      Reviewing files that changed from the base of the PR and between 51c0812a4536387f4d0ea50dca179fb750153354 and 917c3895895b1341ebbb24a6bcabc25b397de9cc.

      📒 Files selected for processing (14)
      • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
      • apps/mobile/src/features/threads/ThreadFeed.tsx
      • apps/mobile/src/features/threads/ThreadRouteScreen.tsx
      • apps/mobile/src/features/threads/use-worktree-setup.ts
      • apps/mobile/src/features/threads/worktree-setup-card.tsx
      • apps/mobile/src/features/threads/worktree-setup-sheet.android.tsx
      • apps/mobile/src/features/threads/worktree-setup-sheet.tsx
      • apps/mobile/src/lib/threadActivity.test.ts
      • apps/mobile/src/lib/threadActivity.ts
      • apps/web/src/components/ChatView.logic.ts
      • apps/web/src/components/chat/MessagesTimeline.logic.ts
      • packages/client-runtime/package.json
      • packages/client-runtime/src/work-log/presentation.ts
      • packages/client-runtime/src/worktreeSetup.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


      📝 Walkthrough

      Walkthrough

      Changes

      The change centralizes worktree setup state resolution, adds mobile setup progress and action UI, integrates setup content into thread feeds, and reuses the runtime helpers in web code.

      Worktree setup integration

      Layer / File(s)Summary
      Shared setup state and exports
      packages/client-runtime/..., apps/web/src/components/...
      The client runtime decodes setup snapshots, resolves visible state, and reports agent handoff. Web components re-export these helpers.
      Mobile setup orchestration
      apps/mobile/src/features/threads/use-worktree-setup.ts, apps/mobile/src/features/threads/ThreadRouteScreen.tsx, apps/mobile/src/features/threads/ThreadDetailScreen.tsx
      The mobile route combines recorded and live setup state, handles cancellation and local conversion, and passes setup data and actions to thread details.
      Setup card and native sheets
      apps/mobile/src/features/threads/worktree-setup-card.tsx, apps/mobile/src/features/threads/worktree-setup-sheet*
      The mobile UI displays setup stages, timing, output, failures, and available actions in native sheets.
      Feed placement and activity filtering
      apps/mobile/src/features/threads/ThreadFeed.tsx, apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts
      The feed places setup content after the first user message or in the header, suppresses the empty state, and omits worktree setup error rows with regression coverage.

      Priority: ➖ Normal

      Estimated code review effort: 4 (Complex) | ~45 minutes

      Change: Feature

      Suggested reviewers: t3dotgg

      Sequence Diagram(s)

      sequenceDiagram
        participant ThreadRouteScreen
        participant useWorktreeSetup
        participant ThreadDetailScreen
        participant ThreadFeed
        participant WorktreeSetupCard
        ThreadRouteScreen->>useWorktreeSetup: resolve live and recorded setup state
        useWorktreeSetup-->>ThreadRouteScreen: return visible setup snapshot
        ThreadRouteScreen->>ThreadDetailScreen: pass snapshot and setup actions
        ThreadDetailScreen->>ThreadFeed: pass setup data and timing
        ThreadFeed->>WorktreeSetupCard: render setup content at feed anchor

      Merge Risk: ⚪ Minimal · up to 917c3

      No actionable current-head defect remains; the change is ready for normal merge checks.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 13 files. (1 skipped:…Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely identifies the mobile worktree setup progress and agent handoff changes.
      Description check✅ PassedThe description explains the implementation, rationale, UI behavior, validation results, and evidence status. It omits the template headings and checklist, but it provides the required information in …
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Full details: Docstring Coverage

      Explanation

      Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 13 files. (1 skipped: 1 unsupported.)

      • Fix all pre-merge checks with AI
      ✨ Finishing Touches 💡 1
      📝 Generate docstrings 💡
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `mobile-worktree-setup/ui`

      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge merged this4abb07e

    6. juliusmarminge closed this

Sign in to join this conversation.