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.

mthds==0.4.1

thomashebrarda3aebc3ee3d7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd2b6ddc1..41df16599 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,8 +4,8 @@
### Breaking Changes
-- **`PipelexRunner` → `PipelexMTHDSProtocol`** — the runner class now implements the MTHDS Protocol (`mthds.protocol.protocol.MTHDSProtocol`, mthds 0.4.0). Method renames: `execute_pipeline` → `execute`, `start_pipeline` → `start` (still `NotImplementedError` locally). `execute`/`start` carry the protocol's basic args plus a generic `extra` passthrough — server-specific args (a client-supplied run id, callbacks, a stored `method_id`) ride `extra`, never named params. Response classes: `PipelexPipelineExecuteResponse` → `PipelexRunResultExecute` (subclasses `RunResultExecute` — `pipeline_run_id` + `pipe_output`), `PipelexPipelineStartResponse` → `PipelexRunResultStart` (subclasses `RunResultStart` — `pipeline_run_id` only). `state` / `created_at` / `finished_at` / `main_stuff_name` / `workflow_id` are pipelex extension fields on the protocol's base responses; the run identifier keeps the name `pipeline_run_id` everywhere.
-- **`mthds` pin → 0.4.0** — the restructured SDK (`mthds.protocol` + `mthds.runners.api`). The agent CLI's API run path uses `MthdsAPIClient` (`mthds.runners.api.client`) directly; domain shapes import from `mthds.protocol.*`, Dict wire models from `mthds.runners.api.models`.
+- **`PipelexRunner` → `PipelexMTHDSProtocol`** — the runner class now implements the MTHDS Protocol (`mthds.protocol.protocol.MTHDSProtocol`, mthds 0.4.1). Method renames: `execute_pipeline` → `execute`, `start_pipeline` → `start` (still `NotImplementedError` locally). `execute`/`start` carry the protocol's basic args plus a generic `extra` passthrough — server-specific args (a client-supplied run id, callbacks, a stored `method_id`) ride `extra`, never named params. Response classes: `PipelexPipelineExecuteResponse` → `PipelexRunResultExecute` (subclasses `RunResultExecute` — `pipeline_run_id` + `pipe_output`), `PipelexPipelineStartResponse` → `PipelexRunResultStart` (subclasses `RunResultStart` — `pipeline_run_id` only). `state` / `created_at` / `finished_at` / `main_stuff_name` / `workflow_id` are pipelex extension fields on the protocol's base responses; the run identifier keeps the name `pipeline_run_id` everywhere.
+- **`mthds` pin → 0.4.1** — the restructured SDK (`mthds.protocol` + `mthds.runners.api`). The agent CLI's API run path uses `MthdsAPIClient` (`mthds.runners.api.client`) directly; domain shapes import from `mthds.protocol.*`, Dict wire models from `mthds.runners.api.models`.
### Changed
@@ -30,7 +30,7 @@
- **Per-workflow tracing setup no longer depends on worker-local leak state.** `GraphTracerManager.open_tracer` raised `ValueError` when a stale tracer key was left behind by a prior interrupted execution on the same worker (e.g. a workflow evicted before its cleanup ran), and `WfPipeRouter` papered over that with a best-effort `except Exception` that silently disabled tracing — dropping the recorded flush command on replay and diverging the trace context carried by all downstream commands. `open_tracer` now pops and replaces a stale tracer (tearing it down, with a WARNING), and the catch-all around tracing setup is gone: the setup block is pure in-memory state, so any failure is a real bug that surfaces deterministically.
- **Temporal workflows no longer hang when worker tracing config differs across replays.** `WfPipeRouter` decided whether to set up per-workflow tracing — and therefore whether to schedule `act_flush_trace_events` — by reading `tracing_config.is_enabled` from worker-local config inside the workflow body. Replaying a workflow on a worker whose tracing config differed from the recorder's (worker restart, rolling deploy, scale-in) produced a divergent command stream, and Temporal's `[TMPRL1100]` nondeterminism error surfaced as a silently hung workflow stuck in workflow-task retries. The workflow now gates tracing setup purely on the presence of `trace_context` in the payload — the submitter's decision, recorded in history — and the worker-local `is_enabled` check happens only inside the flush activity, where reading local config is deterministic-safe (it already no-ops there when tracing is disabled). Side benefit: per-workflow graph assembly no longer requires the worker to have a tracing backend enabled. Guarded by a replay regression test that flips the worker's tracing config mid-workflow.
- **`dry_run_pipeline` now owns its graph transport — graph generation no longer depends on the host's `tracing_config`.** The function requests a graph explicitly (`generate_graph=True`) but relied on the host's configured tracing backend as the emit/assemble channel, so a host with `tracing_config.is_enabled = false` (e.g. pipelex-api's `/validate` in direct mode, where the web-app's Dry Run button lands) always got "Pipeline execution did not produce a graph spec" and a response without `graph_spec`. The run now traces through a scoped `InMemoryEventLog` — the graph comes back under any tracing config, and validation dry-runs stop writing NDJSON/DynamoDB trace events as a side effect when tracing IS enabled. The no-graph contract violation is now a typed `DryRunGraphNotProducedError` (was a bare `PipelexError`, ambiguous in host logs that record only the exception type) — raised by both `dry_run_pipeline` and `dry_run_pipe_in_process`.
-- **tz-aware payloads no longer hang Temporal callers on hosts without a timezone database — kajson bumped to 0.7.0.** kajson ≤ 0.6.0 decoded timezone-aware datetimes via `ZoneInfo(...)`, which needs the IANA tz database: system tz files or the `tzdata` package. On hosts with neither (slim containers, uv-managed standalone Pythons — including the CI test runner, where `tzdata` only arrived transitively via pandas on Python < 3.11), decoding any aware-datetime payload crossing the Temporal boundary (e.g. the `GraphSpec` on `act_dry_validate`'s result) raised `ZoneInfoNotFoundError` *inside the workflow task* — which Temporal retries forever, so the submitter hung instead of failing. Fixed upstream in kajson 0.7.0: its self-sufficient timezone wire format carries the UTC offset (decoding degrades gracefully to a fixed offset instead of raising, and plain UTC decodes with zero tz-database dependence), and kajson now declares `tzdata` as its own runtime dependency, so a tz database is always available for named zones.
+- **tz-aware payloads no longer hang Temporal callers on hosts without a timezone database — kajson bumped to 0.7.0.** kajson ≤ 0.6.0 decoded timezone-aware datetimes via `ZoneInfo(...)`, which needs the IANA tz database: system tz files or the `tzdata` package. On hosts with neither (slim containers, uv-managed standalone Pythons — including the CI test runner, where `tzdata` only arrived transitively via pandas on Python < 3.11), decoding any aware-datetime payload crossing the Temporal boundary (e.g. the `GraphSpec` on `act_dry_validate`'s result) raised `ZoneInfoNotFoundError` _inside the workflow task_ — which Temporal retries forever, so the submitter hung instead of failing. Fixed upstream in kajson 0.7.0: its self-sufficient timezone wire format carries the UTC offset (decoding degrades gracefully to a fixed offset instead of raising, and plain UTC decodes with zero tz-database dependence), and kajson now declares `tzdata` as its own runtime dependency, so a tz database is always available for named zones.
### Added
@@ -43,11 +43,11 @@
- **`dry_run_pipe_in_process` — graph-producing dry-run that never dispatches.** New entry in `pipelex/pipe_run/dry_run_pipeline.py`: dry-runs a pipe against an already-open library fully in-process and returns its `GraphSpec`, even under a Temporal-enabled hub. Three ContextVar scopes pin the whole run in-process: `scoped_event_log` (in-memory trace transport), `scoped_pipe_router` (nested controller sub-pipes resolve a local router instead of the `TemporalPipeRouter`), and the new `pipelex.hub.scoped_content_generator` (inference leaves resolve an inline dry generator instead of `ContentGeneratorInWorkflow` — holds regardless of whether the DRY mock lives at the pipe level or the leaf). This is the graph half of running `/validate` as one in-process Temporal activity.
- **`scoped_event_log` — a shared, scope-pinned trace-event transport.** New `pipelex.hub.scoped_event_log(event_log)` context manager (with `get_event_log_override()` accessor, mirroring `scoped_pipe_router`): both the write side (tracer emission in `pipeline_run_setup`) and the read side (`assemble_tracing`) now prefer the scoped instance over building their own backend via `make_event_log`, so a run can trace into ONE shared `InMemoryEventLog` — no NDJSON file, no DynamoDB round-trip — and still assemble its `GraphSpec` from it. A set override implies tracing-enabled (honored even when `tracing_config.is_enabled` is off); the scoped instance's `close()` must be idempotent or a no-op (the write-side tracer closes its transport at teardown — `InMemoryEventLog`'s is a no-op). ContextVar-scoped, so concurrent runs with separate scopes stay isolated. This is the foundation for running the `/validate` graph dry-run fully in-process and in-memory inside a Temporal activity.
+
### Coordination
- **pipelex-worker lockstep** — the Temporal payload models cross into `pipelex-worker` via the `pipelex` pin; the worker must ship the same `pipelex` version as `pipelex-api` when the MTHDS Protocol unification deploys.
-
## [v0.32.1] - 2026-06-09
### Added
diff --git a/pipelex/pipeline/runner.py b/pipelex/pipeline/runner.py
index 093b5441e..859db0d5a 100644
--- a/pipelex/pipeline/runner.py
+++ b/pipelex/pipeline/runner.py
@@ -52,7 +52,7 @@ if TYPE_CHECKING:
from pipelex.system.configuration.configs import PipelineExecutionConfig
# The MTHDS Protocol version this runtime implements (mthds-protocol.openapi.yaml).
-MTHDS_PROTOCOL_VERSION = "0.1.0"
+MTHDS_PROTOCOL_VERSION = "0.6.0"
class PipelexValidationReport(ValidationReport):
diff --git a/pyproject.toml b/pyproject.toml
index d7a37045f..4e3d3836e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,7 +30,7 @@ dependencies = [
"json2html>=1.3.0",
"kajson==0.7.0",
"markdown>=3.6",
- "mthds>=0.4.0",
+ "mthds>=0.4.1",
"networkx>=3.4.2",
"openai>=2.0.0",
"opentelemetry-api",