harn-vm 0.10.102

Async bytecode virtual machine for the Harn programming language
Documentation
# ---------- Z.AI / GLM-5 family (open-weight, OpenAI-compatible /v1) ---------
# GLM-5.1 (754B open weights, April 2026) sustains long-horizon agentic
# tasks; prompt caching is honored, structured output uses JSON mode
# (delimited fallback).
#
# TOOL CHANNEL — NATIVE (settles the former TODO(zai-glm-native-probe)).
# These rows were previously pinned to TEXT with `native_unreliable`, inheriting
# a family verdict that GLM-5.x leaks `<tool_call><arg_key>...` markup into
# assistant content instead of emitting OpenAI `message.tool_calls`. The pin
# asked for exactly one thing to lift it: a forced-format native probe against a
# zai-direct GLM-5.x route returning clean `message.tool_calls`.
#
# 2026-08-15 probe, api.z.ai `/api/paas/v4/chat/completions`. Every zai-direct
# GLM route returned a single well-formed native tool call with empty content
# and `finish_reason = "tool_calls"`, with zero markup leaks:
#   glm-5.2      tool_choice=auto + required, sync AND streaming  -> clean
#   glm-5.1      tool_choice=required                             -> clean
#   glm-5        tool_choice=required                             -> clean
#   glm-5-turbo  tool_choice=required                             -> clean
#   glm-4.7      tool_choice=required                             -> clean
# Parallel dispatch also works: a two-city prompt returned two distinct calls
# with correct per-call arguments. The same sweep cleared OpenRouter, Fireworks,
# NVIDIA, Together and Cerebras, so the cross-host `glm-5` family row was
# retired from NATIVE_UNRELIABLE_TOOL_FAMILIES (see capability_audit.rs).
#
# Native is the better channel here: it removes a grammar-parsing hop and lets
# the model use the tool encoding it was trained on. `text_tool_wire_format_supported`
# stays true so an explicit `--tool-format text` remains viable.
#
# THINKING WIRE — Z.AI is OpenAI-compatible for chat, but not for reasoning
# controls. Official GLM-5.2 docs show `thinking = {type = "enabled"}` plus
# top-level `reasoning_effort` (https://docs.z.ai/guides/llm/glm-5.2), and
# external bug reports caught clients still sending stale `enable_thinking`
# booleans (https://github.com/openclaw/openclaw/issues/58680). Keep the wire
# shape in Harn's capability matrix via provider_defaults.zai instead of making
# each host or Burin learn that quirk.

[[provider.zai]]
model_match = "glm-5.2*"
native_tools = true
preferred_tool_format = "native"
structured_output = "native"
thinking_modes = ["enabled", "effort"]
reasoning_effort_supported = true
reasoning_effort_levels = ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
reasoning_none_supported = true
text_tool_wire_format_supported = true
prefers_xml_scaffolding = false
prefers_markdown_scaffolding = true
structured_output_mode = "native_json"
supports_assistant_prefill = false
prefers_role_developer = false
prefers_xml_tools = false
thinking_block_style = "inline"
prompt_caching = true

[[provider.zai]]
model_match = "glm-5.1*"
native_tools = true
preferred_tool_format = "native"
structured_output = "native"
thinking_modes = ["enabled"]
text_tool_wire_format_supported = true
prefers_xml_scaffolding = false
prefers_markdown_scaffolding = true
structured_output_mode = "native_json"
supports_assistant_prefill = false
prefers_role_developer = false
prefers_xml_tools = false
thinking_block_style = "inline"
prompt_caching = true

# GLM-4.x family (glm-4.5, glm-4.5-air, glm-4.6, glm-4.7) — same wire format as
# GLM-5, and native on the same 2026-08-15 evidence: zai-direct glm-4.7 returned
# a single clean `message.tool_calls` under tool_choice=required, and Cerebras
# `zai-glm-4.7` (which has pinned native all along) matched. Without this rule
# the catalogued glm-4.x rows would fall through to the OpenAI-family gpt-*
# rules and resolve empty capabilities.
[[provider.zai]]
model_match = "glm-4*"
native_tools = true
preferred_tool_format = "native"
structured_output = "native"
thinking_modes = ["enabled"]
text_tool_wire_format_supported = true
prefers_xml_scaffolding = false
prefers_markdown_scaffolding = true
structured_output_mode = "native_json"
supports_assistant_prefill = false
prefers_role_developer = false
prefers_xml_tools = false
thinking_block_style = "inline"

[[provider.zai]]
model_match = "glm-5*"
native_tools = true
preferred_tool_format = "native"
structured_output = "native"
thinking_modes = ["enabled"]
text_tool_wire_format_supported = true
prefers_xml_scaffolding = false
prefers_markdown_scaffolding = true
structured_output_mode = "native_json"
supports_assistant_prefill = false
prefers_role_developer = false
prefers_xml_tools = false
thinking_block_style = "inline"