Skip to content

Info: MiMo parser returns string when tool param has no type (anyOf-only) #2335

Description

@yanyihan-xiaomi

Behavior (not a mimocode bug)

MiMo models / inference parser have a fixed behavior on tool-call top-level (or nested) parameters:

  • If the schema node has no explicit type (e.g. only anyOf / union arms), the parser returns a string for that field instead of a structured object.

This is not something mimocode needs to “fix” in the model or wire format.

What mimocode should do

Handle a string payload correctly at the tool boundary:

  • If the tool expects an object, accept object | string
  • When it is a string, JSON.parse (or equivalent) then validate with the same schema
  • Do not teach the model in prompts/errors that “string is allowed” — that is a parser-side phenomenon

Desktop tts_speech.voice already does this (parseMaybeString + zod). Same pattern applies to any nested union tool arg.

Closed

Documenting behavior only; no engine work tracked here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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