Skip to content

chore(release): 0.9.6 -- atomic init + Windows one-command installer - #25

Merged
ArkNill merged 1 commit into
mainfrom
release/0.9.6
May 21, 2026
Merged

chore(release): 0.9.6 -- atomic init + Windows one-command installer#25
ArkNill merged 1 commit into
mainfrom
release/0.9.6

Conversation

@ArkNill

@ArkNill ArkNill commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

Surfaced by the 2026-05-21 hmj PC dogfood: llm-relay init would write
ANTHROPIC_BASE_URL into ~/.claude/settings.json before the proxy
server was confirmed serving traffic, so any running Claude Code session
would route to a dead port and the symptom looked like a generic API
connection error. This release fixes the ordering and adds a one-line
Windows installer on top.

User-visible deliverable:

irm https://raw.githubusercontent.com/ArkNill/llm-relay/main/scripts/install.ps1 | iex

That's the whole install (after Python 3.9+ is present).

What changed

llm-relay init is now atomic

Step Before After
1 detect / port / DB / config / knowledge same
2 write ANTHROPIC_BASE_URL → settings.json start the proxy server
3 start proxy server /_health gate
4 health-check (but routing already mutated) write ANTHROPIC_BASE_URL + register MCP only if step 3 passed

--skip-server now also skips the routing change as one decision; the
previous trap of "server skipped, settings still mutated" is gone.

Windows daemon path

_start_server on Windows delegates to win_service.start_daemon (pythonw +
CREATE_BREAKAWAY_FROM_JOB). The previous Popen + CREATE_NEW_PROCESS_GROUP
path left the proxy tied to its job object, so the OS killed it when the
parent SSH session disconnected (observed during the 2026-05-21 dogfood).

scripts/install.ps1 -- one-command Windows install

  • Verifies Python 3.9+ (or exits with a winget install hint linking to the
    README Prerequisites section).
  • Detects an active venv (uses it if present, else --user with a PATH hint).
  • pip install --upgrade "llm-relay[all]".
  • Calls llm-relay init.
  • Prints dashboard URL.

README

New "Prerequisites" section spelling out Python 3.9+, recommended venv flow,
and platform-specific install hints. New "One-command install (Windows native)"
section at the top of Install pointing at install.ps1.

Tests

test_skip_server_does_not_write_settings_json regression in
tests/test_api/test_init.py pins the atomic contract: with
skip_server=True, settings.json must remain untouched.

Docker carry-over

CHANGELOG carries forward the 0.9.5 Docker fix that landed via PR #24
(Dockerfile vendor/tokpress lines removed).

Test plan

  • pytest -- 594 pass (+1 new atomic regression). 0 fail.
  • ruff check src/ tests/ -- clean.
  • NDA grep on diff -- 0 hits.
  • Manual trace through the new ordering with a dead port (would-be
    failure path) confirms settings.json is not touched when health gate
    fails.

Post-merge sequence

  1. git tag v0.9.6 + push.
  2. gh release create v0.9.6 with CHANGELOG body.
  3. gh workflow run publish.yml -f confirm=publish (Trusted Publishing OIDC).
  4. Dogfood install.ps1 from hmj PC: fresh PowerShell,
    irm https://raw.githubusercontent.com/ArkNill/llm-relay/main/scripts/install.ps1 | iex,
    confirm verify all passes and Claude Code's existing session is not
    disrupted mid-flow.

Surfaced by the 2026-05-21 hmj PC dogfood: `llm-relay init` would
write ANTHROPIC_BASE_URL into ~/.claude/settings.json BEFORE the
proxy server was confirmed serving traffic, so any running Claude
Code session would route to a dead port and the symptom looked
like a generic API connection error. This release fixes the
ordering and adds a one-line Windows installer on top.

Key changes:

  setup_init.run_init -- atomic ordering
    1. detect / port / DB / config / knowledge dir
    2. start the proxy server
    3. /_health gate
    4. write ANTHROPIC_BASE_URL + register MCP **only if** (3) passed

    `--skip-server` now also skips routing and the health gate as
    one decision; the previous trap of "server skipped, settings
    still mutated" is gone.

  _start_server on Windows now uses win_service.start_daemon
    (pythonw + CREATE_BREAKAWAY_FROM_JOB). The Popen path with
    CREATE_NEW_PROCESS_GROUP left the proxy tied to its job object
    so the OS killed it when the parent SSH session disconnected.

  scripts/install.ps1 -- one-command Windows install
    Verifies Python 3.9+, detects an active venv (uses it if
    present, else --user with a PATH hint), pip installs
    llm-relay[all], then calls llm-relay init. Documented in
    README.md "One-command install (Windows native)".

  README -- new "Prerequisites" section
    Python 3.9+ requirement spelled out, recommended venv flow,
    platform-specific install hints (winget / brew / apt).

  Tests
    New test_skip_server_does_not_write_settings_json regression
    pins the atomic contract.

  CHANGELOG carries the 0.9.5 Docker hotfix forward.

Tests: 594 pass (+1 new). Ruff clean. NDA grep on diff: 0 hits.
@ArkNill
ArkNill merged commit bc437fd into main May 21, 2026
6 checks passed
@ArkNill
ArkNill deleted the release/0.9.6 branch May 21, 2026 04:21
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