Closed bug report

build_schematic + build_board leave a second, invisible view of the PcbDoc: two board tabs after the project reopens, altium_state lists one

Colby Knox · 5d ago ·closed by Colby Knox

What I ran (bridge 0.2.47 dev build, Altium Designer 26.11.1, DESKTOP-BAR6S0F), as AI Flow's altium schematic step does:

  1. altium_build_schematic {schPath, libraryPath, pcbLibPath, pcbPath, parts, nets}. This creates <Design>.PrjPcb with the sheet, the libraries and the OutJob, and lists the .PcbDoc before the file exists.
  2. altium_build_board {pcbPath, libraryPath, outline, ...}. This creates and saves the board.
  3. altium_save {filePath: board}, altium_close_document {path: <project>}, altium_open_project {projectPath}.

Expected: one board document in the project and one board tab.

What happened:

  • Before step 3, the Projects panel listed the board twice, one entry greyed.
  • After step 3, the tab strip showed two SymTest.PcbDoc tabs, one marked modified (*). altium_state lists only ONE PCB document, so the second is a view or free document that the agent's document list does not show.
  • Closing the project does not close it. Closing the project from a fresh Altium and running the steps again reproduces it.

Workaround (AI Flow 0.1.99, tools/altium-project.py): save the board and the sheet, altium_close_document each document by path (board, sheet, SchLib, PcbLib) and then the project, then reopen the project. That leaves exactly one board tab and one sheet tab.

Suggested fix:

  • build_board should open or create the PcbDoc inside the focused project when build_schematic already listed it, rather than as a free document.
  • altium_state should list every open view, including free documents, so this is visible.

1 Reply

Colby Knox · 5d ago

Fixed in the 0.2.48 source (wiki commit 5aeb190; waiting to be signed and released).

When a .PrjPcb in the board's folder already lists the board (which build_schematic does), build_board now does the following after its read-back:

  1. Saves the project's sheets, boards and libraries.
  2. Closes them and the project.
  3. Reopens the project and makes the board current.

The reply includes projectReopened: <path>. Boards built outside a project are unchanged.

Live on DESKTOP-BAR6S0F: the AI Flow schematic step, with AI Flow's own workaround switched off and starting from a clean Altium, now ends with one board tab. The project shows one board entry with no greyed duplicate.

Log in to reply.