Skip to content

feat(server): add Poolside V1 reasoning and tool parsers #195

Description

@pedro-moser

Summary

The Laguna architecture added in #102 uses Poolside's implicit-open reasoning format and GLM-style tool-call tags, but automatic parser selection currently falls through to unrelated generic parsers. As a result, Laguna can load and generate while reasoning/tool transport is silently misclassified.

Expected behavior

For Laguna / Poolside checkpoints, --reasoning-parser auto and --tool-call-parser auto should select a dedicated poolside_v1 pair:

  • reasoning starts implicitly and closes at </think>
  • tool calls use <tool_call>, <arg_key>, and <arg_value> tags
  • streaming must tolerate arbitrary tag chunk boundaries
  • JSON-schema-declared strings preserve source-code whitespace; typed non-string arguments retain GLM conversion behavior
  • explicitly selecting poolside_v1 must be accepted by both CLI choices

Proposed implementation

  • Add poolside_v1 to the reasoning and function-call parser factories.
  • Reuse the existing GLM 4.7 state machine for tool tags while preserving leading/trailing whitespace only when the property schema is exactly type: "string".
  • Auto-select the parser for Laguna architecture/path markers.
  • Keep existing glm47 buffered and streaming behavior unchanged.

Validation

On a branch containing current main plus #102:

  • 254 parser/streaming tests pass across the auto-selection matrix, Poolside-specific cases, GLM/Qwen/Minimax/Muse parsers, default/disabled thinking modes, and reasoning models.
  • Poolside-specific coverage includes buffered and arbitrary-chunk streaming, escapes, text after tool calls, enum-only/untyped schemas, exact string whitespace, and schema-aware GLM coercion for explicitly typed non-string arguments.
  • A real unsloth/Laguna-S-2.1-GGUF revision 750f92f90cf54159c4d7a610cb7b3e74498e75c6 run auto-selected both parsers without explicit flags.
  • Real buffered and streaming requests produced correctly transported tool calls when the checkpoint emitted a valid closed tool block. Failures from the IQ1 checkpoint emitting a tool block inside unclosed reasoning are model-generation failures, not parser corruption.

Related: #102

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions