1. 19 Mar, 2026 34 commits
  2. 18 Mar, 2026 6 commits
    • Your Name's avatar
      Fix: Handle both dict and Pydantic Tool models in templates.py · 1c79d9ab
      Your Name authored
      - Fixed AttributeError where Tool.get() was called on Pydantic model
      - Added isinstance() checks to handle both dict and Pydantic Tool formats
      - This fixes the error when using --force-reasoning with tools
      1c79d9ab
    • Your Name's avatar
      Fix: Update VulkanBackend method signatures to match base class · 673ac596
      Your Name authored
      - Added repeat_penalty, presence_penalty, frequency_penalty params to generate() and generate_stream()
      - Changed from **kwargs to explicit parameters to match base class abstract methods
      
      This fixes the TypeError when calling VulkanBackend.generate_stream() with extra params.
      673ac596
    • Your Name's avatar
      Fix: Add repeat_penalty, presence_penalty, frequency_penalty params to NvidiaBackend · 4249e178
      Your Name authored
      - Added missing parameters to generate() and generate_stream() methods
      - Updated _generate_normal() and _generate_stream_normal() to use these params
      - Also updated base.py abstract method signatures to match
      
      This fixes the TypeError when using repeat_penalty with NVIDIA backend.
      4249e178
    • Your Name's avatar
      Fix: Expand tool call repair for all hallucinated formats from debug.log · 441ea0fb
      Your Name authored
      New patterns added to repair_broken_tool_calls():
      
      1. Pattern 4: <tool><function>NAME</function><parameters>XML</parameters></tool>
         - Converts XML parameters to JSON format
         - Fills missing required params (e.g., path for list_files)
      
      2. Pattern 0a: <tool><NAME><params></NAME></tool> (with closing tool name tag)
         - Handles format with closing tag for tool name
      
      3. Expanded guard to detect known tool names used as wrapper tags
         - Now detects <fetch_instructions>, <list_files>, etc.
      
      4. Fixed closure bug in Pattern -2 (wrong wrapper tags)
         - Used default argument to capture loop variable correctly
      
      5. Post-processing: Fill missing required parameters
         - list_files gets path='.' if missing
         - search_files gets path='.' if missing
      
      All 6 test cases pass:
      - <tool><function>list_files</function><parameters>...</parameters></tool> -> OK
      - <fetch_instructions><task>read_file</task>...</fetch_instructions> -> OK
      - <tool_call><list_files></list_files></tool_call> -> OK
      - <tool><list_files><path>.</path></list_files></tool> -> OK
      - Valid JSON passthrough -> OK
      - Missing required params auto-filled -> OK
      441ea0fb
    • Your Name's avatar
      Fix: Expand broken tool call repair patterns · f6c2bf8e
      Your Name authored
      Added 3 new repair patterns to handle additional hallucinated formats:
      
      1. Pattern -1: Fix <tool_call> wrapper format
         - Converts <tool_call><list_files></list_files> to proper <tool> wrapper
         - Handles nested <tool_call><tool>...</tool></tool_call> format
      
      2. Pattern -2: Handle wrong wrapper tags
         - Fixes when model uses tool name as wrapper: <fetch_instructions>...</fetch_instructions>
         - Converts to proper JSON format: {"name": "tool_name", "arguments": {...}}
         - Supports all known tools (read_file, list_files, etc.)
      
      3. Pattern -3: Handle incomplete tool calls with missing parameters
         - Detects <tool><list_files></list_files> (no parameters)
         - Provides sensible defaults: list_files gets path='.' and recursive=False
         - Prevents extraction failures due to missing required parameters
      
      These patterns fix the hallucination issues observed in debug.log where the model
      produces broken XML formats despite --ggg (grammar-guided generation) being enabled.
      f6c2bf8e
    • Your Name's avatar
      Fix: Add broken tool call repair function to parser · 3b7407c2
      Your Name authored
      - Added repair_broken_tool_calls() function that handles common hallucinated formats:
        - <tool><tool_name><param>value</param></tool> (missing closing tag)
        - <tool><tool_name><param>value</param></tool_name></tool>
        - Simple format: <tool><list_files><path>.</path><recursive>true</recursive></tool>
      
      - Integrated repair into:
        - QwenParser.parse() - primary parser for Qwen models
        - ToolCallParser.extract_tool_calls() - fallback parser
        - ModelParserAdapter.extract_tool_calls() - adapter wrapper
      
      The repair converts broken XML format to valid JSON:
      <tool><list_files><path>.</path><recursive>true</recursive></tool>
      becomes:
      <tool>{"name": "list_files", "arguments": {"path": ".", "recursive": true}}</tool>
      
      This fixes tool call extraction when the model hallucinates broken XML tags.
      3b7407c2