Skip to content

Clarify that unregistration must not fail an in-flight execution #300

Description

@minjikim89

Follow-up to #248 (merged 2026-08-19), which preserves in-flight executions after unregistration.

A tool whose side effect changes page state may cause the page to unregister that very tool before execute resolves. In our case open_deck flips the store, the store subscription re-syncs registrations, and the abort lands while execute is still on the stack.

Chrome 152 then rejects the caller's executeTool() promise with:

UnknownError: The operation failed for an unknown transient reason

although the tool completed and its side effects are on screen.

Minimal repro shape:

  • a tool that aborts its own registration signal inside execute → fails
  • the same abort deferred by one macrotask → succeeds
  • aborting a different tool's registration → succeeds

Two small asks

  1. State it explicitly in the tool execute steps: a tool removed from the tool map after its execute steps began still delivers its result. Preserve in-flight executions after unregistration #248 implies this, but self-unregistration is the case where an implementer is most likely to read the removal as a cancellation, and the current text does not close that reading.
  2. Add a WPT case for self-unregistration specifically. It is the shape that arises naturally whenever a tool's success changes which tools apply, which is exactly the pattern a page-state-driven toolset encourages.

Chrome's docs indicate 153 preserves in-flight executions. Until that is everywhere, the page-side workaround is to track executing tools and skip only the unregistration of a tool that is currently executing, re-syncing in a fresh task once it returns. Deferring the whole sync also delays registrations that were never at risk (see @mysticalseeker24's reproduction below).

Notes from the build: https://github.com/minjikim89/redline/blob/main/docs/findings.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions