Skip to content

Fix iOS rendered terminal scrolling and replay reconstruction - #7905

Open
azooz2003-bit wants to merge 104 commits into
mainfrom
feat-ios-scroll-rows-arch
Open

Fix iOS rendered terminal scrolling and replay reconstruction#7905
azooz2003-bit wants to merge 104 commits into
mainfrom
feat-ios-scroll-rows-arch

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make mobile terminal scroll delivery revisioned, independently queued, and direction-aware
  • prefetch bounded 600/120 history windows in both directions
  • reconstruct full replay frames at an explicit absolute scrollback position
  • reject stale mount, connection, render, input, and interaction revisions

Ghostty dependency: manaflow-ai/ghostty#107

Verification

  • Packages/iOS/CmuxMobileShell: 418 tests in 35 suites passed
  • Packages/Shared/CMUXMobileCore: 148 tests in 10 suites passed
  • Packages/iOS/CmuxMobileRPC: 76 tests in 9 suites passed
  • tagged macOS build iscrl passed
  • dedicated iOS Simulator build passed on 48F127C0-4E28-4118-AA0A-9255F812BE29
  • regression is split into failing-test commit d238b7c933 and fix commit 2e0a315c4f

Dogfood

Use the paired iscrl build with the 15k fast log, 12k reversal markers, and 10k diff history workspaces. Fast reverse scroll, reconnect mid-history, background/foreground, rotate, and return to the newest row.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

High Risk
Large refactor of mobile terminal output, scroll reconciliation, and Mac RPC wire format; regressions would show as wrong viewport, cursor, or history after fast scroll, reconnect, or typing.

Overview
Reworks iOS remote terminal scrolling and sync so gestures, clicks, and typing share one per-surface interaction owner instead of independent fire-and-forget RPCs.

Render-grid protocol gains render_revision, scroll-forward history (scrollforward_rows / spans), and richer cursor metadata (location, active_row). Replay now stitches older → viewport → newer history and restores cursor position with legacy fallbacks when metadata is missing. MobileTerminalScrollRun and typed MobileTerminalScrollResponse support ordered run batches and epoch/revision reconciliation with the Mac.

Output delivery moves from raw byte chunks to MobileTerminalSurfaceMutation (output, local scroll, scroll-to-bottom, barriers) with delivery IDs, optimistic scroll coalescing, scroll-reconciliation supersession, deferred live grids during in-flight scroll, and render_revision staleness floors alongside existing byte-seq checks. Cold replay and scroll RPCs pass bidirectional prefetch windows (e.g. 600/120 rows).

Text/paste/image input and viewport clears are routed through the scroll session with interaction_epoch; RPC client disconnect is deferred while input requests are in flight.

Reviewed by Cursor Bugbot for commit cbe892f. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes iOS terminal scroll ordering, replay, and render continuity with bounded, direction‑aware per‑surface transactions and strict geometry/output ordering. Isolates render‑event overflow to the affected topic and keeps other streams and sinks alive; pins ghostty to the bounded, cursor‑aware render‑grid build.

  • New Features

    • Ordered per‑surface scroll transactions with directional runs, client revisions, and a 600ms aggregate plan (up to 3×200ms RPCs).
    • Bidirectional history with scroll‑forward rows for exact replay/cursor restore; off‑main render‑grid preparation; hosts advertise terminal.scroll.ordered_runs.v1.
    • Bounded, per‑topic event streaming with explicit termination reasons; MobileEventEnvelope pre‑extracts surfaceID for pre‑decode ordering.
  • Bug Fixes

    • Preserved replay ordering during grid preparation/rotation; live frames defer until matching reconciliation; one bottom snap per episode.
    • Fast reversals keep rows ordered; stale/out‑of‑order/revisionless frames drop behind live floors; prior‑epoch replays force a fresh large‑window replay.
    • Local scrolls coalesce with bounded deadlines; stalled local scroll apply times out and auto‑recovers; clicks wait for authoritative apply and a surface barrier.
    • Enforced causal authoritative scrollback positioning so replay placement and immediate reversal render in order.

