openclaw - ✅(Solved) Fix /btw fails with github-copilot provider: 400 The requested model is not supported [1 pull requests, 1 comments, 1 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#53797Fetched 2026-04-08 01:23:20
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1

/btw side questions fail when using the github-copilot provider. The model call returns a 400 error.

Error Message

⚠️ /btw failed: 400 The requested model is not supported.

Root Cause

Likely the same root cause: /btw side-call sends parameters (e.g. empty tools: [] or unsupported model path) that the github-copilot API endpoint rejects.

PR fix notes

PR #59669: fix(btw): strip empty tools array for strict OpenAI-compatible endpoints

Description (problem / solution / changelog)

Summary

  • Problem: The /btw command fails with 400 [] is too short - 'tools' error when using Qwen, GLM, Kimi and some strict OpenAI-compatible endpoints.
  • Why it matters: Users cannot use the side-question feature (/btw) with these models if the active session has prior tool call history.
  • What changed: Added an onPayload hook in src/agents/btw.ts to intercept the provider request and safely strip the tools property if it is an empty array.
  • What did NOT change: Core agent tool calling logic, upstream @mariozechner/pi-ai behavior, and main session tool calls remain untouched.

Change Type

  • Bug fix

Scope

  • Skills / tool execution

Linked Issue/PR

Root Cause / Regression History

  • Root cause: Upstream @mariozechner/pi-ai injects tools: [] when hasToolHistory(context.messages) is true (to satisfy certain Anthropic proxy requirements). However, the /btw side-channel deliberately omits tools. When tools: [] is sent to Kimi/GLM APIs, they strictly reject it with a 400 error.
  • Missing detection / guardrail: Provider compatibility testing for empty tool arrays in tool-disabled execution paths.

Regression Test Plan

  • Coverage level that should have caught this:
    • Seam / integration test
  • Target test or file: src/agents/btw.test.ts
  • Scenario the test should lock in: /btw command execution with a session history containing tool calls, asserting that the outgoing payload does not contain an empty tools array.

User-visible / Behavior Changes

Users of Kimi, Qwen, GLM, and strict OpenAI-compatible endpoints will now be able to use /btw successfully without receiving a 400 Bad Request error.

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 Tahoe 26.4
  • Runtime/container: nodejs v25.8.1
  • Model/provider: qwen3.5-plus GLM-5 MiniMax-M2.5 kimi-k2.5
  • Integration/channel: Telegram

Steps

  1. Start a session using an qwen3.5-plus model.
  2. Trigger a normal tool call (e.g., "Search the web").
  3. Once the tool call finishes, send a BTW command: /btw what did we just do?

Expected

  • The BTW command returns a successful context-aware response.

Actual (before fix)

  • The BTW command fails with 400 [] is too short - 'tools'.

Evidence

  • Trace/log snippets
  • Manual testing with Qwen model

Human Verification

  • Verified scenarios: Local testing with qwen3.5-plus model enforcing non-empty tools array.
  • Edge cases checked: Ensured normal tool calls in the main session are not affected since the hook is only injected in runBtwSideQuestion.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.

Compatibility / Migration

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

Risks and Mitigations

  • Risk: Certain Anthropic proxies explicitly required tools: [] when tool history is present.
  • Mitigation: If an upstream proxy explicitly requires this for /btw, it might fail. However, standardizing on omitting the empty array is the safer universal default, as it conforms strictly to the OpenAI API specification.

Changed files

  • src/agents/btw.test.ts (modified, +15/-0)
  • src/agents/btw.ts (modified, +8/-0)

Code Example

⚠️ /btw failed: 400 The requested model is not supported.
RAW_BUFFERClick to expand / collapse

Description

/btw side questions fail when using the github-copilot provider. The model call returns a 400 error.

Error

⚠️ /btw failed: 400 The requested model is not supported.

Environment

  • OpenClaw version: 2026.3.23-2 (7ffe7e4)
  • Provider: github-copilot
  • Models configured: github-copilot/claude-opus-4.6 (session), github-copilot/gpt-5.4 (default)
  • Surface: TUI (Linux)
  • Platform: Linux x86_64, Node v24.14.0

Steps to reproduce

  1. Configure OpenClaw with github-copilot provider
  2. Open a TUI session
  3. Send /btw ¿cual es la capital de españa?
  4. Observe error: 400 The requested model is not supported

Expected behavior

/btw should make a tool-less side call using the session or default model and return an ephemeral answer.

Actual behavior

The model call fails with a 400 error. The question briefly appears in the TUI, then disappears with no visible answer. The error message flashes briefly and is easy to miss.

Related issues

Same pattern as other provider-specific /btw failures:

  • #53472 — GLM models: 400 [] is too short - tools
  • #53174 — ModelStudio: 400 [] is too short - tools
  • #53592 — Bedrock: No API key resolved

Likely the same root cause: /btw side-call sends parameters (e.g. empty tools: [] or unsupported model path) that the github-copilot API endpoint rejects.

extent analysis

Fix Plan

To fix the /btw side questions failure with the github-copilot provider, we need to modify the request parameters sent to the API endpoint.

  • Update the github-copilot provider configuration to include the required model parameters.
  • Modify the /btw side-call to send the correct tools parameter, which should not be empty.

Example code changes:

// Update the github-copilot provider configuration
const githubCopilotConfig = {
  // ... other config options ...
  model: 'github-copilot/claude-opus-

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

/btw should make a tool-less side call using the session or default model and return an ephemeral answer.

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 /btw fails with github-copilot provider: 400 The requested model is not supported [1 pull requests, 1 comments, 1 participants]