#1344·chaosblade

[blade-ai] Multiple LLM-provider protocol incompatibilities break agent_loop / verifier across v0.7.0 and v0.5.2

Author: shinianPopeyeCreated Sep 8, 2026Updated Sep 9, 2026

[blade-ai] Multiple LLM-provider protocol incompatibilities break agent_loop / verifier across v0.7.0 and v0.5.2

Summary

Across two blade-ai releases (v0.7.0 and v0.5.2) and four different LLM models routed through an OpenAI-compatible gateway (One-API / New-API style, langchain_openai client under the hood), we hit four distinct, reproducible BadRequestError / protocol-mismatch failures during blade-ai inject, all originating from how blade-ai's LangGraph agent pipeline talks to the LLM — not from k8s/chaosblade-engine issues. Only one combination (v0.5.2 + a Gemini-family model with reasoning_content: null) completed a full inject → verify → recover cycle successfully.

This suggests blade-ai's LLM integration layer currently only works reliably with a narrow slice of "plain chat-completions, non-thinking" models, and silently breaks (with unhelpful low-level openai.BadRequestError tracebacks surfaced straight to the user) on anything else — Responses-API-routed OpenAI models, reasoning/thinking models (DeepSeek, Qwen3-thinking), and apparently any model where the provider rejects enable_thinking as an unsupported request parameter.

Environment

blade-ai versions tested: v0.7.0 (latest as of 2026-09), v0.5.2 OS: macOS (arm64) for initial repro, Ubuntu 24.04 (x86_64, glibc 2.39) for a subsequent ECS repro of the same class of error LLM backend: OpenAI-compatible gateway (self-hosted One-API/New-API style proxy), api_base_url pointed at /v1 config-check passed in all cases (kubeconfig, blade_path, llm_api_key, model_name all valid) — failures are purely at LLM-call time, not config/env issues Target: real pod in a k8s cluster, pod-cpu-fullload fault via blade-ai inject --scope pod --target cpu --action fullload ... --force-override -o json

Reproduced failures (4 distinct signatures)

  1. v0.7.0 + OpenAI Responses-API-routed model (e.g. gpt-5.5)

function_call_output requires item_reference ids matching each call_id on HTTP requests; continuation via previous_response_id is only supported on Responses WebSocket v2

The model's gateway channel routes chat-completions calls through OpenAI's stateful Responses API (confirmed via usage.billing_usage.source: "oai_responses" in the raw /v1/chat/completions response). blade-ai's tool-calling flow assumes the classic Chat Completions multi-turn tool-call protocol (tool_calls / tool role messages with matching call_ids), which is incompatible with how the Responses API expects continuation.

  1. v0.7.0 + deepseek-v4-pro

Messages with role 'tool' must be a response to a preceding message with 'tool_calls'

Tool-message ordering appears to get corrupted, most likely during a retry-with-error-feedback path inside the baseline_capture stage (agent regenerates a command after a failed attempt, and the corrected message sequence loses the required tool_calls → tool pairing).

  1. v0.5.2 + deepseek-v4-pro

The reasoning_content in the thinking mode must be passed back to the API

Occurred during the verifier stage (LLM-driven post-injection impact verification, i.e. multi-turn tool calling after the first response). DeepSeek's "thinking mode" requires the model's own reasoning_content from a prior turn to be echoed back in the next request; blade-ai's message-building does not preserve/re-send it, breaking the second-and-later LLM calls in this stage. (Note: this run did self-recover correctly — the safety layer auto-destroyed the chaosblade experiment on failure, so no orphaned fault was left behind.)

  1. v0.5.2 + gpt-5.6-terra (routed via oai_responses, same gateway)

openai.BadRequestError: Error code: 400 - {'error': {'message': 'Unsupported parameter: enable_thinking', 'type': 'invalid_request_error', 'param': '', 'code': None}} Traceback (most recent call last): File "chaos_agent/cli/runner.py", line 586, in inject ... File "chaos_agent/agent/nodes/agent_loop.py", line 520, in _agent_loop_with_llm ... File "langchain_openai/chat_models/base.py", line 1871, in _astream File "openai/resources/chat/completions/completions.py", line 2814, in create File "openai/_base_client.py", line 1716, in request openai.BadRequestError: Error code: 400 - {'error': {'message': 'Unsupported parameter: enable_thinking', ...}} During task with name 'agent_loop' and id '...'

Failed on the very first agent_loop LLM call (task never got a blade_uid, so no cleanup needed here — clean failure). blade-ai appears to unconditionally send an enable_thinking request parameter (presumably intended for Qwen3-style toggle-able reasoning), which this provider rejects outright as unsupported, rather than only sending it for models known to support it, or catching/retrying without it.

The one combination that worked end-to-end

v0.5.2 + a model returning reasoning_content: null (no thinking-mode field at all) and not routed through oai_responses — completed a full real-world cycle: pipeline_init → preplan_probe → agent_loop → safety_check → baseline_capture → se_snapshot → execute_loop → verifier (Layer1 blade/k8s status + Layer2 LLM-driven kubectl_verify) → recover → recover_verifier, independently cross-checked via manual kubectl exec ... top before/after (not just trusting blade-ai's self-reported status).

Observation / suspected root cause

All four failures trace back to langchain_openai's chat-model integration not adapting its request shape / message history per-provider: It doesn't detect when a model is actually routed through OpenAI's Responses API vs classic Chat Completions, and builds tool-call continuation state assuming the latter. It doesn't consistently re-attach reasoning_content for models that require it back (DeepSeek thinking mode). It appears to send an enable_thinking parameter unconditionally regardless of whether the configured/detected provider supports it.

None of this appeared to be caused by user config, kubeconfig, or the chaosblade engine itself — config-check passed cleanly in every case, and the one working combination used the exact same kubeconfig/target/blade engine as the failing ones.

Suggested directions

Gracefully degrade / clearly surface "this model's provider isn't compatible with blade-ai's current LLM integration" instead of letting a raw openai.BadRequestError traceback bubble all the way to the CLI's JSON output. Only send provider-specific request parameters (like enable_thinking) when the configured model is confirmed to support them, rather than unconditionally. Preserve/re-send reasoning_content across turns for thinking-mode models per the provider's documented contract. Document, even briefly, which model families/providers are known-compatible vs known-incompatible, so users don't have to discover this via trial and error against a real k8s cluster.

Reproduction environment note

Happy to share full debug logs (with any sensitive kubeconfig/API-key values redacted) if useful — these were captured via --log-level DEBUG equivalent output during real inject runs against a live cluster.

Source: chaosblade-io/chaosblade