Repository navigation
Commit b198012
committed
feat: limit response parsing to values the SDK does not recognize
#651 conflated two things. Handling values the SDK does not recognize -- new
event types, action types, error codes, enum values -- was already on main
before it, and is what forward compatibility needs. What #651 added on top was
tolerance for payloads that are malformed rather than merely new: a list sent as
a scalar, an object sent as a string, a payload that is not an object.
That is not forward compatibility, it is a defect being swallowed. A null list
was already read as empty, so the new guards only caught genuinely broken data
and turned it into an empty list or None. Worse, catching exceptions around a
known variant meant one bad field silently downgraded a typed event to an
untyped DeepAttrDict, with nothing to tell the caller why the type changed.
Removes seam/parse.py, the isinstance guards in every from_dict, and the
exception handling around known variants. The unrecognized-discriminator
fallback that predates #651 is untouched, so unknown event types still yield a
DeepAttrDict, unknown error codes still fall back per item, and unknown enum
values still read as themselves.
SeamActionAttemptUnknownStatusError stays. The action attempt contract is
strict: waiting promises a succeeded attempt or a raise, and returning an
unrecognized status as a success reports something the SDK cannot vouch for.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2kJ4nGaM8imZCVMEKjmXA1 parent 4bab5aa commit b198012
38 files changed
Lines changed: 1540 additions & 3006 deletions
File tree
- codegen/layouts
- partials
- seam
- resources
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 4 | | |
12 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 42 | + | |
54 | 43 | | |
55 | 44 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 45 | + | |
60 | 46 | | |
This file was deleted.
0 commit comments