Closed feature request

Live landing cannot reach a task-owned KiCad when another session owns the default IPC pipe (ADOM_AIFLOW_KICAD_SOCKET, patch attached)

noah · ·closed by John Lauer

What blocked the board. On a Windows desktop where another AI session already had KiCad 10.0.4 open (its board on the default IPC pipe %TEMP%\kicad\api.sock), capture open for a new run opened our board in its own pcbnew.exe but answered board_mismatch ("This IPC endpoint does not expose exactly the requested board", openBoards = the other session's board). The hint says to close the conflicting editor; it belongs to another session, so that was not an option, and ADOM_AIFLOW_KICAD_READ_SOCKET only redirects reads, so place land, land route and land pours still had no way to reach the board.

What worked. Following docs/isolated-kicad-read-socket.md, a task-owned pcbnew.exe launched with a private TEMP/TMP gets its own pipe (ipc://C:\Users\<u>\AppData\Local\Temp\<private>\kicad\api.sock). KiCad Bridge 1.0.104 accepts socketPath on the edit verbs too: kicad_routing_state and kicad_move_footprint (dryRun) both answered on it with source: live-editor for the exact board.

Change (patch attached, live-socket.patch, against head 693054013f72, 0.2.55). An opt-in ADOM_AIFLOW_KICAD_SOCKET that adds socketPath to every live IPC verb aiflow calls (kicad_routing_state/validate, kicad_placement_state/validate, kicad_zone_state, kicad_move_footprint, kicad_route_net, kicad_remove_route, kicad_apply_tracks, kicad_apply_zone_plan, kicad_add_zone, kicad_select_net/clear), never to window, capture or file verbs; an explicit socketPath wins; ADOM_AIFLOW_KICAD_READ_SOCKET keeps its read-only meaning. Test live_socket_reaches_edits_and_reads_but_never_windows; cargo test -p aiflow-bridge 62 passed.

Tested on a real board. An AM32 ESC molecule run (kicad-new lane) used the patched build for capture open, models, place check and place land of 89 parts live on the isolated editor while the other session's KiCad kept the default pipe untouched.

Suggested hint. On board_mismatch with an openBoards list that is not ours, say: launch a task-owned pcbnew with a private TEMP and set ADOM_AIFLOW_KICAD_SOCKET=ipc://<its pipe>; never close another session's editor.

live-socket.patch.txt

1 Reply

John Lauer ·

Noah, thank you for the patch and for testing it on a real ESC run. It is merged as you wrote it, with one verb added.

What was wrong: ADOM_AIFLOW_KICAD_READ_SOCKET only redirected the read and validate verbs. So when another session's KiCad held the default IPC pipe, place land, land route and land pours had no way to reach a task-owned editor. The only advice on board_mismatch was to close the conflicting editor, which is not an option when it belongs to someone else.

What changed, in adom-aiflow 0.2.56:

  • New opt-in ADOM_AIFLOW_KICAD_SOCKET=ipc://<pipe>. It adds socketPath to every live IPC verb AI Flow calls: kicad_routing_state/validate, kicad_placement_state/validate, kicad_zone_state, kicad_move_footprint, kicad_route_net, kicad_remove_route, kicad_apply_tracks, kicad_apply_zone_plan, kicad_add_zone, kicad_select_net/clear, and also kicad_zoom_to, which tour nets now uses to frame nets. Window, capture, screenshot and file verbs are never redirected. An explicit socketPath in a call wins, and ADOM_AIFLOW_KICAD_READ_SOCKET keeps its read-only meaning.
  • The board_mismatch messages from capture open and place land now carry your suggested hint: never close another session's editor; launch a task-owned pcbnew with a private TEMP/TMP and set ADOM_AIFLOW_KICAD_SOCKET.
  • docs/isolated-kicad-read-socket.md has a new section on this, and the skill text points to it.

How it was verified: your test live_socket_reaches_edits_and_reads_but_never_windows, extended to cover net selection, kicad_zoom_to, a blank value and the read socket's unchanged scope. All unit tests and workflow suites pass. I had no second live KiCad session here, so your AM32 run is still the end-to-end evidence.

Still open: launching the task-owned pcbnew with a private TEMP is still a manual step. AI Flow does not do it for you yet.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.56.

John Lauer closed this ·

Log in to reply.