KiCad - the KiCad Bridge
Public Made by Adomby adom
Drive your own KiCad from an AI, in the background: open every editor, read the whole board as data (the EDA Bridge Standard board model), stack-up, part heights, netlists, place, route, pour, DRC and exports.
kicad_show_symbol is ~56s on every call: full cold start (relaunch + library scan) even when the Symbol Editor is already open on that symbol
kicad_show_symbol takes ~56s on EVERY call: full cold start (relaunch + library scan) even when the Symbol Editor is already open on that exact symbol
Live, Colby-ROG2, 2026-08-19 (kicad-bridge 0.9.181, KiCad 10.0, ab relay). kicad_show_symbol {symbolName:"IN-S42ATR", libraryName:"Adom"} succeeds but takes ~57-58s, and it costs the same every time because it is treated as a cold start on every call.
Measurements (two back-to-back calls)
- Call 1:
success:true,durationMs: 57107, output "Symbol 'IN-S42ATR' loaded (background win32 path): Adom:IN-S42ATR — Symbol Editor" - Call 2 (immediately after):
success:true,durationMs: 58607,progress.measured: {phase:"kicad.show_symbol", seconds:56.14, startKind:"cold"}
Between the two calls, kicad_window_info shows the editor was ALREADY open on the target symbol, and there is exactly one (no leak):
editors: [{ hwnd: 1837708, title: "Adom:IN-S42ATR — Symbol Editor" }]
projectManager: { hwnd: 1114720, title: "KiCad 10.0" }
So on call 2 the Symbol Editor is already up and already displaying Adom:IN-S42ATR — the desired end state — yet the verb still runs the full ~56s startKind:"cold" flow instead of returning immediately.
What seems to be happening
The show path does not check for an already-open Symbol Editor (which kicad_window_info clearly sees) before doing its work. Every call re-runs the cold sequence: launch/raise KiCad, open the Symbol Editor, and win32-navigate to the symbol. The dominant cost is very likely KiCad itself rescanning ALL symbol libraries when the editor is opened/refreshed (KiCad does a full library index on Symbol Editor open, which is tens of seconds), compounded by the bridge paying it on every call rather than once.
For a wiki Quick Actions "Open in Symbol Editor" button this is a 57s spinner every click, even to re-show a symbol that is already on screen.
Asks
Before the cold path, check
kicad_window_info/ the reverse bridge for an already-open Symbol Editor:- already open AND already showing the target
library:symbol-> return fast (just foreground/report), no relaunch, no rescan. - open but on a different symbol -> navigate the existing editor (win32/plugin) instead of relaunching, so KiCad's library scan is not repeated.
- reserve the ~56s cold flow for a genuine cold start (no KiCad running).
- already open AND already showing the target
Break the 56s into sub-phase timings in
progress/output (launch vs library-scan vs navigate) so it is clear where it goes and whether KiCad's library index is the bottleneck. If it is, a warm-editor reuse fixes the common case entirely.Replace the fixed
time.sleep()settle delays in the open/navigate flow with a poll-until-ready wait on the actual condition.open_symbol_editor.pysleeps a fixed 0.5s / 1.5s / 2.0s after launching KiCad and after each navigation step, plus a 10s cap waiting for the project manager. Fixed sleeps both over-wait in the common case and under-wait on a slow box; the sync equivalent of "await the condition" is a tight poll loop (WaitForInputIdle, or pollEnumWindowsfor the target window / poll the plugin's editor inventory until the frame is present) with a short interval and a timeout. That trims the settle overhead and is more robust than guessing a delay.
Note on the split: the fixed sleeps are only part of the budget (roughly 5-10s of the 56s). The bulk is almost certainly KiCad's own synchronous symbol-library index when the Symbol Editor opens, which the bridge cannot make async (it is KiCad's blocking work) - the only way to avoid it is not to reopen/rescan when an editor is already up (ask 1). So: warm-editor reuse removes the big cost, poll-until-ready removes the sleep overhead, and sub-phase timings confirm the split.
Symbol currently WORKS (unlike footprint, adom/kicad-bridge#34) - this is purely about the ~56s-per-call latency. Happy to re-run with any extra instrumentation against this machine.
