Commit 752fa0f
fix: make failed-post retry work — enum status mismatch (zernio-claude-plugin#1) (#33)
The MCP retry path never recognized a failed post. Two bugs conspired:
1. posts_retry compared the post's status — a generated plain Enum with an
unstable positional name (Status10 in the released build, renumbered on
every spec regen) — against the handwritten PostStatus str-enum. Two
different enum classes never compare equal, so every failed post was
rejected with 'is not in failed status (current: Status10.FAILED)'.
2. posts_retry_all_failed / posts_list_failed passed PostStatus.FAILED into
the query string, where httpx serialized it via str() as
'status=PostStatus.FAILED' instead of 'status=failed', so the API
matched nothing and the tools reported no failed posts.
Fixes:
- codegen: add --use-subclass-enum so generated enums are (str, Enum) and
compare equal to their plain value and to the PostStatus twin
(models regenerated).
- resources: unwrap Enum members to .value in _build_params/_build_payload —
in the generator template (each generated resource carries its own copy
that shadows BaseResource) and in the handwritten BaseResource
(resources regenerated).
- mcp: posts_retry guard compares plain status values and reports the clean
value ('current: scheduled') in the warning.
- tests: unit tests pin enum unwrapping and value-compatibility;
test_mcp_retry_regression.py drives the real MCP tools against a strict
in-memory fake API (httpx.MockTransport, no network) that only matches
the literal status=failed — both bugs reproduce exactly against the
unfixed code with the same error messages as the issue.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 5f26567 commit 752fa0f
64 files changed
Lines changed: 1580 additions & 273 deletions
File tree
- scripts
- src/late
- client
- mcp
- models/_generated
- resources
- _generated
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
397 | 402 | | |
| 403 | + | |
398 | 404 | | |
399 | 405 | | |
400 | 406 | | |
401 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
402 | 415 | | |
403 | 416 | | |
404 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
405 | 421 | | |
| 422 | + | |
406 | 423 | | |
407 | 424 | | |
408 | 425 | | |
409 | 426 | | |
410 | 427 | | |
| 428 | + | |
| 429 | + | |
411 | 430 | | |
412 | 431 | | |
413 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
761 | 762 | | |
762 | 763 | | |
763 | 764 | | |
| |||
0 commit comments