Skip to content

Version v2.5.3

Choose a tag to compare

@MrDoe MrDoe released this 20 Oct 11:28
· 58 commits to main since this release

The CLI no longer exits its host process

src/cli/index.ts builds a module-level Commander singleton, and Commander's
default is to call process.exit() for --help, --version and
argument-validation errors. runCli() — the programmatic API exported from
src/cli.ts — therefore terminated whatever process called it.

That is fatal for a library consumer, and it was aborting the test suite
mid-file: cli.test.ts was reported as failed after ~10 of 24 tests, with a
different pass count on every attempt, and on Windows the abrupt teardown
tripped a libuv assertion:

Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 94

program.exitOverride() is now set before the sub-commands are registered
(they inherit _exitCallback through copyInheritedSettings()), so Commander
throws a CommanderError instead of exiting:

  • runCli() swallows the display-exit codes (commander.helpDisplayed,
    commander.help, commander.version — the output was already printed, so
    these are successes) and rethrows everything else, so a missing argument
    surfaces as a rejection.
  • The real-CLI path maps a CommanderError to process.exitCode and lets the
    process drain, instead of tearing down live handles mid-flight.

CLI behaviour is unchanged: --help and --version still exit 0, an
unknown command or a missing argument still exits 1, and the error text
still goes to stderr. New tests cover both halves — the in-process
"must not exit" contract and the real process exit codes.

Live-provider tests probe capability, not liveness

The Ollama integration tests gated on GET /api/tags, which proves the server
is up but not that it can serve. A GPU-saturated Ollama answers /api/tags
instantly and then never answers /api/embed or /v1/embeddings at all — so
each test burned its full 30-second timeout and then failed, even though the
code under test was fine.

The tests now probe the endpoint they actually depend on, with a bounded
timeout, and report a skip rather than a silent pass when the provider
cannot serve. The probe itself is unit-tested against a stub server, so a
healthy local Ollama is never silently mistaken for an unavailable one.

cli.test.ts now passes 28/28 on every run; the embedder integration tests
report honest skips instead of timeouts.

doc/troubleshooting.md also documents the VRAM-saturation cause of embedding
timeouts — Ollama can answer /api/tags instantly and still never answer
/api/embed when a large model is holding the GPU.


Full Changelog: v2.5.2...v2.5.3