openclaw - ✅(Solved) Fix v2026.4.20: github-copilot/claude-opus-4.7 rejects effort=high (only medium accepted) — provider-agnostic output_config.effort emission [2 pull requests, 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#69928Fetched 2026-04-22 07:46:34
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Timeline (top)
cross-referenced ×2mentioned ×1subscribed ×1

In v2026.4.19+, anthropic-transport-stream.ts started emitting output_config.effort for claude-opus-4.7 requests. The GitHub Copilot proxy for Opus 4.7 only accepts effort: "medium" and rejects low/high/xhigh with HTTP 400:

output_config.effort "high" is not supported by model claude-opus-4.7;
supported values: [medium]

Because Copilot 400s are classified as format failures, both auth profiles in the pool then hit cooldown, and the fallback candidate (github-copilot/gpt-5.4) immediately fails with No available auth profile for github-copilot (all in cooldown or unavailable). The session becomes unusable until the user manually drops thinking to medium or switches model.

Affects every fleet box configured with github-copilot/claude-opus-4.7 as primary model and any thinkingDefault other than medium (we hit it with the default xhigh and after manual /think high).

Error Message

error=LLM request failed: provider rejected the request schema or tool payload. rawError=400 {"error":{"message":"output_config.effort "high" is not supported by model claude-opus-4.7; supported values: [medium]","code":"invalid_reasoning_effort"}}

Root Cause

Because Copilot 400s are classified as format failures, both auth profiles in the pool then hit cooldown, and the fallback candidate (github-copilot/gpt-5.4) immediately fails with No available auth profile for github-copilot (all in cooldown or unavailable). The session becomes unusable until the user manually drops thinking to medium or switches model.

Fix Action

Fix / Workaround

  1. Provider-gate the emission: skip output_config.effort (or force it to medium) when model.provider === "github-copilot" and isClaudeOpus47Model(model.id).
  2. Per-(provider, model) effort capability table: lift the "supported effort values" out of the model id and into a small lookup, so future proxy drift is one-line patchable. Pairs naturally with a runtime probe-and-cache so we don't keep guessing.

Workaround until shipped

PR fix notes

PR #69937: fix(anthropic-transport): skip output_config.effort for github-copilot opus-4.7 (closes #69928)

Description (problem / solution / changelog)

Summary

  • Problem: github-copilot/claude-opus-4.7 sessions with thinkingDefault other than medium 400 on every request (output_config.effort "high" is not supported by model claude-opus-4.7; supported values: [medium]), classified as format, which cooldowns both Copilot auth profiles and collapses the fallback chain — session unusable until manual /think medium or model switch.
  • Why it matters: Users with default thinking set to high / xhigh see opus-4.7 sessions silently 400-loop into fallback collapse across both Copilot auth profiles.
  • What changed: Provider-gate the output_config.effort emission in buildAnthropicParams: when model.provider === "github-copilot" AND isClaudeOpus47Model(model.id), skip the emission. Anthropic-direct opus-4.7 keeps the full effort range; opus-4.6 (both providers) is untouched.
  • What did NOT change (scope boundary): No changes to supportsAdaptiveThinking, isClaudeOpus47Model, or any upstream model metadata. The lookup-table refactor (reporter's Option 2) is intentionally out of scope — this PR implements reporter's Option 1(a) minimum viable fix.

Credit to @elliott-dandelion-cult for a fully root-caused report with the exact fix location. cc @steipete (author of regression commit c73a6d2f68).

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Gateway / orchestration
  • Integrations

Linked Issue/PR

  • Closes #69928
  • Regression from c73a6d2f68 ("feat: support xhigh for Claude Opus 4.7", v2026.4.20)
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: commit c73a6d2f68 added isClaudeOpus47Model to supportsAdaptiveThinking() in src/agents/anthropic-transport-stream.ts. The adaptive branch in buildAnthropicParams then unconditionally set params.output_config = { effort: options.effort } regardless of provider. Anthropic-direct opus-4.7 accepts the full effort range; the Copilot proxy for opus-4.7 only accepts medium.
  • Missing detection / guardrail: no regression test in anthropic-transport-stream.test.ts asserted provider-specific emission of output_config for opus-4.7. The feature commit exercised the Anthropic-direct path only.
  • Contributing context: the Copilot proxy surfaces 4xx errors as format classification, which triggers auth-profile cooldown — so the blast radius is "opus-4.7 unusable across all Copilot profiles", not just "one request fails".

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
  • Target test or file: src/agents/anthropic-transport-stream.test.ts.
  • Scenario the test should lock in: output_config is omitted for github-copilot/claude-opus-4.7 regardless of effort, preserved for anthropic/claude-opus-4-7 at all efforts, and preserved for github-copilot/claude-opus-4-6 (scope guard).
  • Why this is the smallest reliable guardrail: the emission site is a single conditional in buildAnthropicParams; four matrix cases (two providers × in-scope / out-of-scope model) cover the full decision table.
  • Existing test that already covers this (if any): none — feature commit only tested Anthropic-direct path.
  • If no new test is added, why not: N/A (4 new cases added).

User-visible / Behavior Changes

  • github-copilot/claude-opus-4.7 sessions with thinkingDefault=high|xhigh no longer 400-loop; requests succeed with adaptive thinking but without output_config.effort.
  • Anthropic-direct opus-4.7 behavior is unchanged (output_config.effort still emitted).
  • No config changes.

Diagram (if applicable)

Before (regression from c73a6d2f68):
  buildAnthropicParams: supportsAdaptiveThinking(opus-4.7) -> true
    -> params.thinking = { type: "adaptive" }
    -> params.output_config = { effort: "high" }   // Copilot rejects

After:
  buildAnthropicParams: supportsAdaptiveThinking(opus-4.7) -> true
    -> params.thinking = { type: "adaptive" }
    -> if (provider === "github-copilot" && isClaudeOpus47Model) skip output_config
    -> else params.output_config = { effort: options.effort }

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No (same outbound request, one fewer field on Copilot opus-4.7)
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: macOS 26.5 (arm64)
  • Runtime/container: Node v25.9.0, OpenClaw main
  • Model/provider: github-copilot/claude-opus-4.7
  • Integration/channel: any
  • Relevant config: thinkingDefault: "high" (or xhigh)

Steps

  1. Set thinkingDefault: "high" in agents defaults.
  2. Send any request to github-copilot/claude-opus-4.7.
  3. Observe the Copilot proxy 400.

Expected

  • Request succeeds; adaptive thinking honored without output_config.effort.

Actual (before fix)

  • 400: output_config.effort "high" is not supported by model claude-opus-4.7; supported values: [medium] — classified format → auth-profile cooldown → fallback collapse.

Actual (after fix)

  • Request succeeds; payload has thinking.type = "adaptive", output_config omitted for Copilot opus-4.7.

Evidence

  • Failing test/log before + passing after

Scoped run:

node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts \
  src/agents/anthropic-transport-stream.test.ts
→ Test Files: 1 passed (1)
→ Tests: 12 passed (12)

Pre-commit hook ran the full agents suite: 378 files, 3973 tests passed, 4 skipped.

New regression cases:

  • A: github-copilot/claude-opus-4-7 + reasoning: "high" → payload has thinking.type = "adaptive", output_config is undefined.
  • B: github-copilot/claude-opus-4-7 + reasoning: "xhigh" → same (no xhigh leaks to Copilot).
  • C: anthropic/claude-opus-4-7 + reasoning: "high"output_config.effort = "high" preserved.
  • D: github-copilot/claude-opus-4-6 + reasoning: "high"output_config.effort = "high" preserved (scope guard).

Human Verification (required)

  • Verified scenarios: ran the full 12-test anthropic-transport-stream.test.ts suite locally; all pass. Walked through buildAnthropicParams to confirm the new conditional runs inside the existing adaptive branch and doesn't alter the non-adaptive paths.
  • Edge cases checked: opus-4.6 on Copilot (preserved); opus-4.7 on Anthropic-direct (preserved); xhigh specifically (the originally surfaced effort).
  • What I did NOT verify: live request to Copilot proxy with the fix applied — the provider-gate decision is a pure-function transformation covered by unit tests, and the outbound transport didn't change.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No
  • Anthropic-direct opus-4.7 behavior is identical to pre-PR. Copilot opus-4.7 goes from "broken on high/xhigh" to "works on all efforts but silently capped to medium-equivalent adaptive behavior on Copilot surface".

Risks and Mitigations

  • Risk: if the Copilot proxy later adds support for output_config.effort values beyond medium, this provider-gate would silently suppress them.
    • Mitigation: centralised conditional with a descriptive inline comment tying the behavior to issue #69928 — maintainers will see it when revisiting. The lookup-table refactor flagged in the issue as Option 2 would be the structural follow-up.
  • Risk: the check relies on model.provider === "github-copilot" string match.
    • Mitigation: matches the established convention used elsewhere in the transport layer.

Changed files

  • src/agents/anthropic-transport-stream.test.ts (modified, +100/-1)
  • src/agents/anthropic-transport-stream.ts (modified, +10/-1)

PR #69944: [AI-assisted] fix(github-copilot): omit Opus 4.7 effort override

Description (problem / solution / changelog)

Summary

  • Problem: github-copilot/claude-opus-4.7 rejects non-medium adaptive thinking efforts, but the Anthropic transport was forwarding output_config.effort for that proxy path.
  • Why it matters: /think high or xhigh turns on that model could fail with invalid_reasoning_effort, then burn through Copilot auth-profile cooldowns.
  • What changed: keep adaptive thinking enabled for Copilot Opus 4.7, but stop emitting the explicit output_config.effort override for that one provider/model pair.
  • What did NOT change (scope boundary): direct Anthropic Opus 4.7 behavior and the existing Claude 4.6/Anthropic adaptive effort mapping stay unchanged.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #69928
  • Related #69928
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: the Anthropic transport treated adaptive-thinking effort as model-only capability, so github-copilot/claude-opus-4.7 inherited the same output_config.effort payload as direct Anthropic Opus 4.7.
  • Missing detection / guardrail: there was no provider-specific regression test for the Copilot Opus 4.7 transport shape.
  • Contributing context (if known): the Copilot proxy only accepts medium for this field, while direct Anthropic accepts the broader effort range.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/agents/anthropic-transport-stream.test.ts
  • Scenario the test should lock in: github-copilot/claude-opus-4.7 keeps adaptive thinking enabled without forwarding output_config.effort.
  • Why this is the smallest reliable guardrail: the regression is in provider-specific request shaping, and the transport test already inspects the exact outbound payload.
  • Existing test that already covers this (if any): the existing Anthropic transport tests already cover direct Anthropic adaptive-effort mapping for Claude 4.6 and Opus 4.7.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Copilot-backed Claude Opus 4.7 runs no longer send the incompatible adaptive-effort override, so /think high and xhigh stop tripping the proxy-only schema rejection described in #69928.

Diagram (if applicable)

Before:
[user selects github-copilot/claude-opus-4.7 + high/xhigh] -> [transport sends output_config.effort] -> [Copilot 400 invalid_reasoning_effort]

After:
[user selects github-copilot/claude-opus-4.7 + high/xhigh] -> [transport omits output_config.effort] -> [adaptive thinking request stays accepted]

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS 26.2 arm64
  • Runtime/container: local source checkout on origin/main
  • Model/provider: github-copilot/claude-opus-4.7
  • Integration/channel (if any): GitHub Copilot Anthropic-messages proxy
  • Relevant config (redacted): reasoning enabled with high/xhigh

Steps

  1. Run an Anthropic transport turn with provider: "github-copilot", model: "claude-opus-4-7", and reasoning enabled.
  2. Inspect the outbound payload.
  3. Confirm the Copilot path no longer includes output_config.effort while direct Anthropic coverage remains unchanged.

Expected

  • Copilot Opus 4.7 keeps thinking: { type: "adaptive" } without forwarding output_config.effort.

Actual

  • Before this change, the Copilot Opus 4.7 path still emitted output_config.effort, matching the failing issue report.

Evidence

Attach at least one:

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

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: reproduced the bad payload shape with a new focused transport test, then reran corepack pnpm test src/agents/anthropic-transport-stream.test.ts and corepack pnpm build after the fix.
  • Edge cases checked: direct Anthropic Opus 4.7 and Claude 4.6 adaptive-effort tests still pass unchanged.
  • What you did not verify: I did not run a live GitHub Copilot request against real proxy credentials in this checkout.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps:

Risks and Mitigations

  • Risk: another Copilot Claude model may eventually need its own effort gating.
    • Mitigation: keep the change scoped to the one provider/model pair with concrete failure evidence and add the regression test for that exact payload shape.

AI-assisted: yes.

Changed files

  • src/agents/anthropic-transport-stream.test.ts (modified, +38/-0)
  • src/agents/anthropic-transport-stream.ts (modified, +8/-1)

Code Example

output_config.effort "high" is not supported by model claude-opus-4.7;
supported values: [medium]

---

[agent/embedded] embedded run agent end: ... isError=true
  model=claude-opus-4.7 provider=github-copilot
  error=LLM request failed: provider rejected the request schema or tool payload.
  rawError=400 {"error":{"message":"output_config.effort \"high\" is not supported by model claude-opus-4.7; supported values: [medium]","code":"invalid_reasoning_effort"}}
[agent/embedded] auth profile failure state updated: ... reason=format window=cooldown

---

function supportsAdaptiveThinking(modelId: string): boolean {
  return (
    modelId.includes("opus-4-6") || modelId.includes("opus-4.6") ||
    modelId.includes("sonnet-4-6") || modelId.includes("sonnet-4.6")
  );
}

---

params.thinking = { type: "enabled", budget_tokens: options.thinkingBudgetTokens || 1024 };

---

function supportsAdaptiveThinking(modelId: string): boolean {
  return (
    isClaudeOpus47Model(modelId) ||
    isClaudeOpus46Model(modelId) ||
    modelId.includes("sonnet-4-6") || modelId.includes("sonnet-4.6")
  );
}

---

if (supportsAdaptiveThinking(model.id)) {
  params.thinking = { type: "adaptive" };
  if (options.effort) {
    params.output_config = { effort: options.effort };  // ← unconditional, no provider gate
  }
}

---

"agents": {
  "defaults": {
    "models": {
      "github-copilot/claude-opus-4.7": { "thinkingDefault": "medium" }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

In v2026.4.19+, anthropic-transport-stream.ts started emitting output_config.effort for claude-opus-4.7 requests. The GitHub Copilot proxy for Opus 4.7 only accepts effort: "medium" and rejects low/high/xhigh with HTTP 400:

output_config.effort "high" is not supported by model claude-opus-4.7;
supported values: [medium]

Because Copilot 400s are classified as format failures, both auth profiles in the pool then hit cooldown, and the fallback candidate (github-copilot/gpt-5.4) immediately fails with No available auth profile for github-copilot (all in cooldown or unavailable). The session becomes unusable until the user manually drops thinking to medium or switches model.

Affects every fleet box configured with github-copilot/claude-opus-4.7 as primary model and any thinkingDefault other than medium (we hit it with the default xhigh and after manual /think high).

Repro

  1. Configure a session with github-copilot/claude-opus-4.7 and thinkingDefault: "xhigh" (or high).
  2. Send any message.
  3. Watch logs:
[agent/embedded] embedded run agent end: ... isError=true
  model=claude-opus-4.7 provider=github-copilot
  error=LLM request failed: provider rejected the request schema or tool payload.
  rawError=400 {"error":{"message":"output_config.effort \"high\" is not supported by model claude-opus-4.7; supported values: [medium]","code":"invalid_reasoning_effort"}}
[agent/embedded] auth profile failure state updated: ... reason=format window=cooldown

After a couple of attempts both Copilot profiles cooldown and the fallback chain fully collapses.

Root cause (byte-checked)

Commit c73a6d2f68 "feat: support xhigh for Claude Opus 4.7" added claude-opus-4.7 to supportsAdaptiveThinking() in src/agents/anthropic-transport-stream.ts.

Before (≤ v2026.4.15):

function supportsAdaptiveThinking(modelId: string): boolean {
  return (
    modelId.includes("opus-4-6") || modelId.includes("opus-4.6") ||
    modelId.includes("sonnet-4-6") || modelId.includes("sonnet-4.6")
  );
}

Opus 4.7 fell through to the non-adaptive branch in convertContextToParams:

params.thinking = { type: "enabled", budget_tokens: options.thinkingBudgetTokens || 1024 };

No output_config.effort was emitted, so the Copilot proxy was happy.

After (v2026.4.20):

function supportsAdaptiveThinking(modelId: string): boolean {
  return (
    isClaudeOpus47Model(modelId) ||
    isClaudeOpus46Model(modelId) ||
    modelId.includes("sonnet-4-6") || modelId.includes("sonnet-4.6")
  );
}

Now opus-4.7 hits the adaptive branch:

if (supportsAdaptiveThinking(model.id)) {
  params.thinking = { type: "adaptive" };
  if (options.effort) {
    params.output_config = { effort: options.effort };  // ← unconditional, no provider gate
  }
}

…and mapThinkingLevelToEffort produces:

thinkingLevelmapped effort
minimal/lowlow
mediummedium
xhighxhigh (opus-4.7)
anything else (high, default)"high"

Of these, only medium is accepted by the GitHub Copilot proxy for Opus 4.7.

The same source file is used for both provider === "anthropic" and provider === "github-copilot" (the provider check earlier in the file only swaps the client/auth headers, not the payload shape — Copilot proxies the anthropic-messages API). The new output_config.effort emission has no provider gate, so it's sent to Copilot too. Anthropic-direct opus-4.7 still accepts the full effort range; only the Copilot-proxied surface is stricter.

Suggested fix

Two reasonable shapes:

  1. Provider-gate the emission: skip output_config.effort (or force it to medium) when model.provider === "github-copilot" and isClaudeOpus47Model(model.id).
  2. Per-(provider, model) effort capability table: lift the "supported effort values" out of the model id and into a small lookup, so future proxy drift is one-line patchable. Pairs naturally with a runtime probe-and-cache so we don't keep guessing.

(1) unblocks the fleet today; (2) is the long-term shape Cael 🩸 and Ronan 🌊 both suggested for "trust the live capability surface, not the static catalog" when proxies drift.

Workaround until shipped

Per-model override pinning effort to medium for the affected pair:

"agents": {
  "defaults": {
    "models": {
      "github-copilot/claude-opus-4.7": { "thinkingDefault": "medium" }
    }
  }
}

(Validates clean with openclaw config validate. Restart gateway for it to apply; existing sessions may carry a sticky /think override that needs /new or another /think medium.)

Receipts

  • Live 400 captured on Silas (urudyne) and Cael fleet boxes after deploy of ddea3085cf (v2026.4.20).
  • Source diffs from git show c73a6d2f68 -- src/agents/anthropic-transport-stream.ts.
  • Diagnosed jointly by Cael 🩸, Ronan 🌊, and Elliott 🌻 in the Thornfield frond, ~2026-04-21 18:30 PDT.

cc @steipete (commit author) — this is downstream of the legitimate Opus 4.7 adaptive-thinking add; the issue is the provider-agnostic output_config.effort emission, not the feature itself.

extent analysis

TL;DR

The most likely fix is to provider-gate the emission of output_config.effort for github-copilot/claude-opus-4.7 requests to ensure only medium effort is sent.

Guidance

  • Identify the anthropic-transport-stream.ts file and locate the supportsAdaptiveThinking function to understand how the output_config.effort emission is handled.
  • Consider implementing a provider gate to skip output_config.effort or force it to medium when model.provider === "github-copilot" and isClaudeOpus47Model(model.id).
  • As a temporary workaround, apply a per-model override to pin the effort to medium for the affected pair using the provided JSON configuration.

Example

"agents": {
  "defaults": {
    "models": {
      "github-copilot/claude-opus-4.7": { "thinkingDefault": "medium" }
    }
  }
}

Notes

The issue is specific to the github-copilot/claude-opus-4.7 model and the introduction of adaptive thinking in version v2026.4.20. The suggested fix aims to address the provider-agnostic output_config.effort emission.

Recommendation

Apply the workaround by adding the provided JSON configuration to pin the effort to medium for the affected pair, as this is a quick and effective solution to unblock the fleet until a more permanent fix is shipped.

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…

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 v2026.4.20: github-copilot/claude-opus-4.7 rejects effort=high (only medium accepted) — provider-agnostic output_config.effort emission [2 pull requests, 1 participants]