Repository navigation
fix(native): wait for MCP app teardown before inline close - #209
Merged
Merged
Conversation
Open
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.
An inline MCP app's close notification previously removed its host immediately, so resource cleanup never ran. Port the web host's initialized-only
ui/resource-teardownrequest and matching result/error response handling, with its 2,000 ms deadline.The pure host settles once and discards late completions after disposal. The native bridge owns one cancellable deadline, checks document generations for messages and deadlines, and releases the receiver and host on close. Show app creates a fresh document. This covers the native inline notification/Show app entry point and preserves environment-bound requests through AppConnection.
TR-MCPAPP remains partial; refs #98, which stays open. Remaining gaps: fullscreen/pip, ui/message, model-context UI, downloads, device permissions/dialogs, live theme updates, and live WebKit verification. Viewport detach, eviction, and unmount still dispose immediately; graceful cleanup there requires a compatible WebView lifetime and is deliberately not claimed.
Validation on head
f791bab30612692905eabe5b6975d52109ce6772, rebased once onto actual native15ae309a5e3ef31f4403543ef355290ec3642618: strictcargo clippy --workspace --all-targets -- -D warnings;cargo test --workspace(1,364 tests); normal and snapshot builds; theme generation check; 42 parity tests; conformance generation check; scoped Rust/ledger formatting; deterministic example and offscreen bridge audit. Two behavior tests failed first on 8408 before the fix (prior-8408/red.log).check:changedwas deliberately not run because its repo-wide fallback is prohibited by this assignment; the parent-only root gate was not run here. These skips are not claimed green.Local evidence only (no uploads or committed assets):
/private/tmp/native-factory-2f5f764a/98-teardown/before-current.png— built head before the audit; offscreen fallback only./private/tmp/native-factory-2f5f764a/98-teardown/after.png— actual bridge audit reaches closed/Show app./private/tmp/native-factory-2f5f764a/98-teardown/reopened.png— renderer click on Show app restores the offscreen fallback./private/tmp/native-factory-2f5f764a/98-teardown/transcript.log— deterministic, no-network host example: request → one deadline → result/error/explicit timeout → Close; late acknowledgement/deadline ignored; uninitialized close sends nothing./private/tmp/native-factory-2f5f764a/98-teardown/after.log— offscreen bridge callback audit for result/error/explicit deadline, stale generations, cancellation, and detach disposal. This bypasses WebKit transport and does not prove live JavaScript delivery./private/tmp/native-factory-2f5f764a/98-teardown/provenance.json— exact base/head, source and PNG hashes. Earlier 8408 runs are retained separately underprior-8408/.No real window, new server, provider turn, clipboard, live install, or real-data server was used. Captures use a copied worktree smoke home and the existing 14658 server for read subscriptions.
Built with GPT-6.1 Sol in Codex