Repository navigation
fix(gateway): retain late update handoff failures - #148159
vincentkoc wants to merge 4863 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: ClawSweeper could not verify the complete source for this revision. ClawSweeper will not retry this unchanged revision. Next step: No contributor action is requested. Maintainers should inspect the linked workflow run. |
|
@fuller-stack-dev Jason, this draft child preserves late managed-update failure details and keeps separate failures from replacing each other in reports. The parent has 111 scoped tests and four type jobs green; this child's 20-case file and types remain unrun. Source reviews are clean, but native/published-driver and before/after proof gaps remain. Not merge-ready. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 2:48 AM ET / 06:48 UTC. ClawSweeper reviewWhat this changesPreserves late managed-update errors in Gateway responses and reports, using a separate diagnostic step to retain earlier failures. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this member-authored PR retains useful work beyond current main, but its new diagnostic write can silently do nothing after real cancellation finalizes the run. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway accepts update requests and hands managed installations to an updater helper. Its restart notice and durable update ledger supply status, lifecycle notifications, and failure reports. flowchart TD
A[Update request] --> B[Gateway update handler]
B --> C[Managed updater helper]
B --> D[Persist restart notice]
D --> E{Transfer succeeds?}
E -->|Yes| C
E -->|No| F[Cancel helper and retain error]
F --> G[Update ledger and reports]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +20, Tests +196. Total +216 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain distinct sanitized failure facts through the existing reporting owner before helper settlement makes the ledger immutable, while guaranteeing cancellation and preserving terminal-outcome ownership. Do we have a high-confidence way to reproduce the issue? Yes, from source: fail restart-notice persistence after helper admission, then let real cancellation finish the run before the new step write. Execution was not performed. Is this the best way to solve the issue? No, not as written: a distinct step preserves separate causes only while the ledger accepts writes; the implementation must account for cancellation terminalizing that ledger. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7bc487d39dc9. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…able (#155354) Closes #155298 ## What Problem This Solves Fixes: Matrix progress and tool-activity updates disappear when an asynchronous draft callback cannot access the plugin runtime, even though the final reply still arrives. ## User Impact User impact: Matrix progress streaming can send and edit previews using its retained account settings and client. Final delivery, encryption, mention handling, and oversized-preview fallback keep their existing behavior; no configuration or migration is needed. ## Why This Change Was Made Single-event text preparation now calls the existing SDK table-mode and chunk-limit resolvers directly instead of reaching those same functions through the plugin runtime. The account, configuration, native-table setting, and Matrix event-size cap are unchanged. Multi-message chunking remains outside this repair. The existing partial-preview test now exercises the actual draft send/edit path with the runtime unavailable. Its shared client fixtures move unchanged into test support so the oversized send suite does not grow further. ## Evidence - [The reporter's normal Gateway before/after logs](#155298) show `Matrix runtime not initialized` before the two helper substitutions, then successful encrypted assistant/tool progress sends afterward on OpenClaw 2026.9.5. These are retained reporter observations, not a newly repeated live Matrix run. The SDK exports and runtime facade select the same resolver implementations. - On baseline `80b9608a25e191a17e1466d750c2f76a38a38507`, the strengthened consumer regression fails at the real draft callback with `Matrix runtime not initialized`. With the repair, it sends and edits the same threaded draft with retained account limits, keeps mention-looking tool text inert, and stops an oversized preview without another event. - Focused validation: 106 send tests, 20 draft-stream tests, and the narrow SDK import guard passed (127 total; 42.36s wall). The strengthened consumer case took 17ms. Extension production/test typechecks, scoped type-aware lint, source-size/assertion ratchets, and whitespace checks passed. - The first hosted run exposed six failures in the per-wire authority fixture: it still supplied a five-character limit through the removed runtime lookup. The fixture now sets the existing Matrix chunk-limit configuration instead. All ten real HTTP authority/redirect cases pass, including revocation between chunks, with durable delivery both enabled and disabled (27.65s wall). Its test-type lane and scoped lint/format checks also pass; production code is unchanged. - No new live credentials or encrypted transport replay was used. The retained Gateway evidence establishes the reported transport outcome; the local regression covers the consumer boundary with a client fixture. Hosted test timing is not yet available for this revision. Co-authored-by: Ayaan Zaidi <[email protected]>
* fix(files): keep skill and worker downloads inside staging * refactor(skills): use fs-safe for bounded download staging Delegate skill download staging to the released fs-safe Root.create API while retaining the 256 MiB limit, checksum-before-publication ordering, ordinary file mode and pinned destination root. The fetch guard remains the response cancellation owner. * chore(skills): integrate the main inspection lint fix Merge the observed main revision containing the fix for the plugin inspection lint failures found by PR CI. Preserve the reviewed Skills-only change and published branch ancestry while refreshing the PR base through a conventional merge. * chore(skills): incorporate the compile-cache fixture repair Merge current main with the landed compile-cache fixture cache-isolation repair. Preserve the reviewed three-file Skills download cleanup and the existing branch ancestry. The fixture keeps its timeout and policy assertions unchanged. * chore: incorporate verified shared main repairs * chore(skills): incorporate the clock-jump fixture preparation Co-authored-by: Peter Steinberger <[email protected]>
The isolated stream fixture paid for the shared native worker graph, then transformed the Gateway and reply runtime again inside its 240-second case. PR #155606 run 35717163540, job 106711837964 timed out without a completed scenario. A two-CPU, CI-memory-class replay with the recorded caches and CPU contention reproduced the deadline: the server import consumed 104.6 seconds and reply-runtime startup was still pending at timeout. Host the full Gateway through the existing prepared native fixture and its managed process/state lifetime. Keep the real HTTP provider, WebSocket RPCs, all seven scenarios and assertions, per-PR routing, and every existing test and RPC timeout. Explicitly disable the helper's minimal-Gateway shortcut. Validation: 20 standalone passes, three full 23-file/297-test shard passes, and 26 fixture-owner/sibling tests. The same high-contention probe passes in 72.1 seconds instead of timing out at 240 seconds. Removing the original terminal-event guard makes the native fixture fail its four compatible-text assertions; restoring it passes all seven scenarios. One-worker cost is 27.63 seconds wall and 6.19 seconds test time. P2 review and scoped static checks pass, including the type-aware lint canary.
* fix(plugins): preserve retirement failure attribution Keep host hook failures attributed to their hooks when instance and cache retirement observers report the same underlying error. Preserve physical settlement failures and retain distinct error objects with identical messages. Align catalog and web provider lifetime proofs with the existing forced retirement and structured provider-error contracts. Verify retained publication custody, captured-file reads, physical cleanup, and rejection after release. Validation: 192 lifecycle sibling tests, full changed checks, individual test cost measurements, and independent P2 review. * test(plugins): verify retirement identities and capture reads Preserve every cleanup row and its original error reference when distinct failures share a message. Prove each retained web search call reads and parses its captured file even when retirement revokes the final result. Retain the shared production owner already landed in #154823 and omit native-catalog assertions covered by current retained-consumer tests. The two existing test files pass all nine cases. Fault-injection controls confirm the strengthened assertions catch three prior blind spots, and selected changed checks plus independent review pass. Co-authored-by: Peter Steinberger <[email protected]>
* fix(skills): move upload staging and install leases into workers * test(state): discriminate retired lease cleanup commands * fix(skills): check upload expiry after worker admission
…hanges (#155648) Closes #155647 ## What Problem This Solves Fixes meeting-browser elapsed-time budgets changing when the system wall clock moves forward or backward. ## User Impact Queued browser actions no longer lose their opportunity to run after a forward clock adjustment, and a rollback no longer grants extra time to downstream browser requests. Existing configured limits, tab ownership and permissions remain unchanged. ## Why This Change Was Made Use `performance.now()` consistently in the existing browser-operation queue and its deadline-producing callers: join, recovery, leave, transcript collection, audio control and runtime probes. Keep request budgets in whole milliseconds and leave epoch timestamps unchanged. No new timer owner, SDK export, configuration option, persisted state or permission is introduced. ## Evidence The published `openclaw/plugin-sdk/meeting-runtime` entry point drove a built, normal Gateway's authenticated `browser.request` method and an isolated managed Chromium profile against a task-owned local page. The browser transport was real, not a mocked lock callback. Only the SDK driver's `Date.now()` changed; Gateway, CLI, Chromium and host clocks did not. All three cells used the same 4,000 ms operation budget: | Case | Baseline `0ed077d` | Candidate `f6f2232` | | --- | --- | --- | | Ordinary clock | Both real browser actions completed | Both completed | | Forward step, +60 s while queued | The first action finished 380 ms after the step, but the queued second action never reached the browser; the caller eventually reported a timeout | Both actions completed; queued completion took 1.373 s | | Backward step, −60 s while queued | The browser request received 63,725 ms and incorrectly succeeded after 5.297 s of page execution | The request received 3,713 ms and returned the real Gateway `UNAVAILABLE` / `browser request timed out` error; no second completion was shown on the page | The complete candidate proof took 50.9 s. Gateway and browser processes settled and their ports closed. CLI startup and return overhead are included in recorded elapsed times: this is not a claim that the entire SDK call finishes within exactly four seconds. The proof covers the shared SDK/browser path, not a Google Meet, Teams, audio-device or other vendor-native meeting session. Two existing join/recovery consumer regressions failed before the repair (one evaluation instead of two; a rollback expanding a 500 ms recovery budget to 60,250 ms). Afterward, all 24 focused tests across five existing files passed in 24.59 s; the two changed cases took 3 ms and 2 ms. The affected `core-test-other` type project, scoped type-aware lint, formatting, whitespace and both ratchets passed. The exact candidate build passed in 286.74 s. Hosted CI also exposed a test-clock mismatch in the Google Meet caption transport's zero-elapsed fixture. That existing fixture now controls `performance.now()` rather than `Date.now()`, preserving all caption-finalization, state, pinned-route, scope, minimum/maximum-budget and exact 5,000 ms grace assertions. Its 17 tests passed in 39.86 s, and the actual extension test-type project passed in 18.74 s. Production code and all recorded runtime inputs remain byte-identical to the `f6f2232` browser proof above; no new browser execution or rebuild is claimed for this test-only correction. Co-authored-by: Ayaan Zaidi <[email protected]>
…152057) * feat(browser): unify local Chrome setup across desktop and terminal Co-authored-by: fuller-stack-dev <[email protected]> * feat(browser): unify local Chrome setup across desktop and terminal OpenClaw-Publication: d19e865e-b5a0-4c70-8876-c1662f6e7ef2 Co-authored-by: fuller-stack-dev <[email protected]> * chore(linux): format Chrome setup fixture Co-authored-by: fuller-stack-dev <[email protected]> * feat(browser): keep desktop Chrome setup local and preserve pairing Delegate Windows registration to the shared native management owner, preserve released native bridge compatibility and saved launcher profiles, and integrate serialized desktop setup through isolated local runtimes. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(browser): repair native setup CI contracts Keep Windows installer dependencies acyclic, validate Unicode within the package library target, and remove unused private exports. Require all eight packaged native-host proof cases and update lazy CLI inventory. Apply native Swift formatter diagnostics without changing behavior. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test(cli): account for plugin-owned browser extension catalog Keep the core-only registration invariant aligned with the Browser plugin owner already exercised by its lazy registration tests. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test(macos): retain released Chrome bridge request expectation Align the native bridge test with the shipped contract1 request retained by the canonical setup owner, and reject extra legacy payload fields. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test(tui): give command handler harness a unique export Rename the shared TUI test helper and both consumers to avoid the Gateway placement harness export collision. No alias or guard waiver. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * chore(sdk): allow canonical browser config path resolver Apply the approved single public-export and callable allowance for resolveConfigPath. Preserve canonical pre-config path ownership and all other SDK surface checks. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(browser): preserve desktop setup selection and supported actions Keep native automatic setup selector-free and resolve saved local browser selection through the canonical setup owner before installation. Respect Mac action advertisements and the released legacy install projection in the Apps card, and document the public config-path resolver contract. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(auth): retry model selection after concurrent credential refresh Adopt upstream PR #152426, commit 32298b1, without changing its five source files. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test: preserve native setup selection and await dashboard document Match the selector-free native CLI arguments exactly and preserve a saved work-profile result. Wait through the existing document-readiness owner only at the quota test browser-proof boundary, after auth assertions. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(ui): avoid preloading already imported modules Remove exact direct static JavaScript imports from lazy preload tables using the emitted build graph. Preserve HTML, lazy-only JavaScript, CSS, and locale hints. Source-exact CI merge reproduction drops startup gzip from 363283 to 362968 bytes without changing budgets. Add a real emitted-bundle regression. Apply rustfmt layout to the native Chrome selector-free expected arguments. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix: preserve Chrome profiles and attachment follow-up branch binding Let the TUI canonical setup controller retain its saved browser profile and project only a bounded returned name. Align both native first-run fixture expectations with selector-free setup. Join pending chat history before the composer task handoff can expose an admitted attachment to restored-outbox delivery. Preserve idempotency, attachment custody, restored delivery semantics, and all existing assertions and timeouts. Add a deterministic regression reproduced on the exact failed CI merge and its main parent. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test(state): adopt canonical worker-custody fixture repair Adopt src/plugin-state/plugin-state-worker.test.ts byte-for-byte from upstream bfec65a (#152456). The former fixture held its late competing owner until after awaiting off-thread acquisition. Preserve that overlap, assert continued host authority checks and noncompletion, release custody, then assert the original result and persisted state. No production locking, guard, deadline or outcome assertion is relaxed. Both prior failures reproduced on the exact CI main parent with independently installed frozen dependencies and Node 24.19.0. All 12 repaired file tests, selected state-logging types, scoped typed lint and fresh P0-P2 review passed. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(browser): retain saved Windows setup profiles Recover configured extension profiles through bounded serial read-only C# inspection. Select only independently validated current matching descriptors, confirm the selected generation before effects, and leave the single mutation under the existing C# owner. Preserve POSIX behavior, existing manual relay verification and explicit same-profile repair. Missing descriptors, runtime/origin drift and unknown or changing observations fail closed without automatic mutation. Keep raw management facts private and populate the existing browserProfile field only from validated binding metadata. No ABI, schema, SDK, configuration flag or registry/activation owner change. 29 actual CLI/controller/Windows-adapter boundary cases plus sibling coverage: 94 tests pass. Canonical changed checks, full production build and fresh independent P0-P2 review passed. Actual C# native proof remains separately coordinated. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(browser): preserve saved profiles after POSIX bundle relocation Separate validated native registration ownership from supported origin-migration readiness. Recover the profile only after full private manifest and exact launcher validation; preserve the existing one-slot migration rule and all unsupported-origin, ACL and foreign-host refusals. Fail closed before selector-free installation when the saved selection cannot be proved. Extract the unchanged shared origin helpers into a cohesive sibling to satisfy the existing line-cap guard without waivers. Windows admission, ABI and selector behavior remain unchanged. Actual Linux/Darwin CLI-to-filesystem relocation regressions: 18 failures on original production, all 22 cases repaired. Preserve the private relay key and inode, config, Chrome preferences, work relay19444 and explicit-profile intent. 137 focused tests, eight real POSIX native-host E2E cases, canonical changed checks, full production build and fresh P0-P2 review passed. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(ui): retain input handoff through the shared outbox owner Remove the superseded pending-history no-yield workaround after main introduced foreground submission custody in the shared outbox owner. Restore chat-submit-guard.ts exactly to pinned main cc7 rather than retaining competing timing policies. Keep passive drains fenced while the input task yields. Preserve the retained history regression with explicit MessageChannel admission, no passive send before resume, and the same terminal leaf, idempotency key, attachment bytes and exactly-once assertions after completion. Original composed source fails all five focused cases; the repair passes 67 handoff/attachment cases and 20 real Chromium cases in the canonical secretless network-none runner. Canonical checks, UI build/performance and fresh P0-P2 review pass. No assertion, timeout, origin or proxy-policy weakening. Browser POSIX/Windows repairs remain byte-identical to accepted255f. The failed e40e CI receipts remain preserved; fresh exact-head CI and parent handoff are still required. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(tasks): preserve reads across native event finalization Hand joined event publication to its exact native successor after the native flow and observer publication frame completes. Keep worker settlement and cleanup, reversible claim transfer, current-authority and ABA checks, and post-commit delivery in their existing owners without replaying writes. Cover pre-result and readback finalization, native and reentrant successor chains, rollback, failed publication, delivery, and terminal activity cleanup. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test(ui): retain rail baseline geometry on readiness failure Keep the exact existing readiness predicate, fixtures, case inventory, assertion and timeout. When the predicate is false, retain synthetic marker identity and numeric geometry so hosted CI can distinguish scroll, visibility and viewport failures. This is diagnostic evidence, not a repair or waiver of the unresolved rail failure. Local rootless browser infrastructure is unavailable; the existing hosted CI lane will verify the reviewed task-publication repair and collect meaningful rail evidence. Canonical changed checks and P0-P2 diagnostic review pass. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * docs(linux): describe saved-profile Chrome setup selection Match the selector-free adapter argument vector and its regression test. Address the fresh P3 review finding without changing runtime behavior. Markdown syntax and diff checks pass; the generic formatter excludes this subtree. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * test(transcripts): join configured startup before cleanup faults Observe and await the real startTranscripts promise through a narrow call-through spy while retaining the configured service entry point and real SQLite/provider work. Bind the await to the existing test lifetime instead of charging startup to the subsequent short active-map poll. Gate provider return after persisted utterance to prove readiness does not settle early; retain both missing/unreadable row injections and all cleanup, private-source, lifecycle-token and summary assertions. Cover real startup rejection explicitly. No production change, timeout increase, retries or broad module/storage mocks. The deterministic ordering boundary fails with the old fire-and-forget readiness and passes with the real promise join. Final 39 tests across 3 files, canonical changed checks and full-owner P0-P2 review pass. This does not recover whether the historical CI startup was late or rejected. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> * fix(browser): preserve automatic desktop status inspection Restore read-only Device-page inspection for current and released Mac bridges while keeping installation and verification explicit. Preserve the native filesystem prerequisite proof, split installer repair tests within the existing line cap, and remove the superseded constant export. * fix(browser): preserve registered setup configuration Require canonical setup to match an owned launcher's effective state and config selection before installation or relay access. Preserve equivalent implicit/explicit default selections and the saved launch context. Recheck automatic profile selection before effects and the current manifest before publication through the existing registration owner. Keep manual install and relocation repair contracts unchanged. Cover mismatched configs, legacy selectors, equivalent defaults, selection drift, and actual bootstrap after refused setup. Restore the missing Command import in the existing Unix-only companion CLI test. Focused tests, types, lint, fresh review, clean package build and sealed Mac ARM64 runtime proof pass. The separate historical clock-jump CI failure has bounded replay evidence and remains documented without a speculative fix. Co-authored-by: fuller-stack-dev <[email protected]> * fix(browser): keep setup registration types acyclic Move the private registration status contract beside its context policy and point both consumers at that owner. Remove the publication-module back-edge without keeping an unused compatibility export. The full architecture gate, extension production/test types, typed lint and fresh independent review pass. Node's transformed JavaScript is byte-identical for all three affected modules, so the existing runtime proof remains valid. Co-authored-by: fuller-stack-dev <[email protected]> * test(linux): handle Chrome setup in desktop sharing fixture Recognize the exact automatic Chrome setup invocation and require its native no-respawn flag. Keep unknown-command rejection, selected-auth validation, process-group ownership and joined teardown assertions unchanged. The original fixture reproduces the CI rejection against the real Linux app. The repaired fixture passes all nine checks against that same binary, with five Chrome setup calls and five node starts and joined stops. Fresh review is clean; production app behavior is unchanged. Co-authored-by: fuller-stack-dev <[email protected]> --------- Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
) * fix(android): isolate camera captures and preview staged photos Serialize camera captures at their process-wide owner, revalidate access after asynchronous work, and release request-owned CameraX resources. Preview admitted composer images through the bounded local-image path without relaxing incoming inline limits or replacing the image viewer. Co-authored-by: IWhatsskill <[email protected]> Co-authored-by: VACInc <[email protected]> * test(android): cover camera cancellation and recovery Exercise the public camera handlers across contention, lifecycle stop, cancellation and subsequent capture admission. Assert request-owned CameraX bindings and temporary files are released. Production behavior is unchanged. Co-authored-by: IWhatsskill <[email protected]> * fix(android): size forked Robolectric test workers explicitly Give Android application test workers a bounded 1 GiB heap rather than inheriting Gradle’s implicit 512 MiB default. The Gradle daemon heap is separate. Full-suite heap analysis reproduced the playout allocation failure and traced dominant retained memory to framework SDK resources and instrumentation. Preserve test order, assertions, PCM fixture, SDKs and application runtime limits. Co-authored-by: IWhatsskill <[email protected]> --------- Co-authored-by: IWhatsskill <[email protected]> Co-authored-by: VACInc <[email protected]>
) Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
* perf(ui): reduce automatic session list refetches Batch session event invalidations over fixed five-second windows and preserve explicit navigation refreshes. Keep cached selected-session lineage from invalidating managed child lists while retaining fresh-read and Gateway-event invalidation. * perf(ui): align browser and gateway refresh proof Advance controlled test clocks through the five-second refresh boundary, preserve pre-boundary no-request assertions, and await decoded attachment readiness before opening the recovery account picker. * perf(ui): cover paced refreshes in gateway event tests * perf(ui): keep undo available during queued refresh proof
Keep healthy automatically selected auth profiles across conversation compaction for both explicit orders and implicit pools. Remove compaction-only auth-state writes while preserving failure-driven failover, preferred-profile recovery, route isolation, and user/person-linked pins. The universal behavior change and security-sensitive revision were explicitly approved by Josh. Exact-head hosted CI and required security gates passed. Co-authored-by: Jason O'Neal <[email protected]> Co-authored-by: jalehman <[email protected]>
Keep the Gateway's failed finalization reason in the helper's first terminal ledger write. Retain requested-step refusal handling and leave ordinary cancellation unchanged. Exercise real generated helper IPC and source SQLite ledger across five distinct failure and cancellation controls.
Related: #145388, #145499.
Stacked on #148117; this PR targets that parent branch, not
main.Ready for review; not merge-ready until the parent stack, native/no-loss acceptance, and exact-head hosted CI/review finish.
What Problem This Solves
A late restart-notice or ownership-transfer failure can lose its original cause when cancellation or a later history write also fails. The real helper can also publish a first terminal
skipped/cancelledhistory row after the Gateway has already recorded the distinct late failure; a later writer cannot correct that immutable terminal outcome.User Impact
Update results and durable failure reports retain the initiating cause. An incompletely saved outcome stays visible instead of announcing that the update finished. No new configuration, schema, protocol, or update authority is introduced. The original reported incidents are not claimed reproduced or resolved.
Why This Change Was Made
Record the distinct late failure before joining real cancellation, preserve the cause through secondary failures, and clear the campaign only after observing a terminal outcome. The helper's cancellation write preserves either a failed admission refusal or a failed late finalization. Ordinary cancellation, successful finalization, and unrelated diagnostic failures retain their existing behavior; no early terminal write is introduced.
This successor preserves Vincent Koc's original contribution and branch ancestry, incorporates the reviewed parent, and resolves the qualified current-main overlap. The unmanaged restart-notice cause-detail gap remains outside this change.
Evidence
Signed candidate
f355b8403f34fe8f08fd841e2bfa92e625a967d1follows0272acc9d7328ff54cb94b114086765155a65b81without rewriting contributor ancestry.skippeddefect. With unchanged assertions, the signed candidate now passes all three real installed launchd/RPC cases: transfer failure (98.28s), sentinel failure (41.29s), and secondary cancellation rejection (71.74s). Each remained running while cancellation was held, retained the original failed finalization after settlement, kept the same serving Gateway PID available, and joined the actual helper/executor with the lease absent. The supported package build and tarball integrity checks passed; source/package/installed-file/process identities were bound.b458db5a27c716c4b7a2e4e1564119de315b4701; the local stacked comparison has 22,972 paths. Downstream skipped checks are not passes. Parent publication and legitimate stack reconciliation remain required; no guard bypass or blind retry.