Kaimon is crashing when plotting #11

Closed
opened 2026-03-20 04:56:35 -07:00 by prittjam · 10 comments
prittjam commented 2026-03-20 04:56:35 -07:00 (Migrated from github.com)

crashes are caused by GLMakie blocking the Julia event loop. When window!
or Figure() display is triggered, GLMakie needs a GUI thread to render but
the MCP server runs in the same process. If the GL rendering blocks, the MCP
socket stops responding, times out, and the connection drops.

It's intermittent because:

  • Sometimes GLMakie can create the window without blocking (window already
    exists, or GPU is ready)
  • Sometimes the window creation or render loop blocks the main thread long
    enough that the MCP socket dies
crashes are caused by GLMakie blocking the Julia event loop. When window! or Figure() display is triggered, GLMakie needs a GUI thread to render but the MCP server runs in the same process. If the GL rendering blocks, the MCP socket stops responding, times out, and the connection drops. It's intermittent because: - Sometimes GLMakie can create the window without blocking (window already exists, or GPU is ready) - Sometimes the window creation or render loop blocks the main thread long enough that the MCP socket dies
kahliburke commented 2026-03-20 10:26:42 -07:00 (Migrated from github.com)

@prittjam, there are probably some methods that can be used to improve this. Some questions for you, what version are you running, do you have a somewhat minimal way to reproduce what you're doing, what OS, etc.

Are you specifying thread configuration for the Julia process you are connecting to Kaimon? The messaging layer would like to run to keep the status alive. I've made many improvements to this in the 1.1 branch, which is very close to release and I would encourage you to try it if possible.

Let me know and I'll do my best to troubleshoot!

@prittjam, there are probably some methods that can be used to improve this. Some questions for you, what version are you running, do you have a somewhat minimal way to reproduce what you're doing, what OS, etc. Are you specifying thread configuration for the Julia process you are connecting to Kaimon? The messaging layer would like to run to keep the status alive. I've made many improvements to this in the 1.1 branch, which is very close to release and I would encourage you to try it if possible. Let me know and I'll do my best to troubleshoot!
prittjam commented 2026-03-22 09:11:27 -07:00 (Migrated from github.com)

Setup:

  • Kaimon v1.0.1 (main branch, installed via Pkg.add(url=...))
  • Julia 1.12.5
  • Linux (Pop!_OS/Ubuntu): 6.18.7-76061807-generic
  • Connected via Claude Code + Emacs (claude-code-ide.el MCP integration)
  • GPU: NVIDIA with 23.5 GiB VRAM

Issues:

  1. ex calls frequently return (mcp__kaimon__ex completed with no output)
    even for simple expressions after long-running include() calls. Unclear if
    this is timeout, output suppression, or the eval result getting lost.
  2. After running a long GPU pipeline (~30-60s), subsequent ex calls sometimes
    hang or return empty until the REPL is checked manually.
  3. println/print output is stripped by design (q=true), but even with q=false
    and a final expression, output sometimes doesn't come back.

Repro: include("examples/pipeline/find_boards_calibrated.jl") loads
CUDA+GLMakie, runs a GPU blob detection pipeline on a 2832�4240 image. Takes
~60s with precompilation. Output never arrives via MCP.

Thread config: Not explicitly set using default Julia threading.

Re: 1.1 branch: Tried to install it, hit BoxTabs not defined in Kaimon during
precompile looks like it needs a Tachikoma newer than 1.1.6 (main has 1.1.6
but doesn't export BoxTabs). Happy to try again when it's ready.

Setup: - Kaimon v1.0.1 (main branch, installed via Pkg.add(url=...)) - Julia 1.12.5 - Linux (Pop!_OS/Ubuntu): 6.18.7-76061807-generic - Connected via Claude Code + Emacs (claude-code-ide.el MCP integration) - GPU: NVIDIA with 23.5 GiB VRAM Issues: 1. ex calls frequently return (mcp__kaimon__ex completed with no output) even for simple expressions after long-running include() calls. Unclear if this is timeout, output suppression, or the eval result getting lost. 2. After running a long GPU pipeline (~30-60s), subsequent ex calls sometimes hang or return empty until the REPL is checked manually. 3. println/print output is stripped by design (q=true), but even with q=false and a final expression, output sometimes doesn't come back. Repro: include("examples/pipeline/find_boards_calibrated.jl") loads CUDA+GLMakie, runs a GPU blob detection pipeline on a 2832�4240 image. Takes ~60s with precompilation. Output never arrives via MCP. Thread config: Not explicitly set using default Julia threading. Re: 1.1 branch: Tried to install it, hit BoxTabs not defined in Kaimon during precompile looks like it needs a Tachikoma newer than 1.1.6 (main has 1.1.6 but doesn't export BoxTabs). Happy to try again when it's ready.
prittjam commented 2026-03-22 10:00:33 -07:00 (Migrated from github.com)

