Skip to content

Fix : Allow streaming actions to yield just state for all but the last one#779

Merged
skrawcz merged 1 commit into
apache:mainfrom
hemanthsavasere:streaming-actions-yield
May 16, 2026
Merged

Fix : Allow streaming actions to yield just state for all but the last one#779
skrawcz merged 1 commit into
apache:mainfrom
hemanthsavasere:streaming-actions-yield

Conversation

@hemanthsavasere
Copy link
Copy Markdown
Contributor

@hemanthsavasere hemanthsavasere commented May 16, 2026

Fixes : #277

Summary

  • Allow intermediate yields in _run_single_step_streaming_action and _arun_single_step_streaming_action to be plain dict instead of requiring (dict, None) tuples
  • Backward compatible — existing (dict, None) yields still work
  • Added callback tests verifying PostStreamItemHook fires correctly for plain dict yields
  • Updated streaming_action docstring example to show plain dict yield

Intermediate yields in streaming actions can now be plain dicts
instead of requiring (dict, None) tuples. The (dict, None) form
still works for backward compatibility.
@github-actions github-actions Bot added the area/core Application, State, Graph, Actions label May 16, 2026
@hemanthsavasere hemanthsavasere changed the title feat: allow plain dict yields in single-step streaming actions Fix : Allow streaming actions to yield just state for all but the last one May 16, 2026
Copy link
Copy Markdown
Contributor

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean ergonomic improvement — well-tested and backwards compatible. The existing state_update is None guard after generator exhaustion ensures users still get a clear error if they forget the final (result, state) tuple.

Nice first contribution!

@skrawcz skrawcz merged commit eb78310 into apache:main May 16, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Application, State, Graph, Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow streaming actions to yield just state for all but the last one

2 participants