Add option to use custom system image #69

Closed
opened 2026-07-27 14:13:07 -07:00 by ufechner7 · 2 comments
ufechner7 commented 2026-07-27 14:13:07 -07:00 (Migrated from github.com)

Sometimes the repl needs to be restarted. AI tools ask Kaimon to do that, and it is doing it. But it is not using my custom system image. That causes a lot of issues. Please add an option to use a custom system image (or a custom script to launch Julia).

Sometimes the repl needs to be restarted. AI tools ask Kaimon to do that, and it is doing it. But it is not using my custom system image. That causes a lot of issues. Please add an option to use a custom system image (or a custom script to launch Julia).
kahliburke commented 2026-07-29 12:55:20 -07:00 (Migrated from github.com)

@ufechner7 Can you try the new 2.3.0 release, it should allow you to freely use custom sysimages.

@ufechner7 Can you try the new 2.3.0 release, it should allow you to freely use custom sysimages.
kahliburke commented 2026-07-29 13:20:26 -07:00 (Migrated from github.com)

Fixed in Kaimon 2.3.0. Thanks for the report — digging into it turned up two separate problems, and only one of them was the missing feature you asked for.

Sessions Kaimon spawns had no way to specify a system image at all. You can now set one per project, either in ~/.config/kaimon/projects.json or — probably nicer for your repos — in the project's own kaimon.toml, so it's checked in and collaborators get it for free:

[launch]
sysimage = "kps-image_tmp.so"   # relative → resolved against the project root
threads = "auto"

julia_bin (a Julia binary, or a wrapper script that forwards its arguments — the "custom script to launch Julia" option you mentioned) and startup_file are configurable alongside it. A user-level entry in projects.json is overlaid field-wise on the project's kaimon.toml, so you can override a single field locally and inherit the rest, and it's editable from the TUI Config tab (select a project, press e). A configured sysimage that isn't on disk is logged and skipped rather than failing the spawn.

Separately, restarting a REPL you launched was already supposed to keep your sysimage — the gate re-execs with the original argv, so -J, thread count and heap hint carry over. But the check for "was this launched with a script?" didn't know that --sysimage takes its value as a separate token, so the path in julia --sysimage /path/sys.so was mistaken for a script argument. The restart then replayed argv verbatim and re-exec'd a plain interactive REPL that never reconnected to Kaimon — so you'd lose the session, not just the image. The attached spellings (-J/path, --sysimage=/path) were unaffected. That's fixed in KaimonGate 1.2.0, which 2.3.0 requires.

If you were passing the flag with a space, that second bug is very likely what you were actually hitting.

Docs: Launch Configuration.

Fixed in [Kaimon 2.3.0](https://github.com/kahliburke/Kaimon.jl/releases/tag/v2.3.0). Thanks for the report — digging into it turned up two separate problems, and only one of them was the missing feature you asked for. **Sessions Kaimon spawns had no way to specify a system image at all.** You can now set one per project, either in `~/.config/kaimon/projects.json` or — probably nicer for your repos — in the project's own `kaimon.toml`, so it's checked in and collaborators get it for free: ```toml [launch] sysimage = "kps-image_tmp.so" # relative → resolved against the project root threads = "auto" ``` `julia_bin` (a Julia binary, or a wrapper script that forwards its arguments — the "custom script to launch Julia" option you mentioned) and `startup_file` are configurable alongside it. A user-level entry in `projects.json` is overlaid field-wise on the project's `kaimon.toml`, so you can override a single field locally and inherit the rest, and it's editable from the TUI Config tab (select a project, press `e`). A configured sysimage that isn't on disk is logged and skipped rather than failing the spawn. **Separately, restarting a REPL *you* launched was already supposed to keep your sysimage** — the gate re-execs with the original argv, so `-J`, thread count and heap hint carry over. But the check for "was this launched with a script?" didn't know that `--sysimage` takes its value as a separate token, so the path in `julia --sysimage /path/sys.so` was mistaken for a script argument. The restart then replayed argv verbatim and re-exec'd a plain interactive REPL that never reconnected to Kaimon — so you'd lose the session, not just the image. The attached spellings (`-J/path`, `--sysimage=/path`) were unaffected. That's fixed in KaimonGate 1.2.0, which 2.3.0 requires. If you were passing the flag with a space, that second bug is very likely what you were actually hitting. Docs: [Launch Configuration](https://kahliburke.github.io/Kaimon.jl/dev/configuration#launch-config).
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#69
No description provided.