Windows: ZMQ ipc:// transport not supported — TUI fails to start after /dev/tty fix #41
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
kahliburke/Kaimon.jl#41
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
After the
/dev/ttyfix in #40, the next Windows blocker is that Kaimon binds/connects ZMQ sockets using theipc://(Unix domain socket) transport, which the standardZMQ_jllWindows build does not support. Result:kaimonaborts at TUI init.Reproducer
Windows 11 / Julia 1.12.5 / Kaimon 1.3.1 with PR #40 applied:
Confirmed by direct probe —
bind(sock, "ipc://./test.sock")on theZMQ_jllshipped to Windows raisesZMQ: Protocol not supported. This is not a Kaimon bug per se, but a long-standing libzmq/Windows situation: see zeromq/libzmq#153, zeromq/pyzmq#1462, zeromq/zeromq.js#478. libzmq has experimental named-pipe IPC (PR zeromq/libzmq#3717) but it isn't enabled in the binary builds Julia ships.Scope of the change
ipc://is used in five files:src/gate.jl:2092— gate REQ/REP endpoint per sessionsrc/gate.jl:2108— gate PUB/SUB stream endpoint per sessionsrc/gate.jl:2668— service REP endpoint client-side connectsrc/gate_client.jl:315— global event PUB (the first one to crash)src/gate_client.jl:640— fallback when reading session metadatasrc/service_endpoint.jl:30,31,101— service endpoint bind + cleanupsrc/extension_manager.jl:138— extension SUB connectEndpoints are also persisted in session metadata JSON files (
sock_dir/<sid>.json), so the wire format on disk is affected too.Suggested fix: TCP loopback on Windows
Switch transports based on
Sys.iswindows():ipc://...sock(cheap, no port allocation).tcp://127.0.0.1:<port>, with a port chosen dynamically viabind(sock, \"tcp://127.0.0.1:*\")and the resolved endpoint read back viaget_last_endpoint(sock)(ZMQ.jl exposes theLAST_ENDPOINTsocket option). Persist the resolvedtcp://...URL in session metadata exactly asipc://...is today — the rest of the code only sees an opaque endpoint string.Sketch:
Then
gate.jl/gate_client.jlsave the resolved endpoint (with concrete port) into session metadata, and clients connect to that. Cleanup paths that todayrmthe.sockfile simply become no-ops on Windows.Trade-offs vs. IPC:
tcp://entries in old session metadata need explicit cleanup; the existing_maybe_cleanup_stale_session!logic keying off pid/mtime should still work.ZAP/CURVE auth or document the difference.Alternative considered: ship a Windows-only
ZMQ_jllrebuilt with-DZMQ_HAVE_IPC=ON -DZMQ_HAVE_WINDOWS_NAMED_PIPES=ON. That works but pulls Kaimon into the BinaryBuilder / Yggdrasil rabbit hole and risks divergence from upstreamZMQ_jll. TCP loopback is a smaller, more portable change.Bigger picture: state of Windows support
For context — there don't appear to be any Windows tracking issues on the repo today, and the Discourse announcement thread doesn't mention Windows. The two real blockers I've hit running
kaimoncold on Windows 11 are:/dev/ttyopen in_start_stdout_capture!→ fixed by #40 (one line).ipc://everywhere → this issue.Beyond those, there are a handful of Unix-flavored references (
/dev/ttys*paths, thettyshell-out intool_definitions.jl) but those are explicitly documented as macOS/Linux-only features (external-TTY attach), so they degrade gracefully — they shouldn't block a Windows user from running the core gate + TUI. So the realistic path to "Kaimon works on Windows" looks like:/dev/tty→CONipc://→tcp://127.0.0.1on Windowstty-path) feature is Unix-onlyHappy to put together a PR for the TCP-loopback switch if the design above sounds reasonable — wanted to file this first to check whether you'd prefer that approach, a
ZMQ_jllrebuild, or something else (e.g. inproc + a single-process design on Windows).@mind6 Thanks and sorry for the delay in responding. I know Windows is a sore spot for things now, I don't use it or have a good environment for testing, so it is challenging. Let me catch up and see what the best option might be.
The IPC→TCP switch is now in on
2.0-integration(8ce7def). Thanks @1-Bart-1 for the detailed design writeup, and @Yihuki — this ports the still-needed pieces of your PR #31, which predated a large refactor (the gate was extracted into a standaloneKaimonGatepackage andgate.jl/gate_client.jlwere split), so #31 couldn't merge as-is.Already in place before this (so it's not in the diff):
/dev/tty→CON(#40, @mind6) — landed.bind(sock, "tcp://host:0")+ read back the resolved port), andserve()defaults to TCP mode on Windows. So concurrent sessions aren't limited.This change handles the remaining hardcoded
ipc://sockets — the ones that were still crashing startup (your stacktrace pointed at_start_event_pub!). Every change is behindSys.iswindows(), so the Unix path is unchanged:SetConsoleOutputCP/CP(65001)) so the TUI renders box-drawing correctly.127.0.0.1:9878.127.0.0.1:9877.On ports: the service endpoint and event PUB are per-Kaimon-instance singletons (one each, shared by every session/extension), so a fixed port for each is the direct analog of the single fixed
kaimon-service.sock/kaimon-events.sockpath on Unix — same single-instance assumption, no behavior change vs. today. (The per-session sockets stay dynamic, as above.) Both are overridable viaKAIMON_SERVICE_TCP_PORT/KAIMON_EVENT_PUB_TCP_PORT.I can't test on Windows — the macOS/Linux suites are green (which only proves I didn't break the
ipc://path), but the Windows path is unverified. Could a Windows user confirm? Specifically: a coldkaimonstart, a gate connecting (Gate.serve()/start_session), an extension receiving an event, and a tool callback from inside a gate session.#31 and #40 are effectively superseded by what's now on
2.0-integration.Hi I just tested on my Windows machine with the latest commit (
8ba732f8fc), and it seems to work !Side note, display works in VSCode, but the keyboard interaction is a bit sketchy, switching panels only works with caps lock, (not with shift or num pad).
@BambOoxX Thanks for the report. That is strange on the VSCode side, you're using the built in terminal in vscode is what I gather? Luckily you can also mouse click those (or at least I can ;))
@kahliburke Yup, just the basic VSCode terminal, and the mouse does not work either it seems. In the default windows terminal, keyboard works fine, but only the right-click seems to work and goes to tab 0
@BambOoxX Terminal support in windows is so much worse :( makes me sad. I was under the impression that newer versions of VSCode had enhanced things to use the kitty terminal protocol but I've never tested it. A quick search brought up this json to go into settings.json file, maybe worth a try?
@kahliburke unfortunately, these lines changed nothing in my VSCode...
@BambOoxX Thanks for trying and the feedback. Have you used or considered installing WSL2? I believe it could offer you a better experience in many ways ... you could run terminal packages and VSCode through that, I've seen it work quite well.
@BambOoxX I'm closing this out as 2.0 has shipped and addresses at least some of what's described. If we want to iterate on more Windows fixes and support, please open an issue against it.