← Commit history

v0.9.3

John Lauer ·8edad68d4f ·3mo ago ·parent 628bbd7
1 file changed +10
server.py+10
@@ -258,6 +258,16 @@ def _resolve_kicad_info_for_command(args: dict) -> tuple[dict, str | None]:  def dispatch_command(command: str, args: dict) -> dict:     handler = COMMAND_HANDLERS.get(command)+    # Be tolerant of how the host routes verbs: most strip the bridge's verb+    # prefix and send the bare command ("list_versions"), but some forward the+    # full prefixed verb ("kicad_list_versions" / "adomkicad_list_versions").+    # If the bare command isn't found, strip the leading "<prefix>_" once and+    # retry — so the bridge works no matter which name/prefix it's installed+    # under and no matter whether the host strips.+    if handler is None and "_" in command:+        tail = command.split("_", 1)[1]+        if tail in COMMAND_HANDLERS:+            command, handler = tail, COMMAND_HANDLERS[tail]     if handler is None:         return {             "success": False,