executeTool() defines completionSteps with an assertion that it runs [=in parallel=], then removes an entry from the traversable navigable's pending tool executions map.
Six of its seven invocations run on a Document event loop: the tool-execute path, both early exits in imperative execute steps, and the promise-reaction paths. This contradicts both the assertion and the map's note that it is only mutated from parallel steps.
A focused repair is to run the body of completionSteps in parallel, preserving its current result handling while making the map mutation conform to the stated invariant. This is distinct from the cancellation-semantics proposals in #299 and #300.
executeTool()definescompletionStepswith an assertion that it runs [=in parallel=], then removes an entry from the traversable navigable's pending tool executions map.Six of its seven invocations run on a Document event loop: the tool-execute path, both early exits in imperative execute steps, and the promise-reaction paths. This contradicts both the assertion and the map's note that it is only mutated from parallel steps.
A focused repair is to run the body of
completionStepsin parallel, preserving its current result handling while making the map mutation conform to the stated invariant. This is distinct from the cancellation-semantics proposals in #299 and #300.