Skip to content

fix: auto-wire generated resources into client#20

Merged
mikipalet merged 17 commits into
mainfrom
develop
Apr 2, 2026
Merged

fix: auto-wire generated resources into client#20
mikipalet merged 17 commits into
mainfrom
develop

Conversation

@mikipalet

Copy link
Copy Markdown
Member

Summary

  • Generation script now auto-updates resources/__init__.py and late_client.py when new resources are added
  • Fixes validate_subreddit MCP tool error: 'Zernio' object has no attribute 'validate'
  • No more manual wiring needed when OpenAPI spec adds new tags

What changed

  • generate_resources.py: detects manual vs auto-generated resources, updates __init__.py and client file automatically
  • late_client.py: uses marker comments for auto-registration (32 resources, was 20)
  • resources/__init__.py: now auto-generated, prefers manual implementations over auto-generated

Test plan

  • client.validate.validate_subreddit("programming") works
  • Existing resources (posts, accounts, etc.) still work
  • Running python scripts/generate_resources.py twice produces identical output

🤖 Generated with Claude Code

github-actions Bot and others added 17 commits April 2, 2026 17:22
- Auto-generated SDK updates
- Version: 1.3.28
- Auto-generated SDK updates
- Version: 1.3.29
- Auto-generated SDK updates
- Version: 1.3.30
- Auto-generated SDK updates
- Version: 1.3.31
- Auto-generated SDK updates
- Version: 1.3.32
- Auto-generated SDK updates
- Version: 1.3.33
- Auto-generated SDK updates
- Version: 1.3.34
- Auto-generated SDK updates
- Version: 1.3.35
* fix: fix broken model imports blocking regenerate pipeline

Move 7 models removed from OpenAPI spec (CaptionResponse, DownloadResponse,
DownloadFormat, HashtagCheckResponse, HashtagInfo, TranscriptResponse,
TranscriptSegment) to responses.py since the endpoints still work.
Update models/__init__.py and tools.py imports accordingly.
Fix test_exhaustive Type enum references (Type -> Type5).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use string values in media type tests instead of unstable Type5 enum

The generated enum name (Type5) is not stable across regenerations.
Use string values with Pydantic coercion instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Auto-generated SDK updates
- Version: 1.3.36
The generation script created resource files (like ValidateResource) but
never updated resources/__init__.py or late_client.py, requiring manual
wiring that was easy to miss. This caused client.validate to be missing,
breaking validate_subreddit MCP tool calls.

Now generate_resources.py auto-updates both files:
- resources/__init__.py: prefers manual implementations over auto-generated
- late_client.py: imports + registration between marker comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

📦 Release Preview

Item Value
Version 1.3.36
Git tag exists ✅ Yes
PyPI version exists ✅ Yes

⏭️ No Release

Version 1.3.36 already exists on both GitHub and PyPI.

💡 To create a new release, update version in pyproject.toml

@mikipalet mikipalet merged commit 4d484c7 into main Apr 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants