Closed bug report

altium_demo: lib_select times out (120 s agent_timeout) right after the library is freshly opened on Develop; instant once it is open

MartyPM · ·closed by Colby Knox

altium-bridge 0.2.102 (fresh bridge_install today) · Altium Designer Develop, licensed (ADDevelop, PrefFolder Version=26.11.1.5) · Windows 11, 3 monitors · only Develop running

Summary. In altium_demo, the lib_select step hangs for the full 120 s and the verb answers agent_timeout ("Component not found in that library" hint) on the first two beats. Three beats later the same lib_select on the same library answers in 264 ms. Each failed beat costs ~2.5 min.

Repro. Launch Develop with altium_launch {"install":"develop"}, then:

call library lib_select result
altium_demo {stage:0, instance:"develop"} SpiritLevel_2E.SchLib (first) agent_timeout after 151.8 s
altium_demo {stage:1, instance:"develop"} Spirit_Level_Project.PcbLib SO-G3 agent_timeout after 141.0 s
altium_demo {stage:2, instance:"develop"} Spirit_Level_Project.PcbLib (already open) SO-G3 ok, selected:"SO-G3", 264 ms

Stage 1 reply, trimmed:

{"errorCode":"agent_timeout","error":"agent did not answer within 120s",
 "_hint":"Component not found in that library — pick one of available[] (altium_list_library shows all).",
 "failedSteps":["footprint"],"durationMs":140986,
 "steps":[{"open":"C:/Users/Public/Documents/Altium/AD26/Examples/SpiritLevel-SL1/Libraries/Spirit_Level_Project.PcbLib","ms":10667,"result":{"ok":true,"kind":"PCBLIB","lane":"OpenDocument","shown":true}},
          {"lib_select":"SO-G3","ms":null,"result":null}],
 "screenshots":[]}

What was on screen.

  • Stage 0: the select actually landed. The Symbol editor showed 2N7002 (Q?) correctly, but the verb still timed out with no screenshot.
  • Stage 1: the select did not land. The PcbLib showed its first footprint (a "5V DC" silkscreen logo), not SO-G3.
  • Right after each timeout, altium_check_dialogs = no dialogs and altium_agent_status = alive:true, responsive:true, single workspace .../agent/ADDevelop.

Pattern. The timeouts hit only when open had to load the library from disk (8–11 s). When the document was already open (stage 2, open = 82 ms), lib_select was instant. This looks like a race: the select request is sent before the newly opened library is current, and the agent never answers instead of failing fast.

Also. The hint "Component not found in that library" is misleading: SO-G3 exists (stage 2 selected it), and stage 0 had no name at all ((first)).

Expected. lib_select waits for the freshly opened library to become current (or retries), then selects within a second or two. A real miss should answer component_not_found with available[] straight away, not after 120 s.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Thanks for the detailed timings: they pointed straight at the cause. Fixed in altium-bridge 0.2.103, which is public now (Adom Bridge picks it up on its next update check).

What changed

  • A wait after an open that loads the library from disk. When the open had to load the library, the bridge now waits for Altium to finish with it before it sends lib_select. The beat's steps shows that wait as a settle row.
  • Commands no longer run late or get lost. Before, a lib_select that Altium had not picked up within 120 s stayed queued. It then either ran late, after the beat had already given up (your stage 0: the select landed, but the verb timed out), or the next command replaced it and it never ran (your stage 1). Now the command is withdrawn and the reply is errorCode: altium_busy, with pickedUp:false and heartbeatAgeSec. A command Altium did take but hasn't finished answers agent_timeout with pickedUp:true.
  • An honest "not found". "Component not found" (component_not_found, with available[]) now appears only when Altium says the part isn't in the library, never on a timeout.

Tested: I ran Altium Designer Develop 26.11.1 with the same SpiritLevel libraries, from a fresh launch, through the whole altium_demo tour. Every beat answered in 2 to 7 s. I couldn't make Altium stay busy for two minutes the way it did on your machine (the opens took 2.5 to 6 s here, against 8 to 11 s there).

If a beat still answers altium_busy on 0.2.103, please reopen this with that reply and a screenshot of Altium taken during the wait. heartbeatAgeSec shows whether Altium itself was busy, and the screenshot shows what with.

Colby Knox closed this ·

Log in to reply.