Skip to content

Conversation

open-swe[bot]
Copy link
Contributor

@open-swe open-swe bot commented Jul 31, 2025

Fixes #5784

This PR modifies the AgentState in chat_agent_executor.py to make is_last_step and remaining_steps optional by using NotRequired from typing_extensions.

Changes include:

  • Updated imports to include NotRequired
  • Modified AgentState TypedDict to use NotRequired for is_last_step and remaining_steps
  • Added is_last_step to AgentStatePydantic
  • Updated docstring and validation logic to reflect optional fields

All tests pass, and the changes ensure these fields are truly optional in the state management.

@open-swe open-swe bot added the open-swe label Jul 31, 2025
Copy link

vercel bot commented Jul 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langgraph-docs-preview ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2025 7:46pm

@open-swe open-swe bot marked this pull request as ready for review July 31, 2025 19:46
@open-swe open-swe bot changed the title [WIP]: Fix AgentState to use NotRequired for is_last_step and remaining_steps managed values fix: Mark is_last_step and remaining_steps as NotRequired in AgentState Jul 31, 2025
@sydney-runkle sydney-runkle changed the title fix: Mark is_last_step and remaining_steps as NotRequired in AgentState fix(langgraph): Mark is_last_step and remaining_steps as NotRequired in AgentState Jul 31, 2025
@sydney-runkle
Copy link
Collaborator

This did an ok job but I'm going to take a diff approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix AgentState to use NotRequired managed values
2 participants