Closed bug report

fusion_new_electronics_from_eagle: Open dialog is never filled, reply says it was cancelled but it stays up and blocks Fusion

Andy Engevold · 12d ago ·closed by Colby Knox

Summary

fusion_new_electronics_from_eagle {schPath, brdPath} fires ImportSCHAndBRDCmd, finds Fusion's native Windows Open dialog, and never puts the path into it. The File name box stays empty and the dialog stays on the Documents root. The verb then returns failure saying it cancelled the dialog, but the dialog is still on screen and Fusion's main thread stays blocked until the dialog is closed by hwnd. This is 4 of 4 attempts on bridge 1.13.21 (and the same error string on 1.13.14 earlier the same evening). It looks like a regression or a new variant of closed #90: the dialog is now detected, but it is not driven and not really closed.

Environment

  • fusion-bridge 1.13.21 (readinessOwner exe), Fusion add-in 1.0.26 (expectedAddinVersion 1.0.26, addinStale false)
  • Adom Bridge 2.1.168 and Hydrogen 1.0.666 (as noted on Oct 29), Windows 11 PC with the Adom-Workspace WSL container
  • Caller: adom-aiflow 0.2.26, adom-aiflow fusion schematic (Fusion lane)
  • Fusion 360 build: not captured (fusion_get_app_state does not report it)

fusion_readiness (via fusion_status alias) right before the run:

{"addinStale":false,"addinVersion":"1.0.26","aliasOf":"fusion_readiness","bridgeVersion":"1.13.21","expectedAddinVersion":"1.0.26","hostApp":"Fusion 360","installed":true,"installing":false,"kicadIngest":false,"lastReadyAt":"2026-10-29T20:25:22","lastSignedInAt":"2026-10-29T20:25:22","readinessOwner":"exe","ready":true,"running":true,"statusVerb":"fusion_get_app_state","success":true,"timeoutSeconds":60}

Exact calls

AI Flow (tools/fusion-project.py around lines 970 to 984) makes these two bridge calls:

  1. fusion_board_seed {libraryPath, outDir, name:"Seed", title, outlineMm, fixed, rules} succeeds and writes Seed.sch (4.5 KB) and Seed.brd (14.8 KB) into one space-free folder on the C drive: C:\Users\<user>\Documents\AdomAiFlow\<run>\design\. Both files exist on disk after the failure.
  2. fusion_new_electronics_from_eagle {"schPath": "<that folder>/Seed.sch", "brdPath": "<that folder>/Seed.brd"}, then polls fusion_eagle_import_status {runId} until the stage is not running.

The import status result error, as surfaced by AI Flow:

the design import did not finish: Fusion's Open dialog did not accept 'Seed.sch' (it was not in the folder the dialog showed, or the name did not match); the bridge cancelled the dialog so nothing is left on screen.

That text is the open_dialog_stuck branch in new_electronics_from_eagle (rust/bridge/src/orchestrations.rs), so the reply carries "errorCode": "open_dialog_stuck", "wanted": "Seed.sch", "imported": [] and the _hint "Nothing was imported. Put the .sch and .brd together in one space-free folder, pass both absolute paths, and retry; or use the dialog-free routes ...". The full raw reply JSON was not preserved by the caller, only the error string above.

Actual

  • The Windows Open dialog (title "Open", filter "All supported files") sits at the Documents root with an empty File name box. The bridge did not type the full path and did not browse to the folder. The inputs already meet the hint's conditions (both files together, absolute paths, no spaces in the folder), so the hint's advice does not apply.
  • The reply says "the bridge cancelled the dialog so nothing is left on screen", but the dialog is still open. The desktop_close_window {hwnd} step after the 8 second wait did not close it.
  • While the dialog is up, fusion_get_app_state fails with main_thread_busy (run_modeling_script "from another bridge/session").
  • fusion_dismiss_blocking_dialogs returns "No blocking Fusion dialog is open" (count 0), while fusion_check_dialogs reports 1 open dialog (kind file_dialog, resolution "cancelled safely with WM_CLOSE"). The two verbs disagree, and neither one actually clears it.
  • Only fusion_close_window {hwnd} sent by hand cleared the dialog and freed Fusion.
  • Each attempt leaves two empty "Untitled" electronics documents open.

Expected

  • The bridge fills the File name box with the full path and submits it, as the code intends (desktop_ui_set on the "File name:" Edit with submit), or the fallback click route works.
  • If that fails, the dialog really is closed before the verb returns, and the reply does not claim it was cancelled unless the dialog is gone.
  • fusion_dismiss_blocking_dialogs treats a leftover native Open dialog as blocking and closes it, consistent with fusion_check_dialogs.
  • The empty seed documents created by the failed import are closed.

Repro

4 of 4 attempts on Oct 29, 2026 across two separate AI Flow runs on the same PC. The second attempt of the second run was from a clean Fusion session (half-finished designs closed, no dialogs open). Earlier the same evening the same error string appeared 3 times on bridge 1.13.14, so it is not a one-off.

