Repository navigation
feat(macos): use shared Rust sidecar for node sessions - #149725
Patrick-Erichsen wants to merge 107 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThe macOS app routes node sessions through a bundled Rust helper with authenticated IPC, while Swift retains credentials, TLS decisions, permissions, and native command execution. Review scores
Merge readiness⛔ Blocked before merge - 6 items remain Keep open: this remains a distinct, protected adoption PR. Positive transport and package evidence is preserved, but the current installed-app authority proof and release qualification remain unfinished. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe macOS node connection receives Gateway commands and dispatches them to native tools or the bundled Bun worker. This change inserts a supervised Rust runtime into that connection while keeping device authority in the app. flowchart LR
A[Gateway commands] --> B[Native socket and TLS]
B --> C[Authenticated Rust helper]
C --> D[Current native authority]
D --> E[macOS tools]
D --> F[Bundled Bun worker]
E --> G[Command results]
F --> G
G --> C
C --> B
Technical reviewBest possible solution: Deliver one supervised node-runtime path with proven final-effect retirement, signed upgrade continuity, and measured resource costs accepted by the native release owner. Do we have a high-confidence way to reproduce the issue? Not applicable: this is runtime adoption rather than a reported existing-behavior bug; the remaining questions concern proof and upgrade qualification. Is this the best way to solve the issue? Unclear: the adapter preserves native authority and reuses the shared Rust owners, but current-app final-effect proof and upgrade/resource qualification are needed to establish adoption safety. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9cc3eee461ed. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (55 earlier review cycles; latest 8 shown)
Reviewed October 2, 2026, 10:09 PM ET / October 3, 2026, 02:09 UTC (Revision 56). |
4679732 to
2c4fa0c
Compare
4e9753f to
73d9956
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
2c4fa0c to
f765a9f
Compare
|
@clawsweeper autofix |
|
🦞🔧
This is fix-only; I will not merge this PR. |
|
Exact-head CI diagnosis for the autofix owner: macOS packages job failed The affected playback code is inherited from #163146 and unchanged by this sidecar diff. The owner-level repair is to retain and synchronously cancel the actual playback task, keeping the existing session-generation fence on completion. This can remove the delayed forwarding wrapper instead of adding another cancellation flag. Please preserve the current assertions and cover both legacy playback and the real backend’s synchronous generation/stop behavior. This is a source-supported diagnosis, not a claimed passing repair; no local competing branch changes are being made while autofix owns the PR. A separate check-guards job exhausted its 20-minute job limit. GitHub records a timeout, with no reported guard violation before cancellation; the unfinished tail is not a pass. Preserve this distinction rather than increasing the timeout or treating a retry as a fix. Current package validation is pinned to this head, so retain the existing base unless an actual conflict or failing-gate repair requires an update. Intel release compiler reproductionThe local universal release build of The triggering expression is xcrun swiftc -swift-version 6 -O -parse-as-library \
-target x86_64-apple-macosx15.0 -emit-object ScopePicker.swiftimport SwiftUI
public struct ScopePicker: View {
@State private var allAgents = false
public init() {}
private var showsAllAgents: Bool { allAgents }
public var body: some View {
Picker("Agent scope", selection: Binding(
get: { self.showsAllAgents }, set: self.setAllAgents)) {
Text("Selected agent").tag(false)
Text("All agents").tag(true)
}
}
private func setAllAgents(_ all: Bool) { allAgents = all }
}Paired compilation on the same VM: the direct setter aborts (exit -6, 0.41 s); replacing only Follow-up validation: the minimal before/after pair also fails/passes for arm64. A separate replay of the complete 172-file Intel release ChatUI module, using the original compiler flags and separately captured outputs, aborts before (120.56 s) and emits all 172 objects after (119.84 s). The setter line is the only authored source difference; the original checkout remains clean. The complete application package is still pending. Repair ownership: the automated repair run stopped before publishing because its offline dependency store lacked two tarballs; it did not publish a fix or passing macOS proof. The supported stop command is now acknowledged, and local repair has resumed without a competing bot writer. |
|
@clawsweeper stop |
|
🦞✅ I added |
Forward the agent-scope value through a closure so Swift 6.3.3 does not reabstract the isolated Bool method reference. The setter and actor ownership remain unchanged. Validation: both architecture minimal reproductions fail before and compile after; the complete 172-file Intel release ChatUI module aborts before and compiles after with the same optimization flags.
Adopt the fixture from upstream 2d1011a verbatim to resolve the overlapping test repair. Production is unchanged. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Makes the macOS app use the shared Rust Gateway client and node runtime from RFC #54 for its node connection by default. The app launches and supervises a bundled Rust helper over authenticated, bounded IPC.
Why This Change Was Made
Swift keeps credentials, device identity, TLS policy, permissions and native callbacks; the bundled Bun worker keeps its existing commands. Helper startup, cancellation and shutdown follow the native connection's lifetime. Other operator Gateway connections remain native.
User Impact
Missing, incompatible or invalidly signed helpers visibly prevent node startup, with no silent Swift fallback. Absent native results remain distinct from explicit JSON null. Rust handlers adopt
Ok(Some(value))/Ok(None); in-tree consumers are migrated. Gateway and sidecar-v1 wire formats remain unchanged, with no user-state or database-schema migration.Code reduction was not achieved. Against pinned main
b79ec83d3351, production is +4,602/−751: net +3,851 LOC for the native adapter, authenticated IPC and lifecycle ownership. Tests/support add a net 8,044 lines; build/CI/config +289, docs +92 and lockfiles +13. Accounting covers all 94 changed paths and separates embedded Rust tests. Memory parity, speedup and lower battery use remain unproven.Evidence
Head:
db7b080a224. Validation remains in progress.6f763ea7238: canonical build and independent audit pass, with 24 runtime-readiness records, all six binaries containing arm64/x86_64 slices, strict deep ad-hoc signatures, matching app/runtime identity and ZIP/DMG/dSYM artifacts. No observed child survivors. Later commits throughdb7b080a224change tests only; the package retains its real 6f identity.e085d29ab880r2 completes canonical universal packaging, 24 readiness records, six universal binaries, signature verification and ZIP/DMG/dSYM checks. Its surrounding process monitor fails withps ETIMEDOUT, while the canonical child exits 0. Failed monitoring evidence remains unchanged. Separate artifact verification now passes in 40 seconds: all 41,770 files and nine symlinks match the retained ZIP, source identity and signatures pass, and the verifier exits naturally with no observed survivors. The original monitor stays failed; no continuous-process-observation claim.Local raw receipts, inventories and failed attempts are retained. Current installation inventory SHA256:
4561feb4dc84a4153a4d6d71858106a4857d8fd86acbc455ca0c332c27e3b989; source inventory:43e1e99233f61c0b276ce5a8d7d3b962c52881433b831d6a2bba26273d9a8249. Separate Swift qualification:9620ab731d4bd022b6046a7cafee4279a8ce2198f0cfc9414269b8459971a4c0; completed verification owner:4b9d4a21b9c70c65bd198b0929b44d9fae5694a0018647124728699197361601.Still required before a merge-ready claim:
e085d29ab880, fresh build r2, versus Rust 6f with the same Bun/source base. Both exact packages are verified and their complete contents compared; ABBA startup/idle/steady memory and CPU measurements remain open. The original A monitoring gap and independent native/UI build differences remain explicit limits.Retained failures and limits
A r1 failed with ENOSPC during universal Bun staging. Its failed build and process-observation timeout remain retained; a separate fresh kernel census found no unresolved or surviving target-tree executables. A r2 is a fresh attempt with unchanged source. Its package succeeds, but its monitor separately fails; error timing/count are unknown because that monitor retains only the first error. Neither failed owner is relabeled as passed. The initial native-probe attempt also remains failed: its private checker incorrectly expected tracked protocol models. The fresh r2 chain instead validates immutable generator inputs and generated output.
After the successful verifier finished, concurrent read-only evidence exports timed out in Parallels. A normal guest restart restored the transport; sequential compressed exports passed full raw-content hashes and initial/final identity checks. Failed partial exports remain retained. No product or benchmark workload was running during recovery.
Earlier CI exposed a missing asset-manifest fixture, terminal bootstrap polling races, a Swift compiler crash and queued playback escaping replacement. Repairs retain the original assertions and production deadlines; the relevant completed CI/local results are above. Compiler diagnosis and paired proof. A separate earlier startup fixture was corrected to await the existing connection deadline; production limits were unchanged.
Historical packaged-app UI/lifecycle results belong to 57fd090 with the older Bun. They cover dispatch, Pause/Resume, held Canvas, cold-start cancellation, Gateway restart and Quit, but cannot establish the newly linked 6f app works. Historical failed/inconclusive census and callback attempts remain separate. Screenshots were inspected live; no durable historical video/image artifact is claimed.
Startup peak is not proven fixed: deep signature verification still creates temporary
codesignwork. Count observed children in the startup cohort; 100 ms samples can miss shorter peaks. Summed process footprint is not unique machine memory. Independently built A/B resource differences must remain visible as attribution limits; neither historical package nor fixture timings establish current battery or performance improvement.The review's stored-data checklist refers to test proof JSON; this PR changes no user database/state schema. Mandatory adoption is authorized, but that does not establish acceptance of unmeasured resource costs.