Repository navigation
fix(macos): converge agent runtime contracts - #9698
Merged
Merged
Conversation
Git-on-my-level
force-pushed
the
codex/agent-runtime-contract-convergence
branch
from
July 14, 2026 12:02
9ca62ee to
8230433
Compare
Member
Author
Monitor run summaryThis run rebased the branch onto the latest What changed: branch history only (rebase onto Verification: all CI checks pass on the new head ( |
This was referenced Jul 14, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Jul 14, 2026
Follow-up to #9680 and #9698. ## Summary - Route PTT `ask_higher_model` through the controller's owner-scoped kernel snapshot and reject escalation when that typed plan is unavailable. - Place typed semantic guidance and the cache-boundary marker in the system contract, while retaining realtime-tool context as explicitly untrusted user content. - Split the Rust cache boundary before the dynamic snapshot so the provider can cache only the stable escalation policy. ## Root cause and durable guard #9698 established typed cache contracts and canonical conversation context, but the PTT higher-model path still accepted `command.input["context"]` as its escalation context. That input comes from the realtime model and is not the controller's owner-scoped snapshot, so it could be stale or incomplete. The tool input is user-scoped, not privileged, but it must not replace the canonical context contract. The controller now builds higher-model requests exclusively from the current owner-scoped kernel plan. Request-builder coverage asserts that the canonical snapshot and typed cache marker stay in the system contract while tool context is labelled untrusted user content. Rust coverage asserts that a dynamic snapshot after the marker is never marked cacheable. ## Verification - `cargo fmt --manifest-path desktop/macos/Backend-Rust/Cargo.toml --check` - `cargo test --manifest-path desktop/macos/Backend-Rust/Cargo.toml` (362 passed) - `xcrun swift test --package-path Desktop --filter 'HubEscalationTests|DesktopCoordinatorServiceTests'` (34 passed) - `python3 desktop/macos/scripts/check_desktop_test_quality.py` - Launched named bundle `omi-ptt-escalation` with `./run.sh --yolo`; automation bridge exercised `ptt_start` then `ptt_stop` successfully. The available profile was signed out, so an authenticated higher-model response could not be exercised end-to-end. - Full `xcrun swift test --package-path Desktop` ran 2,477 tests and reproducibly has one unrelated environment-specific failure: `AgentRuntimeProcessTests.testOpenClawDiscoveryFindsXDGFnmInstall` discovers the machine-global `/opt/homebrew/bin/openclaw` instead of its XDG fnm fixture. ## Product invariants - `INV-CHAT-1` - `INV-VOICE-1` <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/9734?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dependency
This builds on #9675, the PTT spawn-authority restoration, which has landed on
mainand supplies the reused kernel-restore seam and fixture/guard conventions.Root cause and durable guard
The runtime had multiple Swift and Node result boundaries that could independently reinterpret lifecycle or tool results, leaving dead-end startup failures, unbounded or lost projections, and divergent ledger/provider outcomes. Prior fixes in this failure class fixed individual routes without establishing a shared contract boundary.
This change centralizes lifecycle and result finalization, makes tool provenance artifact-backed and canonical, and guards it with shared Node/Swift fixtures, a 620 KiB persistence regression, an end-to-end Swift result/ledger test, a sequence fuzzer, the agent-logic harness, and the preflight check manifest.
Verification
cd desktop/macos/agent && npm test -- --run && npm run build(47 files, 555 tests)cd desktop/macos && xcrun swift test --package-path Desktop(2,436 tests)cd desktop/macos && bash ./scripts/agent-logic-harness.sh --cross-surface-smokecd desktop/macos/Backend-Rust && cargo test routes::realtime::testsbash desktop/macos/scripts/test-tool-surfaces.shpython3 desktop/macos/scripts/check-agent-runtime-convergence-ratchet.pyomi-agent-runtime-contract-prlaunched with its bridge on port 47975 and navigated to Chat; the final runtime code was confirmed in the packaged bundle. The bundle was signed out because no reusable Omi Dev auth existed.Product invariants affected
Closes #9688
Closes #9658
Closes #9342
Closes #8461
Closes #9033
Closes #9680