Steps: in a clean Fusion session, call fusion_board_seed to write Seed.sch and Seed.brd to a space-free folder, then call fusion_new_electronics_from_eagle with both absolute paths and poll fusion_eagle_import_status.

Workaround

None that keeps the caller's flow. The schematic stage is blocked, so placement, routing and DRC cannot run. The _hint points at fusion_open_board {filePath} and fusion_schematic {action:"open"} as dialog-free routes, but AI Flow's schematic stage calls fusion_new_electronics_from_eagle, so the run stops here. STEP imports reportedly go through the same dialog path.

Related: #90 (closed), where this verb raised an Open dialog the bridge could not see.

4 Replies

Colby Knox · 12d ago

fusion-lane: confirmed as a bridge bug. Thanks for the detailed report, Andy. It isn't fixed by anything released since 1.13.21; the current public build is 1.13.38. Taking it first thing next session. What's wrong, from your report and the code:

  1. The Open dialog is found but never driven. The File name box is never filled and submitted. So the open_dialog_stuck reply, and its hint about space-free folders, fires even though your inputs were right.
  2. The reply claims a cancel it didn't achieve. The desktop_close_window after the wait doesn't close Fusion's native Open dialog, and the verb doesn't check that the dialog is gone before saying so.
  3. fusion_dismiss_blocking_dialogs and fusion_check_dialogs disagree. Check lists the native Open dialog (#32770), but dismiss doesn't count it as blocking.
  4. The two empty Untitled documents from the failed import aren't closed.

The fix (next session):

  • fill the File name box with the full path and submit, verified by the dialog going away;
  • if that fails, close the dialog and confirm it's gone before replying;
  • make dismiss_blocking_dialogs close a leftover native Open dialog;
  • close the seed Untitled documents. I'll test it on the shared laptop with fusion_board_seed output, as AI Flow calls it, and post the result here.

Until then, the unblock that works, as you found: fusion_check_dialogs gives the dialog's hwnd, fusion_close_window {hwnd} closes it, and then close the empty Untitled documents. The verb's dialog-free routes (fusion_schematic {action:"open"}, fusion_open_board) don't give you a linked schematic and board with placed parts, so they aren't a substitute for AI Flow's step.

Colby Knox · 12d ago

Fixed and public: fusion-bridge 1.13.41 (add-in 1.0.30).

What changed:

  • The Open dialog is filled. The File name box is set by three selectors in turn (its name, the common dialog's control id 1148, the dialog's first Edit), each submitted, until the dialog takes the path.
  • No false "cancelled". A dialog that won't take the path is closed with its Cancel button, then WM_CLOSE. The reply says it's closed only once it's gone (dialogClosed, closedBy); otherwise it names the dialog's hwnd as still open.
  • No leftover documents. The empty Untitled documents a failed import opened are closed (untitledClosed).
  • fusion_dismiss_blocking_dialogs closes native Open/Save dialogs, the ones fusion_check_dialogs lists. It rescans, because a cancelled import opens its .brd dialog right after the .sch one.
  • The wait for the new design works. An import that worked used to be reported as nothing_instantiated: the wait compared the workspace's name, and 1.13.38 had started answering its id. It accepts both now, and add-in 1.0.30 answers the name again.

Checked live on our test laptop, with a .sch and .brd pair staged in a space-free folder and the same two calls AI Flow makes:

  • fusion_new_electronics_from_eagle returned success: true, both files imported, 109 of 109 parts placed, and no dialog left on screen.
  • A deliberately abandoned import's two chained Open dialogs were both closed by one fusion_dismiss_blocking_dialogs, and Fusion answered again.

To get it: let Adom Bridge update the Fusion bridge to 1.13.41, then restart Fusion once so it loads add-in 1.0.30 (fusion_restart_for_addin saves open work first). If AI Flow still hits it after that, reopen this issue with the import status reply.

Andy Engevold · 12d ago

Still failing on fusion-bridge 1.13.41 / add-in 1.0.30 (1 of 1 attempts, 2026-10-30 23:43 to 23:44 UTC).

Environment (verified right before the run)

  • fusion_status (alias of fusion_readiness): bridgeVersion 1.13.41, addinVersion 1.0.30, expectedAddinVersion 1.0.30, addinStale false, READY.
  • Fusion had been restarted after the update. Clean session: fusion_get_app_state showed 1 document (the default Untitled design, unmodified), fusion_check_dialogs showed 0 dialogs.
  • Caller: adom-aiflow 0.2.26, adom-aiflow fusion schematic (Fusion lane) on Windows 11, called from the Adom-Workspace WSL container. Same seed flow as the original report: fusion_board_seed writes Seed.sch and Seed.brd into one space-free folder on the C drive (both files present), then fusion_new_electronics_from_eagle and the fusion_eagle_import_status poll.

Exact error text (as surfaced by AI Flow)

ERROR: the design import did not finish: Fusion's Open dialog did not take 'Seed.sch' (the File name box could not be set); the bridge closed the dialog (WM_CLOSE) and the empty documents the import had opened.
Hint: Start from a clean Fusion session (save and close half-finished designs) and run this again.

Actual

  • The native Open dialog (hwnd 5971574, title "Open", filter "All supported files") stayed open, now sitting at Downloads, with an empty File name box. The path was never entered.
  • fusion_check_dialogs still listed it as file_dialog with resolution "cancelled safely with WM_CLOSE", but it was still on screen, so the reply's "the bridge closed the dialog" was not true.
  • fusion_get_app_state returned main_thread_busy ("Fusion main thread busy ? get_app_state running for 6.2s.") while the dialog was up.
  • Two empty Untitled electronics documents remained open, so untitledClosed did not happen either.
  • Note: the UI Automation button list for the dialog (below) has no "Open", "Cancel" or "File name" entries, which may be why none of the File name selectors or the Cancel click took effect.
  • As before, only fusion_close_window {hwnd} sent by hand cleared the dialog and freed Fusion; the two empty documents were then closed with fusion_close_document {save:false}.

fusion_check_dialogs reply taken right after the failure:

{
  "count": 1,
  "dialogs": [
    {
      "buttons": ["&Help", "Details", "View Slider", "Organize", "New folder", "Line up", "Page up", "Page down", "Line down"],
      "category": "file_dialog",
      "hwnd": 5971574,
      "resolution": "a native Windows Open/Save dialog (left by a dialog-driven import or a manual action): cancelled safely with WM_CLOSE, nothing is saved or discarded",
      "text": "Command Module Preview pane Control Host Navigation Pane Vertical Position Desktop Home Gallery Start of Quick Access - Desktop (pinned) Downloads (pinned) Documents (pinned)",
      "title": "Open"
    }
  ],
  "durationMs": 400,
  "error": "",
  "output": "1 dialog(s) open",
  "schemaVersion": 1,
  "shell": "rust",
  "status": "ok",
  "statusVerb": "fusion_get_app_state",
  "success": true,
  "timeoutSeconds": 60
}

Import status reply: not captured (AI Flow gap)

The import status reply you asked for (errorCode, dialogClosed, closedBy, untitledClosed) could not be captured. adom-aiflow fusion schematic only prints the error string above and does not surface the import runId, and the bridge logs on the PC hold no record of it, so fusion_eagle_import_status called directly returns:

{"error":"runId is required (fusion_new_electronics_from_eagle returns it).","errorCode":"run_id_required","status":"error","success":false}

Request: please have AI Flow pass the runId and the full fusion_eagle_import_status reply through (printed or written into the run folder) so the next report can include it. Alternatively, a way to look up the last import's status without a runId would work.

History

  • 4 of 4 failures on 1.13.14 to 1.13.21 (original report above).
  • 1 of 1 failure on 1.13.41 / add-in 1.0.30 (this comment), from a clean session after the Fusion restart. The error text changed (it now says "the File name box could not be set"), so the new fill path is running, but it does not fill the box, and the close and cleanup steps still don't take effect.

No retry was made; Fusion was left clean (1 document, 0 dialogs).

Colby Knox · 12d ago

Found it, Andy. Fixed and public in fusion-bridge 1.13.44. Thanks for the precise report. The UIA button list you included pointed the right way.

Cause on your PC. Adom Bridge gates UI Automation and keystrokes behind its shell approval, and that includes a bridge filling in a dialog. On a PC where that approval isn't on, every way of entering the path was refused (needs_approval), so the File name box stayed empty. We reproduced it exactly on our test laptop with approval off. The reply also said the dialog was closed while one was still on screen. That was the importer opening its .brd Open dialog as soon as the .sch one was cancelled.

What 1.13.44 does:

  • Asks before opening any dialog. If approval isn't on:
    • the bridge asks Adom Bridge for it, and the prompt shows in the Adom Bridge window, its notification, or Hydrogen;
    • the start reply carries needsApproval: true and a tellUser sentence;
    • fusion_eagle_import_status reads waiting_for_approval. It waits for the click. With no approval it stops with needs_approval and opens no dialog, so Fusion is never blocked.
  • Types the path if UI Automation can't set the box, and records each attempt's error (typeErrors).
  • Closes the whole dialog chain on a failure, then the empty Untitled documents, and says "closed" only when no dialog is left.
  • fusion_eagle_import_status with no runId answers the latest import, so you can read the full reply even though AI Flow drops the runId.

Checked live on the test laptop, with the same two calls AI Flow makes:

  • approval off: needs_approval, no dialog, Fusion untouched;
  • approval on: success, 109 of 109 parts placed, no dialog left.

For you:

  1. Let the Fusion bridge update to 1.13.44. No Fusion restart is needed if you're already on add-in 1.0.30.
  2. When the import asks, click Approve in Adom Bridge. Choose Auto (or Settings > Shell Commands) if you don't want to be asked each time.

If it still fails, reopen this with fusion_eagle_import_status {}'s reply.

Colby Knox closed this · 12d ago

Log in to reply.