Repository navigation
Fix PTT higher-model context and cache boundary - #9734
Merged
Git-on-my-level merged 1 commit intoJul 14, 2026
Merged
Git-on-my-level merged 1 commit into
Git-on-my-level merged 1 commit into
Conversation
This was referenced Jul 14, 2026
9 tasks
kodjima33
added a commit
that referenced
this pull request
Jul 15, 2026
…9748) #9734 gated `ask_higher_model` on every field of the prefetched kernel snapshot being non-empty, including the rendered context, the plan identities, and the semantic guidance. Rendered context is context *material*, not an availability signal. `KernelVoiceContextSnapshot.isResolved` says so explicitly: "A valid new conversation may render no text, but it still has a kernel session and a deterministic freshness identity." So on the first PTT turn of a session — nothing in the journal yet, so `renderedContext` is empty — the guard fell through to `.failed(kernel_context_unavailable)` and the user got a refusal instead of an answer. `RealtimeHubTools.escalationBody` already omits each empty section on its own (`testBodyOmitsContextSectionWhenEmpty`), so that path was unreachable, not unsafe. Gate on the snapshot's own resolution contract instead: a kernel session bound to the current owner scope plus a freshness identity. The `.empty` transport-failure sentinel and an owner-scope mismatch both still fail closed, which is what the guard was for. Verification: xcrun swift build -c debug (clean); swift test --filter HubEscalationTests (4/4, incl. 2 new); --filter "RealtimeHub|RuntimeOwnerIdentity|KernelTurnRecordedProjection|FloatingControlBarState" (164 tests, 0 failures); make preflight (8/8).
This was referenced Jul 15, 2026
undivisible
pushed a commit
that referenced
this pull request
Aug 20, 2026
…body (#9744) (#10965) repo-checks.yml ran the manifest on main pushes with --skip-pr-body-checks, so product-invariants (and failure-class-protocol) were silently skipped — even though GitHub folds the PR description, including locked invariant citations like INV-CHAT-1, into the merge commit message. A main-push Hygiene run therefore could not verify citations at all (#9734 merged with the IDs in its body, yet the post-merge run reported them missing). Pass the merge-commit body through --pr-body-file instead. Fail-closed is preserved: a direct push whose commit message omits required invariant IDs still fails product-invariants. Updates the two wiring regression guards in test_run_checks.py: the main-push path must now pass --pr-body-file (not --skip-pr-body-checks), and body-requiring checks must be selected when a body is supplied. Failure-Class: none Co-authored-by: CommandCodeBot <[email protected]>
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.
Follow-up to #9680 and #9698.
Summary
ask_higher_modelthrough the controller's owner-scoped kernel snapshot and reject escalation when that typed plan is unavailable.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 --checkcargo 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.pyomi-ptt-escalationwith./run.sh --yolo; automation bridge exercisedptt_startthenptt_stopsuccessfully. The available profile was signed out, so an authenticated higher-model response could not be exercised end-to-end.xcrun swift test --package-path Desktopran 2,477 tests and reproducibly has one unrelated environment-specific failure:AgentRuntimeProcessTests.testOpenClawDiscoveryFindsXDGFnmInstalldiscovers the machine-global/opt/homebrew/bin/openclawinstead of its XDG fnm fixture.Product invariants
INV-CHAT-1INV-VOICE-1