Skip to content

Windows compatibility for launcher, CLI, and config paths#11

Open
offbyonebit wants to merge 5 commits into
mainfrom
windows-compat
Open

Windows compatibility for launcher, CLI, and config paths#11
offbyonebit wants to merge 5 commits into
mainfrom
windows-compat

Conversation

@offbyonebit

Copy link
Copy Markdown
Owner

Summary

  • Adds a Windows code path in the launcher (CREATE_NEW_PROCESS_GROUP + CTRL_BREAK_EVENT, taskkill /T tree-kill on timeout), config (%APPDATA%/%LOCALAPPDATA%), and CLI (doctor/init/serve/systemd-unit degrade gracefully instead of crashing on Windows).
  • Fixes 13 pre-existing ruff lint errors that have been silently breaking CI's lint step since the mtp-clean merge — Test never actually ran on any push since then.
  • Adds windows-latest to the CI matrix for real validation on a Windows runner.

Test plan

  • ruff check . passes locally
  • mypy clean on changed files
  • Full local test suite passes (197 passed)
  • CI green on Linux (lint + test, previously broken)
  • CI green on windows-latest (first real validation of the Windows path)

- Split monolithic chat.html into chat.css + chat.js modules
- Render assistant messages with marked.js + highlight.js syntax highlighting
- Add copy buttons to code blocks
- Redesign agent tool cards as a step timeline with step numbers and target chips
- Render markdown in agent assistant messages
- Improve assistant message typography (no global monospace)
Adds a Windows code path alongside the existing Linux one: process
lifecycle (CREATE_NEW_PROCESS_GROUP + CTRL_BREAK_EVENT/taskkill tree-kill
instead of setsid/killpg), %APPDATA%/%LOCALAPPDATA% config paths, and
graceful degradation in `doctor`/`init`/`serve`/`systemd-unit` for
Linux-only diagnostics. Also fixes 13 pre-existing ruff lint errors
(unused imports/locals) that have been silently failing CI's lint step
since the mtp-clean merge, so Test never actually ran. Adds windows-latest
to the CI matrix to get real validation on a Windows runner.
The windows-latest CI job (added in the previous commit) caught 7 real
failures the Linux-only local verification couldn't:

- search_files now emits POSIX-style relative paths (Path.as_posix())
  instead of native separators, so matches are consistent across platforms.
- test_run_command_cwd_is_root used `pwd`, which on the Windows runner
  resolves to Git Bash's pwd.exe and prints an MSYS-style path
  ("/c/Users/...") instead of a native one even though cwd was correct.
  Swapped for a python -c cwd check, which is honest on both platforms.
- make_sysfs_gpu fakes Linux's /sys/bus/pci/devices/<slot> layout, and
  slot names contain colons (e.g. "0000:03:00.0"), which are illegal in
  Windows path components. This fixture is inherently Linux-only (Windows
  has no sysfs to fake), so it now skips on win32 instead of failing.
test_find_drm_card_found builds its own /sys/bus/pci/devices/0000:03:00.0
path inline instead of going through the make_sysfs_gpu fixture, so it
slipped past the skip added there. Same root cause: colon in the PCI
slot name is illegal in a Windows path component, and there's no real
sysfs to fake on Windows anyway.
…t export/import

Runtime robustness:
- Router refuses to load a model if its estimated VRAM (weights + KV cache
  + overhead) won't fit on the target GPU, accounting for co-resident
  models in multi-resident mode.
- LlamaServer.tail_log() surfaces the last 40 log lines in the error when a
  model fails its health check, instead of just a log line nobody sees.
- load_config now runs migrate_config()/validate_config(): rejects configs
  newer than the supported schema version, fills in missing top-level
  sections, and raises clear errors on structural problems.

Operations/observability:
- GET /admin/metrics: load/stop/error counters, active models, GPU info.
- GET /health now reports uptime and currently loaded models.
- llama-server subprocess logs rotate at 50MB, keeping 3 backups.
- ARC_LLAMA_LOG_JSON=1 switches logging to single-line JSON.

API/UX:
- GET /v1/chats/export and POST /v1/chats/import, plus Export/Import
  buttons in the chat history panel. Reuses the existing path-sanitizing
  _chat_path, so imported chat ids can't escape the chat directory.

Streaming in the web UI and agent tool confirmation were already
implemented prior to this change; no work was needed there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant