Skip to content

v1.3.154

Choose a tag to compare

@topcheer topcheer released this 15 Jul 17:08

v1.3.154

Highlights

  • Fix: vision-enabled models causing 400 errors on non-vision endpoints. When switching from a vision-capable endpoint (e.g. kimi) to a non-vision endpoint (e.g. zai/glm-5.2), the agent incorrectly kept vision mode enabled, sending image data in tool results that the API rejected. Now SetSupportsVision is called on every provider switch, and historical image data in old sessions is automatically stripped before sending.

Fixes and improvements

  • ApplyProviderToAgent now calls SetSupportsVision — the root cause of the 400 error loop. Previously SupportsVision was only set once at startup; switching endpoints/model in TUI never updated it.
  • Image stripping in ensureMessagesSendable — when the active endpoint does not support vision, image data in tool_result content blocks is stripped from the message history before sending to the provider. This repairs old sessions that recorded images when a different endpoint was active.
  • Added glm-5.2 to the built-in model capability database — ensures correct ContextWindow (204800) and MaxOutputTokens (65536) values, and correctly marks it as non-vision.
  • Session restore baseline improvement — token baseline now uses the last real usage entry from UsageHistory instead of relying solely on CheckpointTokens, giving more accurate context fill estimates after resume.
  • Anthropic provider token calibrator — periodic real-API token calibration for more accurate context window tracking on Anthropic endpoints.
  • Gemini provider session ID injectionSetSessionID now available on the Gemini provider for consistent request tracing.
  • LAN chat inbound DM callback — fires an onInboundDM callback for non-broadcast messages so the rate limiter can reset the DM cooldown for the sender on the HTTP transport path.

Upgrade notes

  • If you experienced messages.content.type 参数非法 errors when resuming old sessions on Z.ai GLM endpoints, this release fixes it. No manual intervention needed — image data in old sessions is automatically stripped.

Compare

v1.3.153...v1.3.154