Repository navigation
jobs: a refused job keeps its refusal as data (error_detail) - #107
Merged
Merged
Conversation
GenreOpRefused takes an optional detail mapping; a job that raises it records it as Job.error_detail (JSON round-tripped, durable, on to_dict and summarize), so a host reads a refusal's figures without parsing the sentence in error. First customer: reelee's spend cap (reeleehq/reelee#570). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nore a non-mapping detail (review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
GenreOpRefusedtakes an optionaldetailmapping. A job that raises it records it asJob.error_detail(JSON round-tripped; durable across a runtime reset; onto_dictandsummarize). Only a refusal carries one.Why: reeleehq/reelee#570. reelee's spend cap refuses a queued job when it starts, and reelee-web currently recognises that by matching the operator sentence in
errorand parsing the figures out of it.Tests:
test_a_refused_job_keeps_its_refusal_as_data,test_only_a_refusal_carries_a_detail, plus doctests.Adversarial review: FIX-FIRST, fixed. (1) a key echoed into
detailwas persisted unredacted:error_detail_ofnow redacts every string of the detail with the job's secrets (testtest_a_refused_job_never_persists_a_key_quoted_in_its_detail, negative-controlled); (2) NaN/inf passed the round trip and would make every response carrying the job unserialisable: strict JSON (allow_nan=False) drops such a detail. Also: a non-mappingdetailis ignored instead of raising in the constructor, and the read path takes only the redacted detail the worker recorded.🤖 Generated with Claude Code