feat(cmux-next): serve remote chat changes in full diff
Merged
TE
10d ago+428+428+012345678901234567890123456789-21-21-01234567890123456789
Lawrence asked for “diff viewer polish (and for it to work in cloud as well).” Leo said, “diff viewer idk what lucas did but we can expand”. This PR carries the owning remote AgentPaneGitLink through the full Diff tab and materializes remote git diffs in the existing page patch transport.
Before:
- A full Diff tab always used
services.agentGit.localand a local sidecar. - A Cloud/SSH/peer chat could show Changes in place, but opening the full Diff tab either failed or risked reading a same-path local checkout.
- Full-file loading and open-file actions were local-only.
After:
- Each chat-opened Diff tab retains its AgentPaneGitLink and uses that daemon for repository status, turn checkpoints, and normal git diffs.
- Remote sessions materialize
git.diff/git.checkpoint.diffinto a token-scoped patch resource; no local sidecar or checkout is consulted. - Remote full-file reads request one path with 100,000 context lines, bounded by the existing daemon limits, and return clear size/remote errors. Remote open-file and mutating local-file operations are refused safely.
- Local tabs keep the existing sidecar path and behavior.
Verification
python3 scripts/cmux-next/prepush-gate.py— passed on75dcb6c31b2e54d48f0c5cdf42efeb41d6112d5f.- Added
DiffViewerGitTests.remoteDiffUsesTheDaemonPatchAndBoundedFileRead, covering a remote provider with no sidecar, remote patch materialization, token-scoped patch URL, bounded full-file context, and remote-only file contents. - Local Swift syntax/test execution was unavailable in this Linux lane (
swiftcis not installed); native compilation and tests must run in PR CI/fleet. - No capture: the fleet capture route is currently blocked by its refused
cmux-capturerunner-name stills; the code path is covered by the focused test above.
Overlap with #22857
The only overlap is the narrow per-tab link/runtime wiring in Packages/macOS/CmuxNext/Sources/CmuxNextApp/Pages/Diff/DiffPageService.swift: Tab.gitLink/Tab.runtime, link selection in open(folder:...), the injected gitLink/runtime parameters on open(repository:...), per-tab runtime selection in prepare/makeView, and the keyed DiffTabHost.repository(at:) lookup. No Lucas-owned files outside this service were changed.
Agent session: agent session