Surfaced by independent review of PR #25 (#12). Non-blocking; filed as follow-up.
Problem
In nat_agent_streaming/handler.py, the confirmation check (filter_authorized_confirmations, a get_item) and the consume (consume_confirmation, a delete/update_item) are two separate DynamoDB operations with no transaction. Two concurrent invocations sharing a session could both pass the filter before either consumes, allowing one confirmed destructive action to execute twice.
Acceptance Criteria
Source: PR #25 review. Relates to epic #18.
Surfaced by independent review of PR #25 (#12). Non-blocking; filed as follow-up.
Problem
In
nat_agent_streaming/handler.py, the confirmation check (filter_authorized_confirmations, aget_item) and the consume (consume_confirmation, adelete/update_item) are two separate DynamoDB operations with no transaction. Two concurrent invocations sharing a session could both pass the filter before either consumes, allowing one confirmed destructive action to execute twice.Acceptance Criteria
consume_confirmationuses aConditionExpressionasserting the tool_id is still pending (e.g.contains(pending_tool_ids, :tid)), or filter+consume run in a DynamoDB transactionSource: PR #25 review. Relates to epic #18.