Skip to content

fix(generator): spec defaults of {} or [] become None, not shared mutable kwargs - #70

Open
Zernio-Elean wants to merge 1 commit into
developfrom
fix/generator-no-mutable-defaults
Open

Zernio-Elean wants to merge 1 commit into
developfrom
fix/generator-no-mutable-defaults

Conversation

@Zernio-Elean

Copy link
Copy Markdown
Contributor

Why

Develop's regenerate (fa853d4) emitted six inputs: dict[str, Any] | None = {} kwargs in automations.py. ruff check src tests fails B006 on them, so the Tests lint step is red on every open PR (e.g. #61).

What

  • generate_resources.py: a spec default that is a dict or list renders as None. _build_payload drops None, so the field is omitted and the API applies its documented default.
  • automations.py regenerated: only the six = {} lines change (develop's generator on the live spec reproduces develop byte for byte as a control).
  • Test: the generated signature has no = {}/= [] and the call sends only the non-mutable default. It fails without the generator change.

…able kwargs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Zernio-Elean

Copy link
Copy Markdown
Contributor Author

Opus review (fresh context): APPROVE

  • _build_payload drops None, so the six methods now omit inputs and the API applies its default; no caller or test sends inputs={} (MCP wrappers already default to None).
  • generate_mcp_tools.py already emits None for objects and arrays; the README generator renders no defaults. No other mutable kwarg default under src.
  • New test fails without the generator change, passes with it. 1617 passed, 14 skipped; ruff check src tests clean. CI green on 3.10/3.11/3.12.

This branch has not been deployed

No deployments
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.

1 participant