Skip to content

Conversation

@shreymodi1
Copy link
Contributor

@shreymodi1 shreymodi1 commented Dec 2, 2025


name: Pull Request
about: Propose changes to the codebase
title: "Brief description of changes"
labels: ''
assignees: ''


Description

Please include a summary of the change and which issue is fixed or feature is implemented. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)
Implements # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactoring/Code cleanup
  • Build/CI/CD related changes
  • Other (please describe):

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project (ran black ., isort ., flake8 .)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots (if applicable)

If applicable, add screenshots to help showcase your changes.

Additional context

Add any other context about the PR here.


Note

Add comprehensive streaming compliance benchmark and workflow, and enhance rollout/models to record finish_reason/tool_call_count and reasoning/tool-call data.

  • Benchmarks:
    • Add eval_protocol/benchmarks/test_glm_streaming_compliance.py with streaming and non-streaming tests for:
      • Structured JSON output, tool-call correctness, multi-tool calls, argument/type validation, and JSON preservation.
      • Reasoning effort on/off behavior and tools+reasoning combinations.
      • Streaming vs non-streaming output consistency.
    • Include helpers for tool-call normalization, JSON parsing, XML/forbidden tag and reasoning-leakage checks.
  • CI:
    • Add GitHub Actions workflow /.github/workflows/streaming_compliance.yml to run the benchmark (configurable inputs) and upload JSON artifacts.
  • Runtime/Eval Engine:
    • Update eval_protocol/pytest/default_single_turn_rollout_process.py to:
      • Forward reasoning_effort via extra_body, disable cache per request.
      • Extract and attach reasoning_content and normalized tool_calls to assistant Message.
      • Populate row.execution_metadata.finish_reason and tool_call_count.
  • Models:
    • Extend ExecutionMetadata with finish_reason and tool_call_count fields.

Written by Cursor Bugbot for commit 688e87f. This will update automatically on new commits. Configure here.

if delta.content:
stream_content_parts.append(delta.content)
if delta.tool_calls:
stream_tool_calls = delta.tool_calls
Copy link

Choose a reason for hiding this comment

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

Bug: Streaming tool calls overwritten instead of accumulated

In test_streaming_output_consistency, the streaming tool calls handling overwrites stream_tool_calls on each chunk with stream_tool_calls = delta.tool_calls instead of accumulating deltas. OpenAI's streaming API returns tool calls as incremental deltas that need to be merged by index across multiple chunks. The current code only preserves the last chunk's tool call data, causing the tool call comparison at line 2162 to compare incomplete data against the non-streaming response, potentially producing false positives or false negatives.

Fix in Cursor Fix in Web

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