-
Notifications
You must be signed in to change notification settings - Fork 138
Description
Problem
azure_openai.py extends LLMBackend directly instead of ChatCompletionsBackend. This means it lacks MCP support, custom tool support, StreamingBufferMixin (compression), and duplicates significant code from ChatCompletionsBackend.
Audit against massgen/skills/backend-integrator/SKILL.md found these issues:
Critical
- Wrong base class —
class AzureOpenAIBackend(LLMBackend)should beChatCompletionsBackend(or at minimumCustomToolAndMCPBackend). Azure OpenAI is OpenAI-compatible, so SKILL.md recommendsChatCompletionsBackend.- Claims
FilesystemSupport.MCPbut has no MCP implementation - No custom tool support
- Duplicates param filtering, chunk conversion, and tool accumulation logic inline
- Claims
- Missing timing methods —
start_api_call_timing(),record_first_token(),end_api_call_timing()are never called instream_with_tools(). Breaks observability/metrics. - No
StreamingBufferMixin— No compression support._clear_streaming_buffer()and_finalize_streaming_buffer()never called.
Medium
- Dead workflow tool code — Lines 353-777 contain elaborate workflow tool extraction logic (
_build_workflow_tools_system_prompt(),_prepare_messages_with_workflow_tools(),_extract_workflow_tool_calls()with 5 strategies) that is never called fromstream_with_tools().
Recommended Fix
Option A (preferred): Refactor to inherit from ChatCompletionsBackend. Remove duplicated code. This gives MCP, custom tools, compression, timing, and workflow tools for free. Azure-specific differences (endpoint config, API version, client creation) can be handled via overrides.
Option B: Keep LLMBackend inheritance but add missing timing calls, remove false FilesystemSupport.MCP claim (return NONE), and either wire up or remove dead workflow tool code.
Files
massgen/backend/azure_openai.py(~831 lines)- Tests:
massgen/tests/test_azure_openai_backend.py - Configs:
massgen/configs/providers/azure/