Fix web macro page hanging infinitely#2447
Merged
Merged
Conversation
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.
Fix infinite hang on Macro Library page
The browser extension's Macro Library page hung forever on the loading spinner even though the agent held dozens of stored web flows. The cause was a three-layer regression:
(1) the agent's discovery handler required an active browser session and instantiated an LLM translator for every action, including pure-store ones like getAllWebFlows that never touch the browser;
(2) the front-end response parser returned the service worker's error envelope as if it were the macros array, crashing on .forEach;
(3) the catch handler referenced a stale element ID left over from when the page was renamed from "actions library" to "macros library", so the error display itself threw and never cleared the spinner.
The fix addresses all three layers: store-only discovery actions short-circuit before the browser-session check, the response parser type-guards the result and throws on error envelopes, and the catch block reuses the already-captured container so future failures surface as a useful error rather than another hang.