Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

fix(docs): bootstrap generate-error-pages without inference so docs deploy survives a fresh runner (#972)

Louis Choquel0e166d0a1c19
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 59250d438..507de1054 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,8 @@ This cycle reworks **cost reporting** so it survives distributed execution and s
### Fixed
+- **Docs deploy crashed on a fresh runner with `InferenceSetupRequiredError`.** `pipelex-dev generate-error-pages` (a prerequisite of every `docs-*` make target) bootstrapped Pipelex with `needs_inference=True`, so on a CI runner with the gateway enabled but no on-disk service config it hit the first-run inference-setup gate and exited non-zero — breaking the `Deploy docs` workflow on `main`. The command only introspects `PipelexError` subclasses to write markdown and never calls inference, so it now bootstraps with `needs_inference=False`.
+
- **`UsageRegistry` success-path leak.** The per-run cost registry was opened during run setup but closed only on the failure path, so every successful run leaked its registry — and in a long-lived process (e.g. the Pipelex API) reusing a `pipeline_run_id` could collide on the orphaned registry. The registry is removed entirely, so the leak is structurally impossible.
## [v0.31.0] - 2026-06-04
diff --git a/pipelex/cli/dev_cli/commands/generate_error_pages_cmd.py b/pipelex/cli/dev_cli/commands/generate_error_pages_cmd.py
index a36c2eaf8..e91cdd21e 100644
--- a/pipelex/cli/dev_cli/commands/generate_error_pages_cmd.py
+++ b/pipelex/cli/dev_cli/commands/generate_error_pages_cmd.py
@@ -16,13 +16,17 @@ ERROR_PAGES_DIR = Path("docs/errors")
def generate_error_pages_cmd(output: Path | None = None, quiet: bool = False) -> None:
"""Generate per-class error documentation pages.
- Bootstraps Pipelex (kept for parity with other dev CLI commands and to surface
- config / setup errors loudly), then calls :func:`generate_error_pages`. The
- underlying discovery rglobs every ``exceptions.py`` / ``*_exceptions.py``
- via :func:`iter_pipelex_error_subclasses` — no manual import or class-list
- update is needed when a new error class lands. Pages already carrying
- ``<!-- pipelex:authored -->`` are preserved so hand-edited reference content
- is never clobbered.
+ Bootstraps Pipelex with ``needs_inference=False`` (kept for parity with other
+ dev CLI commands and to surface config / setup errors loudly), then calls
+ :func:`generate_error_pages`. Inference is never invoked here — the command only
+ introspects ``PipelexError`` subclasses and writes markdown — so the bootstrap
+ must skip the inference-setup / gateway-terms checks; otherwise CI environments
+ with no configured backend (e.g. the docs deploy job) hit
+ ``InferenceSetupRequiredError``. The underlying discovery rglobs every
+ ``exceptions.py`` / ``*_exceptions.py`` via :func:`iter_pipelex_error_subclasses`
+ — no manual import or class-list update is needed when a new error class lands.
+ Pages already carrying ``<!-- pipelex:authored -->`` are preserved so hand-edited
+ reference content is never clobbered.
Args:
output: Custom output directory. Defaults to ``docs/errors/``.
@@ -36,7 +40,7 @@ def generate_error_pages_cmd(output: Path | None = None, quiet: bool = False) ->
console.print("[bold]Generating per-class error documentation pages...[/bold]")
console.print()
- Pipelex.make()
+ Pipelex.make(needs_inference=False)
try:
report = generate_error_pages(output_dir=output_path)
finally: