#1357·strix

[BUG] ResponseOutputText mishandles thinking text in blocks

Author: ummon-vCreated Sep 23, 2026Updated Sep 23, 2026
Labelsbug

Describe the bug When using a GLM reasoning model served through the Mistral API (zai-glm-latest via LLM_API_BASE=https://api.mistral.ai/v1), strix fails on the first LLM call with a Pydantic validation error and reports LLM CONNECTION FAILED. The response text arrives as [{'type': 'thinking', ...}, {'type': 'text', 'text': 'OK'}] but ResponseOutputText expects a plain string. The pinned non-reasoning version zai-glm-5-2, which returns a plain string, works fine with the same Mistral endpoint and key.

To Reproduce Steps to reproduce the behavior:

  1. Create a config JSON containing "STRIX_LLM": "openai/zai-glm-latest", "LLM_API_BASE": "https://api.mistral.ai/v1", and a valid Mistral API key in LLM_API_KEY.
  2. Run strix --config ./config.json --target https://example.com -n -m quick --max-turns 2 --instruction "Do not scan. Just make one HTTP request to the target to confirm reachability, then end the test immediately."
  3. Observe the LLM CONNECTION FAILED panel: Error: 1 validation error for ResponseOutputText / text / Input should be a valid string [type=string_type, input_value=[{'type': 'thinking', 'th...: 'text', 'text': 'OK'}], input_type=list]
  4. Repeat the exact same run with "STRIX_LLM": "openai/zai-glm-5-2" (same Mistral endpoint and key); the scan completes normally.

Expected behavior Strix should accept responses whose text field is a list of content blocks (e.g. thinking + text), extracting/concatenating the text parts, so reasoning models served through the Mistral API are usable end to end instead of failing on the first call.

Screenshots Not applicable; the failure is fully captured in the error text above.

System Information:

  • OS: macOS (Apple Silicon)
  • Strix Version or Commit: 1.6.2
  • Python Version: 3.14.7
  • LLM Used: GLM (zai-glm-latest, fails; zai-glm-5-2, works) served via the Mistral API (https://api.mistral.ai/v1) with STRIX_API_TYPE=chat_completions

Additional context The failure originates in the openai-agents SDK, which strix pins, in two places that both assume string-shaped content: agents/models/chatcmpl_converter.py::message_to_output_items passes message.content straight into ResponseOutputText(text=...). agents/models/chatcmpl_stream_handler.py::handle_stream passes delta.content into ResponseTextDeltaEvent(delta=...) and accumulates it with text += delta.content. When a provider returns the assistant content as a list of content blocks (e.g. [{'type': 'thinking', ...}, {'type': 'text', 'text': 'OK'}]), the non-streaming path fails with ResponseOutputText.text: Input should be a valid string, and after that is fixed the streaming path fails the same way on ResponseTextDeltaEvent.delta. This is not specific to Mistral or GLM: any OpenAI-compatible provider that returns a list instead of plain text will hit the same failures, and the resulting LLM CONNECTION FAILED message is misleading since the endpoint is reachable and responding correctly. A tolerant parser (accept str | list, extract and concatenate the text entries, treat unknown block types as non-fatal) in both the converter and the stream handler would fix the whole class of issues.