Repository navigation
Keep a tab leave-page prompt from wedging task cleanup - #85
Merged
Merged
Conversation
chrome.tabs.remove settles only once Chrome destroys the tab, and a beforeunload prompt can hold it open indefinitely. Finish and close awaited that removal inside the ownership queue, so every later ownership change, browser_open, tab event, and native reconnect stalled behind it. Cleanup now waits at most two seconds for removals after ownership is already persisted, and each queued background operation holds the event queue for at most 30 seconds.
A finish or close the extension did not confirm in time was reported as state_store_error with advice to repair ~/.agenttab or free disk space. Map native cleanup failures by their native error instead, and tell the agent the task is still open and can be finished again once the extension answers.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ad8861962
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
Problem
chrome.tabs.removesettles only after the tab is destroyed. A page beforeunload ("Leave site?") prompt can hold a tab open indefinitely, andbrowser_finish/ task close awaited that removal inside the serial ownership queue. Every later ownership change,browser_open,browser_tabs, tab event, and native reconnect then stalled until the extension was reloaded. The host reported the resulting timeout asstate_store_errorwith advice to repair~/.agenttab.Change
browser_actcloseaction wait at most two seconds for Chrome to remove a tab. A tab still held by its prompt is left out ofclosed_tab_ids/retained_tab_ids(cleanup) or returned asclose_pending: true(close action); its removal stays requested.BoundedChainhelper caps how long a single operation can hold the ownership (10 s), handoff (10 s), and startup event (30 s) queues. An overrunning operation keeps running and is logged; the next operation starts.extension_timeoutwith reload advice and leave the task open; extension refusals (e.g.ownership_denied) pass through their own code and message instead ofnative_protocol_error.Verification
cargo testinhost-rs. New regression tests fail on the previous code.agenttab.finishreturned in 2.0 s with the tab excluded fromclosed_tab_ids; a fresh task then opened, listed, and finished normally.