Repository navigation
Redact map keys in typed-value errors and refuse dataclass errors as typed - #252
Merged
Merged
Conversation
…yped
TypedValueError paths name a map entry by position ("[entry 1]"), never
by its key, because keys are user data. A dataclass __post_init__
ValueError and a too-deeply-nested payload become non-retryable
TypedValueErrors without repeating their messages. Follow-up from the
#247 review.
Refs #184.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Member
Author
|
General interim review (Security unavailable): CLEAR at a27b125 (independent reviewer)
Non-blocking follow-ups:
Merge at this exact SHA and post a readback (merge tree = head tree). |
Member
Author
|
Merged at General's clearance of exact head
|
This was referenced Nov 4, 2026
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.



These are the follow-ups General required in the #247 clearance before 2.14.0, the next release that includes typed values. #184 stays open for slice 2.
Changes (
src/durable_workflow/_typed_values.py,workflow.py)dict[str, T]entry is now named by its position (scores[entry 1]) instead ofscores['ada@example.test']. Field names and list indexes are unchanged, because they come from the schema rather than from the data.TypedValueError. AValueErrorfrom__init__/__post_init__during decoding becomesTypedValueError(path, Class, "the dataclass refused the decoded fields"). The original message isn't repeated, because it can carry values, and it isn't chained as the cause. It is non-retryable in a typed activity and is raised at theyieldforresult_type.TypedValueError. The newdecode_payload_valueis now the entry point for typed activity arguments andresult_type. It turns aRecursionErrorfrom a deeply nested payload intoTypedValueError(path, type, "the value is nested too deeply"), which is non-retryable.Tests (
tests/test_typed_values.py)ada@example.test. It expects the pathshipment.weights[entry 0]and asserts the key is absent from the message.test_map_entry_paths_never_name_the_key: the second entry's path isscores[entry 1], with no key text.test_a_dataclass_that_refuses_its_fields_is_a_typed_value_error: the__post_init__message carries-7, which is absent from the error, and there is no__cause__.test_a_too_deeply_nested_payload_is_a_typed_value_error: a 5,000-deepNodechain givesthe value is nested too deeply, and the error is aNonRetryableError.test_a_typed_activity_maps_refusals_to_typed_value_errors: the refusal flows throughactivity.defn(typed=True).Local runs at a27b125 (lab2, Python 3.13, this branch's source)
ruffis clean, andmypy src/durable_workflowreports no issues.tests/integration): 4916 passed, 4 skipped.Not merged or released.
🤖 Generated with Claude Code