Written for commit 736eb39. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added per-surface optimistic terminal scrolling sessions with authoritative reconciliation.
    • Added directional ordered scroll runs and bidirectional prefetching (older + newer history).
    • Added render-revision tracking, scroll-forward metadata, and more accurate replay/viewport positioning.
    • Extended terminal output chunks with delivery IDs and optional scrollback offset hints.
  • Bug Fixes
    • Improved replay composition and reduced incorrect/stale scroll-frame application to prevent duplicate/regressive rows.
    • Strengthened stale/epoch validation across scroll and render-grid deliveries.
  • Tests
    • Expanded scroll response decoding, epoch/revision behavior, replay prefetch, delivery queue scenarios, and reversal liveness coverage.

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jul 17, 2026 5:47pm
cmux-staging Building Building Preview, Comment Jul 17, 2026 5:47pm

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Terminal scrolling now supports directional runs, bidirectional history prefetching, interaction epochs, render revisions, optimistic local scrolling, authoritative reconciliation, mount-safe output delivery, and replay recovery across shared models, host RPCs, iOS rendering, tests, and Ghostty integration.

Changes

Terminal scroll synchronization

Layer / File(s) Summary
Render-grid contracts and replay encoding
Packages/Shared/CMUXMobileCore/..., Packages/iOS/CmuxMobileRPC/..., Packages/macOS/CmuxTerminal/...
Render grids now carry revisions and forward-history spans, serialize and validate them, and replay older, visible, and newer rows.
Host scroll protocol and epoch fences
Sources/TerminalController*, ghostty, docs/ghostty-fork.md
Host requests support directional runs, interaction epochs, bidirectional prefetch windows, and stamped authoritative revisions.
Scroll session and delivery reconciliation
Packages/iOS/CmuxMobileShell/...
iOS sessions coordinate optimistic local application, remote requests, revision matching, deferred grids, delivery claims, replay barriers, and mount lifecycle.
Surface scroll and ordered output application
Packages/iOS/CmuxMobileTerminal/..., Packages/iOS/CmuxMobileShellUI/...
Ghostty applies queued scroll operations, positions authoritative viewports, processes ordered output with offsets, and recovers timed-out operations.
Scroll synchronization validation
Packages/iOS/*/Tests/..., ios/cmuxUITests/...
Tests cover session reconciliation, replay epochs, delivery ordering, prefetch parameters, local scrolling, stream replacement, and rapid adversarial reversals.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: lawrencecchen


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error TerminalController+MobileScrollPrefetch.swift adds hardcoded API error text (“Invalid terminal scroll runs”) without localization backing. Localize the new error with String(localized:defaultValue:) and add matching Resources/*.xcstrings entries for every supported locale.
Docstring Coverage ⚠️ Warning Docstring coverage is 21.20% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (23 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed New scroll models are plain Sendable structs; session/store code is explicitly @MainActor, and the only Sendable classes are lock-backed or @unchecked with rationale.
Cmux Swift Blocking Runtime ✅ Passed Added runtime code uses async/continuation-based coordination; no new semaphores, sleeps, asyncAfter, main.sync, or manual locks in production diff. Test-only polling remains allowed.
Cmux Browser Automation Off-Main ✅ Passed PR diff touches mobile terminal scroll/render files only; TerminalController changes are epoch/prefetch logic, with no browser.* socket automation routing or WebKit-wait code modified.
Cmux Expensive Synchronous Load ✅ Passed Touched Swift files only add terminal-scroll queue/session logic; no agent-history loaders, large JSON/JSONL parsing, or SharedLiveAgentIndex calls were added onto MainActor/interactive paths.
Cmux Cache Substitution Correctness ✅ Passed PASS: The new scroll/replay caches are freshness-checked—stale render grids trigger replay, cold misses fall through, and optimistic deliveries are gated by deliveryID/revision.
Cmux No Hacky Sleeps ✅ Passed Only Swift source/test files and a TSV budget file changed; no TS/JS/shell/build/runtime scripts were modified, so the no-hacky-sleeps rule doesn’t apply.
Cmux Algorithmic Complexity ✅ Passed New collection work is single-pass or explicitly bounded (256 journal runs, 32 ordered runs, 600/120 prefetch); no hot path adds nested rescans of the same scalable collection.
Cmux Swift Concurrency ✅ Passed New Task use is stored/cancelled in TerminalScrollSession or tied to callback boundaries; no new Combine or background-queue app code appeared.
Cmux Swift @Concurrent ✅ Passed No changed Swift symbol is a new nonisolated async without @concurrent; added async work is MainActor/UI-bound or explicitly hops to worker queues.
Cmux Swift File And Package Boundaries ✅ Passed PASS: New production files are small/focused and core scroll logic lives in packages; oversized files are existing and only saw modest glue/state updates.
Cmux Swiftpm Lockfiles ✅ Passed Only the vendored ghostty submodule pointer changed; no cmux .gitignore, package-local/root Package.resolved, or Xcode package-reference files were modified.
Cmux Swift Logging ✅ Passed The PR diffs add no print/debugPrint/dump/NSLog or Logger-call lines in runtime Swift; the changes are scroll/replay logic only.
Cmux User-Facing Error Privacy ✅ Passed Added user-facing terminal-scroll errors are generic (“Terminal surface not found”, “Invalid terminal scroll runs”); no vendor names, tokens, or raw upstream messages appear.
Cmux Swiftui State Layout ✅ Passed The only changed path is the ghostty submodule link; no SwiftUI view/state/layout code was modified.
Cmux Architecture Rethink ✅ Passed The PR centralizes scroll ownership in TerminalScrollSession and uses required UIKit/AsyncStream bridges; it adds no new sleeps, polling, or delayed repair paths.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR only changes mobile terminal scroll/render code; exact diff search found no new/changed NSWindow, NSPanel, WindowGroup, or cmuxAuxiliaryWindowIdentifiers assignments.
Cmux Source Artifacts ✅ Passed All changed paths are intentional source, tests, or repo config; no logs, screenshots, temp folders, caches, or build artifacts were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed No new test/debug seam was added in production Sources; the only debug-named addition lives in a dedicated Debug file guarded by #if DEBUG.
Cmux No Ambient Global State ✅ Passed No new file-scope API or singleton was added; the new scroll state lives on TerminalController/TerminalScrollSession, and helper funcs are extension methods.
Title check ✅ Passed The title clearly matches the main change: fixing iOS terminal scrolling and replay reconstruction.
Description check ✅ Passed The description covers the summary and verification well, though the demo video, review trigger, and checklist sections are not fully filled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-ios-scroll-rows-arch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalOutputDelivery.swift Outdated
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reworks iOS terminal scrolling and replay synchronization. The main changes are:

  • Revision-aware render-grid and scroll reconciliation.
  • Ordered, direction-preserving scroll delivery.
  • Bounded history prefetch in both directions.
  • Full replay reconstruction with cursor and active-screen metadata.
  • Stale event rejection across input, rendering, and connection lifecycles.

Confidence Score: 5/5

This looks safe to merge.

  • The malformed-grid response no longer advances state with an unusable frame.
  • Queue failure recovery clears pending reconciliation and fences stale completions.
  • Equal-revision recovery replays are explicitly allowed after gridless acknowledgements.
  • No blocking issue remains in the changed paths reviewed here.

Important Files Changed

Filename Overview
Packages/iOS/CmuxMobileRPC/Sources/CmuxMobileRPC/MobileTerminalScrollResponse.swift Malformed nested render grids now fail the whole response decode instead of retaining revision metadata.
Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalScrollSession.swift Scroll interactions now use ordered revisions, bounded queues, epoch fencing, and replay-based recovery.
Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalOutputReconciliation.swift Gridless acknowledgements and deferred frames now use an explicit equal-revision replay allowance.
Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/MobileTerminalRenderGridReplay.swift Replay reconstruction now combines older history, the viewport, newer history, and the active-screen suffix.

Reviews (46): Last reviewed commit: "build: pin bounded render grid Ghostty" | Re-trigger Greptile

interactionEpoch = try container.decodeIfPresent(UInt64.self, forKey: .interactionEpoch)
clientScrollRevision = try container.decodeIfPresent(UInt64.self, forKey: .clientScrollRevision)
renderRevision = try container.decodeIfPresent(UInt64.self, forKey: .renderRevision)
renderGrid = try? container.decodeIfPresent(MobileTerminalRenderGridFrame.self, forKey: .renderGrid)

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.

P1 Malformed Grid Advances Revision Floor

When render_grid is present but fails to decode, try? silently converts it to nil while retaining accepted and render_revision. The session then completes reconciliation and advances the revision floor without applying the authoritative frame, so a later valid event at that revision is rejected as stale and the optimistic viewport can remain visible.

Suggested change
renderGrid = try? container.decodeIfPresent(MobileTerminalRenderGridFrame.self, forKey: .renderGrid)
renderGrid = try container.decodeIfPresent(MobileTerminalRenderGridFrame.self, forKey: .renderGrid)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verified on current HEAD: decoding now uses throwing decodeIfPresent, and scrollResponseRejectsMalformedNestedRenderGrid covers the malformed nested frame. The response cannot advance reconciliation after a malformed grid.

— Claude Code

prefetchWindow: prefetchWindow(for: lines)
)
isAwaitingAuthoritativeReconciliation = true
guard enqueueLocal(request) else { return }

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.

P1 Rejected Batch Leaves Barrier Active

If a long reversing gesture fills the directional-run bound, this return happens after the revision is incremented and authoritative reconciliation is marked pending, but before the remote request is queued. No response can reconcile that revision, so live render-grid events remain deferred until another lifecycle event happens to reset or settle the session.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verified non-actionable on current HEAD. enqueueLocal calls recoverFromLaneFailure when append rejects the bounded journal; invalidate clears isAwaitingAuthoritativeReconciliation and requests replay before submit returns. journalOverflowRecoversCleanly asserts the cleared barrier and replay epoch.

— Claude Code

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ghostty`:
- Line 1: Push ghostty submodule commit 267824293722b63a13513a923031ac1090b7de88
to origin/main, then retain this gitlink pointer so fresh checkouts and CI can
resolve the referenced commit.

In
`@Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite.swift`:
- Around line 7092-7121: Extract the stale-epoch handling branch from the
response closure in requestTerminalReplay into a focused helper, preserving its
logging, in-flight cleanup, barrier-aware retry, barrier clearing, and
early-return behavior. Pass the existing surface, request, epoch, barrier, and
dropped-output values through the helper so the branch remains independently
testable without changing adjacent sequence-staleness or delivery logic.

In
`@Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalOutputDeliveryQueueTests.swift`:
- Around line 61-64: Replace the fixed `Task.yield()` loop following
`oldConsumer.cancel()` and `await oldConsumer.value` with the existing
`pollUntil(...)` helper, polling the actual predicate that confirms the old
consumer has been unregistered or cleanup has completed before continuing
assertions.

In
`@Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalScrollSessionTests.swift`:
- Around line 217-221: Replace the fixed-count Task.yield loop in settleTasks
with a deadline-bounded predicate polling helper, following the established
pollUntil pattern. Update every call site to await settleUntil with the concrete
state predicate needed before each assertion, such as pending remote work, and
require the result before accessing state. Remove blind settleTasks-based
synchronization while preserving the existing test assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4caa1010-0b21-4ce7-aa70-dd09b7cd0823

📥 Commits

Reviewing files that changed from the base of the PR and between 005d453 and 2e0a315.

📒 Files selected for processing (34)
  • Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/MobileTerminalRenderGrid.swift
  • Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/MobileTerminalRenderGridReplay.swift
  • Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/MobileTerminalScrollRun.swift
  • Packages/Shared/CMUXMobileCore/Tests/CMUXMobileCoreTests/MobileTerminalRenderGridTests.swift
  • Packages/iOS/CmuxMobileRPC/Sources/CmuxMobileRPC/MobileTerminalScrollResponse.swift
  • Packages/iOS/CmuxMobileRPC/Tests/CmuxMobileRPCTests/MobileTerminalDTODecodeTests.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalOutputDelivery.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalScrollDelivery.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalViewport.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalOutputDelivery.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalScrollDelivery.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalScrollSession.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/MobileShellRenderGridLivenessTestSupport.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalOutputDeliveryQueueTests.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalReplayPrefetchTests.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalScrollDeliveryQueueTests.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalScrollReplayEpochTests.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalScrollSessionTests.swift
  • Packages/iOS/CmuxMobileShellModel/Sources/CmuxMobileShellModel/MobileTerminalOutputSinking.swift
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/GhosttySurfaceRepresentable.swift
  • Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView+LocalScrollbackScroll.swift
  • Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView+RenderRecovery.swift
  • Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift
  • Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceViewDelegate.swift
  • Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceWorkSnapshot.swift
  • Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+Mobile.swift
  • Sources/Mobile/MobileTerminalRenderObserver.swift
  • Sources/TerminalController+MobileScrollPrefetch.swift
  • Sources/TerminalController.swift
  • docs/ghostty-fork.md
  • ghostty
  • ios/cmuxPackage/Tests/cmuxFeatureTests/TerminalInputScrollToBottomTests.swift
  • ios/cmuxUITests/cmuxUITests.swift
💤 Files with no reviewable changes (2)
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalScrollDeliveryQueueTests.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalScrollDelivery.swift

Comment thread ghostty Outdated
@@ -1 +1 @@
Subproject commit e215e78bf04df3f7cecbef665eec051a203baf6a
Subproject commit 267824293722b63a13513a923031ac1090b7de88

@coderabbitai coderabbitai Bot Jul 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
cd ghostty || { echo "ghostty submodule dir not found"; exit 1; }
git fetch origin --quiet 2>/dev/null || true
echo "Pinned commit from parent:"
git -C .. ls-tree HEAD ghostty
TARGET=267824293722b63a13513a923031ac1090b7de88
echo "Commit exists locally?"; git cat-file -t "$TARGET" 2>/dev/null || echo "MISSING"
echo "Ancestor of origin/main?"; git merge-base --is-ancestor "$TARGET" origin/main 2>/dev/null && echo "yes" || echo "NO/unknown"
git remote -v

Repository: manaflow-ai/cmux

Length of output: 425


🏁 Script executed:

#!/bin/bash
set -euo pipefail

cd ghostty

echo "Remote main tip:"
git ls-remote origin refs/heads/main

echo
echo "Fetch remote main into local refs (read-only):"
git fetch origin main:refs/remotes/origin/main --quiet

TARGET=267824293722b63a13513a923031ac1090b7de88

echo
echo "Does origin/main contain the target commit?"
if git merge-base --is-ancestor "$TARGET" origin/main; then
  echo yes
else
  echo no
fi

echo
echo "Commit metadata:"
git show -s --format='%H %D %s' "$TARGET"

Repository: manaflow-ai/cmux

Length of output: 476


Push the ghostty submodule commit to origin/main before landing this pointer. 267824293722b63a13513a923031ac1090b7de88 is on origin/feat/mobile-render-grid-bidirectional, not origin/main, so this gitlink can be orphaned for fresh checkouts and CI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ghostty` at line 1, Push ghostty submodule commit
267824293722b63a13513a923031ac1090b7de88 to origin/main, then retain this
gitlink pointer so fresh checkouts and CI can resolve the referenced commit.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The commit is reachable from origin/feat/mobile-render-grid-bidirectional and dependency PR manaflow-ai/ghostty#107 is open, clean, and separately awaiting merge authorization. This review loop is explicitly not authorized to merge that PR or push Ghostty main, so the dependency remains tracked here.

— Claude Code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@azooz2003-bit Thanks for the context — that makes sense. Since 267824293722b63a13513a923031ac1090b7de88 is reachable from origin/feat/mobile-render-grid-bidirectional and tracked via ghostty#107, and merging that upstream branch is outside this review's scope/authority, I'll leave this as-is for now.

Just flagging for visibility: this repo's ghostty gitlink will remain unresolvable for anyone doing a fresh checkout (including CI) until ghostty#107 is merged to main. Worth treating that merge as a hard prerequisite before landing this PR, so the pointer doesn't go stale/orphaned in the meantime.

Comment thread Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalOutputDelivery.swift Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalOutputDelivery.swift`:
- Around line 231-234: Replace the eager filtering and reallocation in
discardPendingOptimisticScrollDeliveries with lazy generation invalidation:
advance the optimistic-scroll generation/state there without scanning pending.
Update popPending to skip and discard stale supersedable deliveries during
traversal, while preserving barriers and non-supersedable entries; ensure
repeated scroll intents traverse the queue amortized linearly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e5187888-787f-4af0-b8cc-81bec68e221e

📥 Commits

Reviewing files that changed from the base of the PR and between ead974f and 3548e5e.

📒 Files selected for processing (5)
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalOutputReconciliation.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalOutputStream.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalOutputDelivery.swift
  • Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalScrollSession.swift
  • Packages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/TerminalOutputDeliveryScrollTests.swift

Comment thread Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/TerminalOutputDelivery.swift Outdated
@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

blacksmith-sh Bot commented Jul 14, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs

Fix with Codesmith
Need help on this PR? Tag /codesmith with what you need.

cmux reload-cloud added 3 commits July 14, 2026 14:28
…arch

# Conflicts:
#	Packages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite.swift
#	Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/GhosttySurfaceRepresentable.swift
#	Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView+LocalScrollbackScroll.swift
#	Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+Mobile.swift
#	docs/ghostty-fork.md
#	ghostty
#	scripts/ghosttykit-checksums.txt
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (124 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

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.

1 participant