so this is bad because it crashes the REPL and a restart triggers recompilation, which is a disaster for big projects (Revise is kicked out).

so this is bad because it crashes the REPL and a restart triggers recompilation, which is a disaster for big projects (Revise is kicked out).
kahliburke commented 2026-03-22 13:36:24 -07:00 (Migrated from github.com)

@prittjam Sorry you are running into issues. Be sure that I'm looking at these and want to clear them up. I haven't tried any emacs integration and I don't know if that could be causing any issue, but I mention it because it's a difference from my setup.

The 1.1 branch is going to be the way forward through some of these issues perhaps but I realize it's still not released and requires another development version. I'll work on getting this moved along ASAP.

Have you tried running kaimon and claude outside of emacs? Just curious whether that makes a difference here.

@prittjam Sorry you are running into issues. Be sure that I'm looking at these and want to clear them up. I haven't tried any emacs integration and I don't know if that could be causing any issue, but I mention it because it's a difference from my setup. The 1.1 branch is going to be the way forward through some of these issues perhaps but I realize it's still not released and requires another development version. I'll work on getting this moved along ASAP. Have you tried running kaimon and claude outside of emacs? Just curious whether that makes a difference here.
prittjam commented 2026-03-22 14:53:35 -07:00 (Migrated from github.com)

its particular to Julia. You pay extreme cost for intermittent REPL crashing for larger projects. So maybe not the best test case for a brand new MCP :)

Thanks for your efforts.

its particular to Julia. You pay extreme cost for intermittent REPL crashing for larger projects. So maybe not the best test case for a brand new MCP :) Thanks for your efforts.
kahliburke commented 2026-03-22 16:36:59 -07:00 (Migrated from github.com)

@prittjam I'm working to figure out some of these issues. I hate to say "It works for me!" but it does :). If you review the comments in the other issue I've tried to outline a few clarifications and link to some test cases you could try.

I don't discount what you're experiencing, I just want to understand what might be causing this as I've used this package in several environments including MacOS, Linux, and Windows and have not run into this specific problem yet.

Emacs, while I don't understand why it would cause any issue, is the one thing that stands out to me in your description. If you could try some of the recommended tests and get back with me, that may help to track it down. Also, please feel free to reach out to me on the Julia discourse, we could potentially set up a debugging session to work more interactively.

Also thank you for your patience as I work out these rough spots. It's incredibly hard to make something perfect in isolation, so users like yourself who are willing to help me polish those out are invaluable.

@prittjam I'm working to figure out some of these issues. I hate to say "It works for me!" but it does :). If you review the comments in the other issue I've tried to outline a few clarifications and link to some test cases you could try. I don't discount what you're experiencing, I just want to understand what might be causing this as I've used this package in several environments including MacOS, Linux, and Windows and have not run into this specific problem yet. Emacs, while I don't understand why it would cause any issue, is the one thing that stands out to me in your description. If you could try some of the recommended tests and get back with me, that may help to track it down. Also, please feel free to reach out to me on the Julia discourse, we could potentially set up a debugging session to work more interactively. Also thank you for your patience as I work out these rough spots. It's incredibly hard to make something perfect in isolation, so users like yourself who are willing to help me polish those out are invaluable.
prittjam commented 2026-03-22 16:52:25 -07:00 (Migrated from github.com)

Julia needs a fully features well-maintained MCP. I"m sure this will attract users and any possible sharp corners will be found. I went back to MCPRepl, which just works for me right now for my dev cycle. But I will try it again. Thanks for the fast responses!

Julia needs a fully features well-maintained MCP. I"m sure this will attract users and any possible sharp corners will be found. I went back to MCPRepl, which just works for me right now for my dev cycle. But I will try it again. Thanks for the fast responses!
kahliburke commented 2026-03-22 17:41:32 -07:00 (Migrated from github.com)

@prittjam Thanks, MCPRepl certainly being the progenitor of Kaimon, I put a lot of work into MCPRepl before restructuring and issuing this release. But trust me, this is so, so much better, more refined, and is about to gain some serious power features in 1.1. Please do come back, thanks.

Should I close this for now or do you want to leave active?

@prittjam Thanks, MCPRepl certainly being the progenitor of Kaimon, I put a lot of work into MCPRepl before restructuring and issuing this release. But trust me, this is so, so much better, more refined, and is about to gain some serious power features in 1.1. Please do come back, thanks. Should I close this for now or do you want to leave active?
prittjam commented 2026-03-22 17:54:46 -07:00 (Migrated from github.com)

sure close it and thanks for the responses! I will try to figure out what in my config is causing the issues.

sure close it and thanks for the responses! I will try to figure out what in my config is causing the issues.
kahliburke commented 2026-03-22 20:24:37 -07:00 (Migrated from github.com)

Closing on request of author, will follow up with them when they return to testing it.

Closing on request of author, will follow up with them when they return to testing it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kahliburke/Kaimon.jl#11
No description provided.