Repository navigation
fix(aiassistant): wait for the Macros panel when saving a macro - #81
Merged
Merged
Conversation
After a reload, the restored conversation shows "Save to Macros" before the lazy-loaded Macros panel is mounted: an early click failed, which made the E2E test flaky in CI. The save now waits for the panel, which exposes its handle only once it has restored the workspace macros: a macro imported during that restoration disappeared from the panel. Assisted-by: Claude Opus 5.5
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.
Summary
The Playwright test AI Assistant — Save to Macros (worker mode) › saves the macro of a conversation restored after a reload fails intermittently: on
develop(run 40705623006, commit 52aabe0) and on the Dependabot PR #79 (marked18.1.1 → 18.1.2, which is not involved). Both runs failed the first attempt and the retry.Root causes and fixes
Macros panel is not available yet("Retry save" / "save failed (see console)"), and the Macros tab stayed hidden. The trace of the failed CI run shows exactly this error.Appnow waits for the panel through a smallPendingHandle(callback ref + bounded wait, 60 s), for Save to Macros and for Convert to macro (notebooks).MacroPanelreplaces its macros, open tabs and active tab with what it listed. A macro imported while it ran was created in the workspace but disappeared from the panel (the hidden-macro symptom of AI Assistant: "Save to Macros" does nothing in worker mode, and the model writes macro code instead of calling the tool #76).MacroPanelnow exposes its handle only once that load is done (useImperativeHandle(loaded ? ref : null, …)), so callers wait for it.No changelog entry: this completes the unreleased AI Assistant — Save to Macros fix (#77), whose entry already covers conversations reopened from the history.
Tests
ai_assistant_macro.spec.tsnow holds theMacroPanel.tsxmodule until the click, which makes the reload scenario deterministic. It fails ondevelopwith the CI symptom and passes with the fix (3 repeated runs).MacroPanel.test.tsx(a macro imported while the workspace macros are restored stays open and active — fails without theMacroPanelchange),pendingHandle.test.ts.prettier,eslint,tsc -b,vitest run(984 passed), Playwrightai_assistant_macro(×3) andmacrospecs; a throwaway probe (deleted) checked Convert to macro from a notebook.