Skip to content

Bug report: "tool_parsers/qwen3_coder.py:79 crashes on ISO 8601 dates #1236

@zubair-akbar

Description

@zubair-akbar

mlx_lm/tool_parsers/qwen3_coder.py:79 calls ast.literal_eval() on every tool-call parameter value. This crashes on any string that looks like the start of a number but isn't valid Python (most notably ISO 8601 timestamps), causing the server to drop the entire tool call.

Fixed locally by wrapping ast.literal_eval with a try/except that falls back to the raw string. Two-line patch:

      try:                                                                                                        
          return ast.literal_eval(param_value)                                                                    
      except (ValueError, SyntaxError):                                                                           
          return param_value                

Applies at both call sites in _convert_param_value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions