Skip to content

chore: Require ClientX 0.7.0 - #51

Merged
slatecipher merged 1 commit into
mainlinefrom
chore/require-clientx-0.7.0
Dec 3, 2026
Merged

slatecipher merged 1 commit into
mainlinefrom
chore/require-clientx-0.7.0

Conversation

@slatecipher

Copy link
Copy Markdown
Owner

Raises gravitywell's ClientX floor from 0.6.0 to 0.7.0, released yesterday with slatecipher/ClientX#196.

What changed and why

ClientX 0.7.0 checks every call's arguments against their types, in pydantic's lax mode, before it sends a request. gravitywell never set validate_arguments=True, so on ClientX 0.6 its Python calls weren't checked at all. gravitywell's own constraints, such as timer's Json(gt=0), the rule types' Literal and the counts' types, held only for AI tools. A bad argument went to the Pi-hole:

Call ClientX 0.6.0 ClientX 0.7.0
dns.set_blocking(blocking=False, timer=-5) sends {"timer":-5} ArgumentError (timer), nothing sent
domains.get("blok", "exact", ...) sends GET /api/domains/blok/... ArgumentError (rule_type), nothing sent
stats.top_domains(count="ten") sends count=ten ArgumentError (count), nothing sent

Requiring 0.7.0 gives one behaviour for every install, which docs/errors.md describes: ArgumentError means gravitywell refused a call before sending anything.

  • pyproject.toml: clientx>=0.7.0 in the dependencies, the mcp extra and the dev group, still with no upper bound. uv.lock moves to 0.7.0, and only ClientX changes in it.
  • test_pi_hole.py: one test, checking that an argument that doesn't fit is refused before sending, for a bound, a Literal and a type. It fails on ClientX 0.6.0, so it guards the floor.
  • docs/errors.md, llms.txt and CHANGELOG.md describe the new behaviour.
  • No changes to src/: gravitywell runs on 0.7.0 as it is. ClientX#196 was adjusted while in review so that gravitywell's Teleporter upload, a tuple[str, bytes, str] file, needs no SkipValidation.

Breaking change

Code that passed an argument that doesn't fit its type now gets clientx.ArgumentError, where before it got the Pi-hole's httpx2.HTTPStatusError, or a request that went through. Projects that also use ClientX 0.6 for clients of their own have to move to 0.7.0. The changelog entry says both. make release-pr will make the next release 0.3.0.

Testing

  • make check: lint, strict pyright and 364 tests, at 100% coverage. make typecheck-tests is clean too.
  • The new test fails on ClientX 0.6.0 and passes on 0.7.0.
  • Live, against a test Pi-hole (FTL v6.9) with the published clientx 0.7.0 wheel:
    • All 56 read-only tools pass, each called sync, async and through Tool.call().
    • Teleporter export, and a restore of the groups table only, pass sync and async.
    • set_blocking with a timer passes, and the Pi-hole was left as it was.
    • The session ID stays redacted in the logs the log methods return.

🤖 Generated with Claude Code

- Raise the ClientX floor to `clientx>=0.7.0` in the dependencies, the `mcp` extra and the dev group, and lock 0.7.0.
- ClientX 0.7.0 checks every call's arguments against their types before sending, so gravitywell's own constraints, such as `timer`'s `Json(gt=0)` and the rule types' `Literal`, hold for Python callers too: an argument that doesn't fit raises `ArgumentError`, and nothing reaches the Pi-hole. With 0.6, such a call went to the Pi-hole.
- Test that such an argument is refused before sending: a bound, a `Literal` and a type. The test fails on ClientX 0.6.0.
- Say so in `docs/errors.md`, `llms.txt` and the changelog, as a breaking change.
- No changes to `src/`: gravitywell already runs on 0.7.0 as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slatecipher slatecipher added breaking change Changes public API behavior; call out in the changelog maintenance Tooling, configuration, and other upkeep labels Dec 3, 2026
@slatecipher
slatecipher merged commit 736129d into mainline Dec 3, 2026
8 checks passed
@slatecipher
slatecipher deleted the chore/require-clientx-0.7.0 branch December 3, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Changes public API behavior; call out in the changelog maintenance Tooling, configuration, and other upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant