Regenerate hanzoai client from unified OpenAPI spec (retire Stainless) - #45
Merged
Conversation
…ainless) Replace the Stainless-generated `hanzoai` client (188 legacy LLM-gateway endpoints) with an openapi-generator `python` (urllib3 + pydantic v2) client built from hanzoai/openapi `hanzo.yaml` — the full unified api.hanzo.ai/v1 surface (493 API groups, 1710 models, all /v1 products). - scripts/generate.sh: the one-way generator; emits only pkg/hanzoai (other pkg/hanzo-* packages untouched). - pyproject: deps -> urllib3 / python-dateutil / pydantic>=2 / typing-extensions; version 2.2.3 -> 3.0.0 (breaking surface change). - tests/: Stainless client tests replaced with a surface smoke test. - .github/workflows/generate.yml: regenerate on openapi spec-update. - Base URL https://api.hanzo.ai, Bearer hk- / JWT auth. Verified: wheel hanzoai-3.0.0 builds, installs into a clean venv, and `import hanzoai` + product API construction succeed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zooqueen
pushed a commit
that referenced
this pull request
Jul 5, 2026
…hanzo-mcp (3.0.1) #45 regenerated hanzoai as a pure OpenAPI client and DELETED the hand-written core-SDK modules (config/mcp/session/protocols/…) that live in the same package but aren't part of API generation. hanzo-mcp imports all four → the published hanzoai 3.0.0 crashed EVERY hanzo-mcp consumer on startup ('No module named hanzoai.protocols') → the MCP server wouldn't boot → Claude Code couldn't reconnect. Restore the 4 self-contained modules hanzo-mcp needs (verified: zero imports of the removed Stainless internals); they coexist with the generated api/models client. Left agents/auth/cluster/llm_client OUT — they import the removed ._client and need migration to the new client (separate follow-up, no reconnect-path consumer). Bump 3.0.0→3.0.1. Boot-proven: hanzo-mcp starts, 26 tool packages / 29 tools, MCP initialize OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retire Stainless; regenerate from hanzoai/openapi hanzo.yaml with openapi-generator (full api.hanzo.ai/v1 surface, all /v1 products). scripts/generate.sh is the one-way generator; CI regenerates on spec-update and publishes on semver tag. Verified locally (build/import/smoke green). (wheel hanzoai-3.0.0 builds+installs+imports; pydantic v2 / urllib3)