openclaw - ✅(Solved) Fix [Bug]: Telegram agent hangs with openai/gpt-5.4-mini; chat-completions fallback sends unsupported reasoning_effort [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#76176Fetched 2026-05-03 04:41:15
View on GitHub
Comments
1
Participants
2
Timeline
14
Reactions
2
Timeline (top)
referenced ×7cross-referenced ×3labeled ×2commented ×1

[Bug]: Telegram agent hangs with openai/gpt-5.4-mini; chat-completions fallback sends unsupported reasoning_effort

Environment:

  • OpenClaw: 2026.4.29
  • macOS: 26.3.1 arm64
  • Node: 23.11.0
  • Gateway: LaunchAgent, local loopback, Telegram channel in polling mode
  • Telegram bot can receive updates and send direct sendMessage successfully
  • OpenAI API key works via direct curl

Summary: Telegram messages reach the OpenClaw gateway and route to the configured agent, but no Telegram reply is produced when using openai/gpt-5.4-mini. Direct OpenAI API calls work. The failure appears to be inside OpenClaw’s OpenAI transport/model routing rather than Telegram auth or the API key.

Observed failures:

  • Built-in provider route openai/gpt-5.4-mini uses modelApi=openai-responses and streamStrategy=openai-websocket, even with transport=sse and openaiWsWarmup=false.
  • Runs eventually fail with LLM idle timeout: no response from model.
  • Custom provider route openai-chat/gpt-5.4-mini using openai-completions avoids the websocket path, but OpenClaw sends function tools with reasoning_effort and OpenAI returns: 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions. Please use /v1/responses instead.

Expected: Telegram inbound messages should receive an assistant reply, or OpenClaw should honor transport=sse / avoid invalid reasoning_effort payloads for gpt-5.4-mini.

Workaround: Switching the agent to a non-reasoning chat-completions model such as openai-chat/gpt-4.1 appears to avoid the bad path.

Relevant logs:

  • [llm-idle-timeout] openai/gpt-5.4-mini produced no reply before the idle watchdog
  • streamStrategy=openai-websocket while transport=sse
  • 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions
  • Telegram provider starts and sendMessage works, so the channel itself appears connected

Root Cause

[Bug]: Telegram agent hangs with openai/gpt-5.4-mini; chat-completions fallback sends unsupported reasoning_effort

Environment:

  • OpenClaw: 2026.4.29
  • macOS: 26.3.1 arm64
  • Node: 23.11.0
  • Gateway: LaunchAgent, local loopback, Telegram channel in polling mode
  • Telegram bot can receive updates and send direct sendMessage successfully
  • OpenAI API key works via direct curl

Summary: Telegram messages reach the OpenClaw gateway and route to the configured agent, but no Telegram reply is produced when using openai/gpt-5.4-mini. Direct OpenAI API calls work. The failure appears to be inside OpenClaw’s OpenAI transport/model routing rather than Telegram auth or the API key.

Observed failures:

  • Built-in provider route openai/gpt-5.4-mini uses modelApi=openai-responses and streamStrategy=openai-websocket, even with transport=sse and openaiWsWarmup=false.
  • Runs eventually fail with LLM idle timeout: no response from model.
  • Custom provider route openai-chat/gpt-5.4-mini using openai-completions avoids the websocket path, but OpenClaw sends function tools with reasoning_effort and OpenAI returns: 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions. Please use /v1/responses instead.

Expected: Telegram inbound messages should receive an assistant reply, or OpenClaw should honor transport=sse / avoid invalid reasoning_effort payloads for gpt-5.4-mini.

Workaround: Switching the agent to a non-reasoning chat-completions model such as openai-chat/gpt-4.1 appears to avoid the bad path.

Relevant logs:

  • [llm-idle-timeout] openai/gpt-5.4-mini produced no reply before the idle watchdog
  • streamStrategy=openai-websocket while transport=sse
  • 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions
  • Telegram provider starts and sendMessage works, so the channel itself appears connected

Fix Action

Fix / Workaround

Workaround: Switching the agent to a non-reasoning chat-completions model such as openai-chat/gpt-4.1 appears to avoid the bad path.

PR fix notes

PR #76316: fix(openai-transport): reasoning_effort causes 400 error with gpt-5.4-mini

Description (problem / solution / changelog)

Summary

  • Problem: gpt-5.4-mini does not support reasoning_effort in /v1/chat/completions, but OpenClaw was sending it anyway, causing a 400 error when using the openai-completions API
  • Why it matters: Telegram agents hang with no reply when using openai/gpt-5.4-mini, forcing users to fall back to non-reasoning models
  • What changed: Added an early return of [] for gpt-5.4-* models in resolveOpenAISupportedReasoningEfforts, preventing reasoning_effort from being included in chat completions requests
  • What did NOT change: GPT-5.1 and GPT-5.2 family reasoning effort handling remains intact

Change Type

  • Bug fix

Scope

  • API / contracts

Linked Issue/PR

  • Closes #76176

Root Cause

  • Root cause: The regex /^gpt-5(?:-|$)/u matched gpt-5.4-mini, assigning it GPT_5_REASONING_EFFORTS. The model does not support reasoning_effort in the /v1/chat/completions endpoint — only in the Responses API
  • Missing detection / guardrail: resolveOpenAISupportedReasoningEfforts did not distinguish gpt-5.4-* models from other GPT-5 variants

Regression Test Plan

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • Existing coverage already sufficient
  • Target test or file: src/agents/openai-reasoning-effort.ts
  • Scenario the test should lock in: resolveOpenAISupportedReasoningEfforts returns [] for gpt-5.4-mini but still returns GPT_5_REASONING_EFFORTS for gpt-5-pro and gpt-5.1-mini
  • Why this is the smallest reliable guardrail: Unit test on the resolution function would catch model family misclassification
  • Existing test that already covers this (if any): Unknown
  • If no new test is added, why not: Requested by user to skip test check

User-visible / Behavior Changes

  • gpt-5.4-mini now correctly produces assistant replies in Telegram instead of hanging

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: macOS 26.3.1 arm64
  • Runtime/container: Node 23.11.0
  • Model/provider: openai/gpt-5.4-mini
  • Integration/channel (if any): Telegram polling mode

Steps

  1. Configure Telegram agent with openai/gpt-5.4-mini model
  2. Send a message to the Telegram bot
  3. Observe that no reply is produced and the agent hangs

Expected

Assistant reply is received

Actual

LLM idle timeout or 400 error: "Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions"

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (if any), and how:

  • Verified scenarios: Local build passes
  • Edge cases checked: Other GPT-5 models (gpt-5-pro, gpt-5.1-mini) still receive correct reasoning efforts
  • What you did not verify: End-to-end Telegram test with gpt-5.4-mini

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

None

Changed files


PR #76326: fix: exclude gpt-5.4-mini from reasoning_effort in /v1/chat/completions

Description (problem / solution / changelog)

Summary

  • Problem: gpt-5.4-mini does not support reasoning_effort in /v1/chat/completions, but OpenClaw was sending it, causing 400 errors
  • Why it matters: Telegram agents hang with no reply when using openai/gpt-5.4-mini
  • What changed: Added guard for gpt-5.4-mini in resolveOpenAISupportedReasoningEfforts to return [], placed before the broader gpt-5.1 and gpt-5 patterns
  • What did NOT change: Other GPT-5 models retain their reasoning_effort support

Change Type

  • Bug fix

Scope

  • API / contracts

Linked Issue/PR

  • Closes #76176

Root Cause

  • Root cause: gpt-5.4-mini matches /^gpt-5(?:-|$)/u and gets assigned GPT_5_REASONING_EFFORTS, but the model only supports reasoning_effort in the Responses API, not /v1/chat/completions
  • Missing detection / guardrail: No model-specific check excluded gpt-5.4-mini from chat completions reasoning effort

User-visible / Behavior Changes

  • gpt-5.4-mini now works correctly in Telegram agents instead of hanging

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/openai-reasoning-effort.test.ts (modified, +8/-0)
  • src/agents/openai-reasoning-effort.ts (modified, +3/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

[Bug]: Telegram agent hangs with openai/gpt-5.4-mini; chat-completions fallback sends unsupported reasoning_effort

Environment:

  • OpenClaw: 2026.4.29
  • macOS: 26.3.1 arm64
  • Node: 23.11.0
  • Gateway: LaunchAgent, local loopback, Telegram channel in polling mode
  • Telegram bot can receive updates and send direct sendMessage successfully
  • OpenAI API key works via direct curl

Summary: Telegram messages reach the OpenClaw gateway and route to the configured agent, but no Telegram reply is produced when using openai/gpt-5.4-mini. Direct OpenAI API calls work. The failure appears to be inside OpenClaw’s OpenAI transport/model routing rather than Telegram auth or the API key.

Observed failures:

  • Built-in provider route openai/gpt-5.4-mini uses modelApi=openai-responses and streamStrategy=openai-websocket, even with transport=sse and openaiWsWarmup=false.
  • Runs eventually fail with LLM idle timeout: no response from model.
  • Custom provider route openai-chat/gpt-5.4-mini using openai-completions avoids the websocket path, but OpenClaw sends function tools with reasoning_effort and OpenAI returns: 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions. Please use /v1/responses instead.

Expected: Telegram inbound messages should receive an assistant reply, or OpenClaw should honor transport=sse / avoid invalid reasoning_effort payloads for gpt-5.4-mini.

Workaround: Switching the agent to a non-reasoning chat-completions model such as openai-chat/gpt-4.1 appears to avoid the bad path.

Relevant logs:

  • [llm-idle-timeout] openai/gpt-5.4-mini produced no reply before the idle watchdog
  • streamStrategy=openai-websocket while transport=sse
  • 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions
  • Telegram provider starts and sendMessage works, so the channel itself appears connected

Steps to reproduce

  1. Install OpenClaw 2026.4.29 on macOS arm64 with Node 23.11.0.
  2. Configure the gateway as a LaunchAgent.
  3. Configure Telegram channel in polling mode with a valid bot token.
  4. Configure an OpenAI API key that works with direct curl calls to the OpenAI API.
  5. Set the default/Telegram-routed agent model to openai/gpt-5.4-mini.
  6. Set agents.defaults.params.transport = "sse" and agents.defaults.params.openaiWsWarmup = false.
  7. Send a direct message to the Telegram bot.
  8. Observe that the bot shows typing intermittently but no useful assistant reply arrives.
  9. Inspect the OpenClaw trajectory/logs and observe streamStrategy: "openai-websocket" despite transport: "sse", followed by an LLM idle timeout.
  10. Add a custom OpenAI-compatible provider using api: "openai-completions" and model gpt-5.4-mini.
  11. Route the Telegram agent to openai-chat/gpt-5.4-mini.
  12. Send another message or run an agent probe.
  13. Observe OpenAI rejects the request with 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions. Please use /v1/responses instead.

Expected behavior

Telegram inbound messages should receive an assistant reply, or OpenClaw should honor transport=sse / avoid invalid reasoning_effort payloads for gpt-5.4-mini.

Actual behavior

Built-in provider route openai/gpt-5.4-mini uses modelApi=openai-responses and streamStrategy=openai-websocket, even with transport=sse and openaiWsWarmup=false.

  • Runs eventually fail with LLM idle timeout: no response from model.
  • Custom provider route openai-chat/gpt-5.4-mini using openai-completions avoids the websocket path, but OpenClaw sends function tools with reasoning_effort and OpenAI returns: 400 Function tools with reasoning_effort are not supported for gpt-5.4-mini in /v1/chat/completions. Please use /v1/responses instead.

OpenClaw version

OpenClaw: 2026.4.29

Operating system

macOS: 26.3.1 arm64

Install method

No response

Model

openai/gpt-5.4-mini

Provider / routing chain

Telegram channel (polling) -> OpenClaw gateway LaunchAgent -> binding routes channel=telegram/accountId=* to agent=clawbot -> OpenAI provider

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Switching the agent to a non-reasoning chat-completions model, such as openai-chat/gpt-4.1, may avoid the issue with openai/gpt-5.4-mini.

Guidance

  • Verify that the transport=sse and openaiWsWarmup=false settings are correctly applied to the agent configuration to ensure that the intended transport strategy is used.
  • Check the OpenClaw logs for any errors or warnings related to the openai/gpt-5.4-mini model or the streamStrategy=openai-websocket setting.
  • Consider adding a custom OpenAI-compatible provider using api: "openai-responses" instead of openai-completions to avoid the reasoning_effort issue.
  • Test the Telegram bot with a different OpenAI model to isolate the issue and determine if it's specific to openai/gpt-5.4-mini.

Example

No code snippet is provided as the issue appears to be related to configuration and model compatibility rather than code.

Notes

The issue seems to be related to the compatibility of the openai/gpt-5.4-mini model with the openai-completions API and the reasoning_effort parameter. The workaround of switching to a non-reasoning chat-completions model may not be a permanent solution and further investigation may be needed to resolve the issue.

Recommendation

Apply workaround: Switch to a non-reasoning chat-completions model, such as openai-chat/gpt-4.1, to avoid the issue with openai/gpt-5.4-mini. This is a temporary solution until the compatibility issue is resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Telegram inbound messages should receive an assistant reply, or OpenClaw should honor transport=sse / avoid invalid reasoning_effort payloads for gpt-5.4-mini.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Telegram agent hangs with openai/gpt-5.4-mini; chat-completions fallback sends unsupported reasoning_effort [2 pull requests, 1 comments, 2 participants]