Repository navigation
Description
Problem
A live run through the Pollinations provider can return the model's internal reasoning and tool-call payload as ordinary assistant text. The agent UI displays the raw <think>...</think> block and serialized JSON objects instead of treating them as reasoning metadata and tool invocations.
Observed with GLM 5.3 Flash (FREE) (community, free) in a Silvercode session on 2026-11-26. The visible assistant output contained:
- A literal
<think>block describing that the user only said “Hello”. - A JSON object containing
{"name":null,"message":"Hello! How can I help you today?"}. - A second literal
<think>block describing a call tofinish. - A serialized
{"name":"finish","arguments":{...}}object.
The finish call was printed in the conversation rather than being dispatched as a tool call. The run therefore exposes protocol/control-flow output to the user and risks leaving the agent workflow incomplete.
Expected behavior
- Parse Pollinations responses into Silvercode's normal assistant-message, reasoning, and tool-call events.
- Dispatch tool calls through the normal tool execution path; do not render serialized tool-call JSON as user-facing prose.
- Keep reasoning content out of the ordinary visible message body, following Silvercode's existing reasoning visibility behavior.
- Handle both streaming and non-streaming responses, including fragmented tool-call arguments.
- If a model returns an unsupported or malformed response shape, surface a clear provider/protocol error rather than silently presenting internal control data as a successful assistant answer.
Investigation
PR #861 describes Pollinations as an OpenAI-compatible gateway and currently routes chat through @ai-sdk/openai-compatible unchanged. Verify the actual response/stream shape returned by Pollinations for affected models, then determine whether the incompatibility is in the upstream response, the SDK adapter configuration, or Silvercode's event mapping.
Do not assume that every Pollinations model uses the same output format. Add a captured fixture for the observed GLM 5.3 Flash response and regression tests for reasoning, tool calls, and normal text output.
Reproduction
- Configure the Pollinations provider and select
GLM 5.3 Flash (FREE) (community, free). - Start an agent session with a simple prompt such as
Hello.. - Observe that reasoning tags and JSON-shaped assistant/tool-call payloads appear verbatim in the conversation instead of being parsed and executed.
Parent context
Discovered immediately after merging the Pollinations provider integration in PR #861. This is a functional protocol-handling issue, separate from the catalog metadata follow-ups in #862 and #863.
Activity