Skip to content

Fix state mutation in task_results handling#48

Merged
iamtekson merged 3 commits intodevfrom
copilot/sub-pr-46
Feb 3, 2026
Merged

Fix state mutation in task_results handling#48
iamtekson merged 3 commits intodevfrom
copilot/sub-pr-46

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 3, 2026

Addresses state mutation issue where task_results dictionary was retrieved from state and modified in-place, violating immutability requirements for LangGraph state management.

Changes

Changed from mutating pattern:

task_results = state.get("task_results", {})
task_results[current_task_id] = {...}

To immutable pattern:

task_results = dict(state.get("task_results", {}))
task_results[current_task_id] = {...}

Files modified:

  • agents/multi_step_processing.py (4 instances)
    • Line 601: execute_node_multi success case
    • Line 627: execute_node_multi error case
    • Line 957: execute_llm_task_node success case
    • Line 980: execute_llm_task_node error case

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: iamtekson <39838116+iamtekson@users.noreply.github.com>
Copilot AI changed the title [WIP] Update multi-step algorithms support based on feedback Fix state mutation in task_results handling Feb 3, 2026
Copilot AI requested a review from iamtekson February 3, 2026 05:13
@iamtekson iamtekson marked this pull request as ready for review February 3, 2026 05:15
@iamtekson iamtekson merged commit 5b1b3e3 into dev Feb 3, 2026
1 check passed
@iamtekson iamtekson deleted the copilot/sub-pr-46 branch February 3, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants