Skip to content

fix: prevent list aliasing in _populate_state_from_result#3924

Open
AAliKKhan wants to merge 1 commit into
openai:mainfrom
AAliKKhan:fix/list-aliasing-result
Open

fix: prevent list aliasing in _populate_state_from_result#3924
AAliKKhan wants to merge 1 commit into
openai:mainfrom
AAliKKhan:fix/list-aliasing-result

Conversation

@AAliKKhan

Copy link
Copy Markdown
Contributor

In _populate_state_from_result, when _model_input_items is not set on the result, state._generated_items was assigned a bare reference to result.new_items instead of a copy. Since state._generated_items can be mutated (e.g., appending items during interruption approval), this silently corrupted result.new_items — the primary public API for consuming agent output. The fix makes a defensive copy via list().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants