Skip to content

feat: v0.1.31#709

Merged
Henry-811 merged 18 commits intomainfrom
dev/v0.1.31
Dec 29, 2025
Merged

feat: v0.1.31#709
Henry-811 merged 18 commits intomainfrom
dev/v0.1.31

Conversation

@Henry-811
Copy link
Collaborator

PR Title Format

Your PR title must follow the format: <type>: <brief description>

Valid types:

  • fix: - Bug fixes
  • feat: - New features
  • breaking: - Breaking changes
  • docs: - Documentation updates
  • refactor: - Code refactoring
  • test: - Test additions/modifications
  • chore: - Maintenance tasks
  • perf: - Performance improvements
  • style: - Code style changes
  • ci: - CI/CD configuration changes

Examples:

  • fix: resolve memory leak in data processing
  • feat: add export to CSV functionality
  • breaking: change API response format
  • docs: update installation guide

Description

Brief description of the changes in this PR

Type of change

  • Bug fix (fix:) - Non-breaking change which fixes an issue
  • New feature (feat:) - Non-breaking change which adds functionality
  • Breaking change (breaking:) - Fix or feature that would cause existing functionality to not work as expected
  • Documentation (docs:) - Documentation updates
  • Code refactoring (refactor:) - Code changes that neither fix a bug nor add a feature
  • Tests (test:) - Adding missing tests or correcting existing tests
  • Chore (chore:) - Maintenance tasks, dependency updates, etc.
  • Performance improvement (perf:) - Code changes that improve performance
  • Code style (style:) - Changes that do not affect the meaning of the code (formatting, missing semi-colons, etc.)
  • CI/CD (ci:) - Changes to CI/CD configuration files and scripts

Checklist

  • I have run pre-commit on my changed files and all checks pass
  • My code follows the style guidelines of this project
  • 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

Pre-commit status

# Paste the output of running pre-commit on your changed files:
# uv run pre-commit install
# git diff --name-only HEAD~1 | xargs uv run pre-commit run --files # for last commit
# git diff --name-only origin/<base branch>...HEAD | xargs uv run pre-commit run --files # for all commits in PR
# git add <your file> # if any fixes were applied
# git commit -m "chore: apply pre-commit fixes"
# git push origin <branch-name>

How to Test

Add test method for this PR.

Test CLI Command

Write down the test bash command. If there is pre-requests, please emphasize.

Expected Results

Description/screenshots of expected results.

Additional context

Add any other context about the PR here.

ncrispino and others added 18 commits December 22, 2025 12:57
This commit fixes the Azure OpenAI backend architecture to use native
tool_calls from the Azure API, making it consistent with Claude,
ChatCompletions, and Grok backends.

Problem:
- Azure backend was converting native tool_calls to plain text
- Then trying to extract them back using regex patterns
- Custom system prompts were injected asking for specific JSON format
- This caused tool call detection to fail, especially for Ministral-3B
- Led to infinite "coordination in progress" loops without consensus

Solution:
1. Fixed _convert_chunk_to_stream_chunk() to yield native tool_calls
   - Changed from converting to text to returning proper StreamChunk
   - Lines 746-753: Now returns StreamChunk(type="tool_calls")

2. Added tool call accumulation in stream_with_tools()
   - Added accumulated_tool_calls dictionary (line 226)
   - Accumulates tool call deltas during streaming (lines 260-279)
   - Yields complete tool_calls after streaming (lines 311-323)
   - Replaced text extraction with native tool call yielding

3. Removed custom system prompt injection
   - Line 153: Now uses messages as-is
   - Tools are passed to API natively via api_params["tools"]

Benefits:
- Works with ALL Azure models (GPT-4o, GPT-4.1-mini, Ministral-3B, etc.)
- No model-specific code needed
- More reliable (native API vs regex parsing)
- Simpler architecture (net removal of ~30 lines)
- Future-proof (works with new models automatically)

Testing:
- Tested with 3-agent setup (GPT-4o, GPT-4.1-mini, Ministral-3B)
- All agents successfully use workflow tools
- Consensus reached without infinite loops
- No regression for existing agents
feat: Fix Logging for Web Search (MAS - 165)
…-main

fix: Fix/azure native tool calls from main
@Henry-811 Henry-811 merged commit 851dbbf into main Dec 29, 2025
21 checks passed
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.

5 participants