Skip to content

feat: update input streaming#684

Open
maksymbuleshnyi wants to merge 5 commits intomainfrom
feat/tool-input-policy
Open

feat: update input streaming#684
maksymbuleshnyi wants to merge 5 commits intomainfrom
feat/tool-input-policy

Conversation

@maksymbuleshnyi
Copy link
Copy Markdown
Contributor

@maksymbuleshnyi maksymbuleshnyi commented Apr 7, 2026

Note

Medium Risk
Changes core agent streaming/parsing behavior for function-calling and parallel tool execution, which could affect event ordering and consumers that rely on prior streaming semantics. Risk is mitigated by new integration tests that validate streaming event sequences across inference modes.

Overview
Tool-input streaming is now more structured and reliable. The streaming parser emits a dedicated tool_input_start event (via new AgentToolInputStartData) before the first tool_input delta, and refactors JSON-mode parsing to immediately advance to subsequent fields within the same chunk (fixing missed action_input when reasoning completes).

Parallel tool-call metadata is enriched. Per-tool thought is propagated through parallel tool-call schemas (ToolCallItem.thought) and into streamed batch reasoning payloads, and single-tool reasoning events are suppressed for tools executed in parallel to avoid duplicate/incorrect reasoning emission.

Integration coverage is expanded for streaming correctness. Adds an FSM-based streaming assertion helper and updates/extends integration tests to enable streaming and verify valid event transitions across DEFAULT, XML, STRUCTURED_OUTPUT, and native FUNCTION_CALLING parallel modes.

Reviewed by Cursor Bugbot for commit ac18405. Bugbot is set up for automated code reviews on this repo. Configure here.

@maksymbuleshnyi maksymbuleshnyi requested a review from a team as a code owner April 7, 2026 17:49
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
dynamiq/callbacks
   streaming.py63615975%22, 189, 202–203, 241–242, 250, 277–283, 287, 295–300, 308, 316–317, 368, 372, 376, 386, 405, 418, 421, 429–430, 433–436, 474, 525, 538, 542, 557, 564–565, 572–580, 595, 625–628, 630–638, 641–642, 644, 646, 648–653, 655, 657–663, 666–668, 671–675, 678–681, 725–728, 750–753, 769–775, 777–781, 807, 865–868, 874, 877, 901–902, 929, 959, 965, 988, 1015, 1081, 1108–1114, 1116–1119, 1150, 1154, 1156–1168, 1185
dynamiq/nodes/agents
   agent.py69413580%213–216, 221, 229, 234, 252–253, 271–272, 325–327, 488–497, 500–502, 517, 526, 535–536, 552, 555–556, 566–569, 574, 587, 600–601, 616, 628, 633, 649–650, 660, 663, 673, 713–715, 721–723, 837, 842, 893, 927, 929, 944–945, 952, 955, 980, 982–983, 999, 1024–1028, 1095, 1101, 1105, 1108, 1141, 1166, 1169, 1174, 1190, 1194, 1236, 1272–1273, 1299, 1313, 1322, 1325–1326, 1336, 1343, 1405–1406, 1410, 1412–1414, 1416, 1418, 1451, 1459–1460, 1462, 1465, 1468, 1519–1522, 1538, 1547, 1586, 1592–1598, 1604, 1606–1615, 1617–1618
dynamiq/nodes/tools
   parallel_tool_calls.py21195%62
dynamiq/types
   streaming.py99297%68, 76
TOTAL26796895866% 

Tests Skipped Failures Errors Time
1548 1 💤 0 ❌ 0 🔥 2m 0s ⏱️

@maksymbuleshnyi maksymbuleshnyi added the run-integration-tests-with-creds Trigger integration tests with credentials (optional) label Apr 9, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ac18405. Configure here.

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

Labels

run-integration-tests-with-creds Trigger integration tests with credentials (optional)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant