fix: hydrate approval resume via Flow._state, not the read-only property - #72
Open
aleksUIX wants to merge 1 commit into
Open
fix: hydrate approval resume via Flow._state, not the read-only property#72aleksUIX wants to merge 1 commit into
aleksUIX wants to merge 1 commit into
Conversation
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.
Summary
Fixes #67.
POST /approvals/{id}/resume500s after a successful decide._resume_proposal_flowassignedflow.state = ProposalState(**snapshot). CrewAI 1.15 madeFlow.statea read-only@property, so__setattr__raisesAttributeError: property 'state' of 'ProposalHandlingFlow' object has no setter. Decide still writes the approval; only resume blows up.The property reads the
_statePrivateAttr. Existing tests already hydrate that way (flow._state = stateintest_proposal_error_taxonomy.py). Resume now does the same. In-place mutation offlow.state.proposal_idetc. is unchanged.Empty snapshots use
snapshot or {}soProposalState(**None)cannot throw.Fix
Out of scope (deliberate)
deal_id or "",deal_id_required) or Rate card is writable but is not read by the quote, deal-booking or negotiation pricing paths #69 (rate card).Test plan
acceptedrejectedwithout assigningflow.statePOST /approvals/{id}/resumeafter decide returns 200 (resumed_from_approval)uv run --locked ruff check src/andruff format --check src/ tests/cleanCloses #67