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.
P0: kicad_show_footprint with allowFocusSteal returns success:true while the PREVIOUS part is still on screen
P0: allowFocusSteal:true returns success:true with the WRONG footprint on screen
kicad-bridge 0.9.206, ab 2.0.72, Windows 11, KiCad 10.0. Found by ralph-testing 10 parts x 4 surfaces through the Adom Bridge web-control demo.
There are three findings here. The first is the serious one, because it reports success for a result that is wrong, which is the failure mode nothing downstream can catch.
1. A focus-steal open reports success while showing the previous part
With the Footprint Editor already open on some other part:
kicad_show_footprint {"footprintName":"MachinePinLargeStandard","library":"Adom","allowFocusSteal":true}
-> success: true
window : "Adom:s10b-ph-sm4-tb - Footprint Editor" <-- the PREVIOUS part
kicad_show_footprint {"footprintName":"tja1051t-3-118","library":"Adom","allowFocusSteal":true}
-> success: true
window : "Adom:s10b-ph-sm4-tb - Footprint Editor" <-- same stale window
Two different requested footprints, both success:true, both leaving s10b-ph-sm4-tb on screen. Reproduced across separate calls.
The same call WITHOUT allowFocusSteal behaves correctly and is a model of a good error:
success: false
error: "Footprint Editor open but 'MachinePinLargeStandard' didn't load in the background
after two attempts (title: Adom:s10b-ph-sm4-tb - Footprint Editor)"
attempts: 2
So the detection logic clearly exists and works - it even names the stale title. The focus-steal path appears to skip that confirmation and report success on the basis of having done the keystrokes, rather than on the editor actually having loaded the requested footprint.
Why this one matters more than the other two: a caller that trusts success:true will render whatever window is up as evidence for the part it asked for. That is exactly what happened to us - a user asked for a WS2812B symbol, got a green "Done", and the screenshots underneath were a different part. A hard failure is recoverable; a false success is not, because nothing downstream has any reason to look again.
Suggested fix: apply the same post-condition the background path already uses - after the keystroke fallback, confirm the window title names the requested footprint, and return success:false with the observed title if it does not.
2. Background footprint navigation fails deterministically for some parts
Same 10-part sweep, kicad_show_footprint with rescan:true, each part staged fresh via kicad_install_footprint:
| part | footprint | result |
|---|---|---|
| CR0603-FX-5601ELF | ok | |
| 0402B102J500CT | ok | |
| WS2812B-2020 | ok | |
| CL21B104KBCNFNC | ok | |
| IN-S42ATR | ok | |
| MachinePinLargeStandard | FAIL | didn't load in background after 2 attempts |
| tja1051t-3-118 | FAIL | same |
| nRF52840-CKAA | ok | |
| nRF54L15 | FAIL | same |
| s10b-ph-sm4-tb | ok |
7/10 pass, 3/10 fail, and the 3 fail every time - not flaky. The editor is left on the previously-shown footprint each time.
Worth noting what does NOT explain it, since these were my first guesses:
- Not a name mismatch.
MachinePinLargeStandarddeclares exactly that name inside its.kicad_modand still fails, whilenRF52840-CKAA(declaresBGA94N35P10X10_360X354X51N) ands10b-ph-sm4-tb(declareseasyeda2kicad:CONN-SMD_S10B-PH-SM4-TB-LF-SN) both pass. Sokicad_install_footprintis evidently installing under the file stem, and the in-file name is not the discriminator. - Not
rescan.rescan:truefixes the equivalent symbol case (library_cache_stale) but makes no difference here. - Not size or source. The three failures span 294 KB / 434 KB / 1.09 MB and two different page owners.
I could not find what the three have in common - that is the part I am handing to you.
3. The failure hint recommends a verb that does not exist
The _hint on that failure says:
check the footprint exists in this library (kicad_list_footprints)
kicad_list_footprints is not in the catalog. Calling it returns the bridge's "Valid KiCad commands" list, which has install_footprint, place_footprint, show_footprint - and no list verb. Small, but a hint that sends the caller to a non-existent verb costs a round trip and reads as a broken bridge.
Context
Everything else in the sweep is healthy: 36/40 surfaces verified, with symbol, 3d chip and library passing for all 10 parts. Symbol opens in particular are solid now that we use the symbolNames you return from kicad_install_symbol (that fixed 4 parts on our side - the in-file symbol name is frequently not the filename, e.g. tja1051t-3-118 -> TJA1051T_3,118).
One request that would make verification possible for callers: kicad_show_3d_chip opens a window titled just "3D Viewer", with no part identity anywhere in the title or response. That means nothing downstream can confirm which part is actually on screen - we open it and simply cannot check. If the 3D Viewer window title carried the part, or the response echoed it, that surface would become verifiable like symbol and footprint are.
Please report back in this issue
Reply with the version that lands any of these and I will re-run the full 10-part matrix against it - the harness is scripted, so a re-test is cheap.