openclaw - ✅(Solved) Fix github-copilot claude-opus-4.7: output_config.effort="low" rejected, poisons auth profile [1 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#70322Fetched 2026-04-23 07:26:19
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×2

OpenClaw's anthropic-messages path (GitHub Copilot provider) sends output_config.effort = "low" to claude-opus-4.7, which is rejected by Copilot's backend:

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

Because opus-4.7 is an adaptive-thinking model (uses thinking: { type: "adaptive" } + output_config.effort), the existing OpenAI-style reasoningEffortMap remap path (which already knows how to coerce "low" / "minimal""medium" for OPENAI_MEDIUM_ONLY_REASONING_MODEL_IDS) is not applied. So there's no way for a user to get off "low" for this model without manually raising /thinking to medium or higher for every lane, including cron lanes and light heartbeat runs.

In practice this cascades very badly: the 400 failure poisons the github-copilot auth profile, then every subsequent request on that profile fails with No available auth profile for github-copilot (all in cooldown or unavailable) until cooldown clears. A single incompatible effort request effectively takes the whole provider down for a while.

Error Message

embedded run agent end: runId=... 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 "low" is not supported by model claude-opus-4.7; supported values: [medium]","code":"invalid_reasoning_effort"}} lane task error: lane=session:agent:main:discord:channel:... durationMs=13542 error="FailoverError: LLM request failed: provider rejected the request schema or tool payload." lane task error: lane=session:agent:main:discord:channel:... durationMs=3528 error="FailoverError: No available auth profile for github-copilot (all in cooldown or unavailable)."

Root Cause

Because opus-4.7 is an adaptive-thinking model (uses thinking: { type: "adaptive" } + output_config.effort), the existing OpenAI-style reasoningEffortMap remap path (which already knows how to coerce "low" / "minimal""medium" for OPENAI_MEDIUM_ONLY_REASONING_MODEL_IDS) is not applied. So there's no way for a user to get off "low" for this model without manually raising /thinking to medium or higher for every lane, including cron lanes and light heartbeat runs.

Fix Action

Workaround

Demote claude-opus-4.7 from agents.defaults.model.primary and use claude-sonnet-4.6 (or similar) as default primary. This avoids hitting opus-4.7 at low/minimal effort on background lanes, but any explicit override (cipher agent, cron payload pinning opus-4.7) still breaks if thinking is not manually set to medium+.

PR fix notes

PR #70376: fix(anthropic): clamp low/minimal effort to medium for github-copilot/opus-4.7

Description (problem / solution / changelog)

Summary

Fixes #70322. GitHub Copilot's `claude-opus-4.7` surface rejects `output_config.effort` values of `low` or `minimal` with:

``` 400 invalid_reasoning_effort output_config.effort 'low' is not supported by model claude-opus-4.7; supported values: [medium] ```

Any cron-scheduled agentTurn or subagent spawned with reasoning effort = low hits this; the 400 poisons the github-copilot auth profile; every subsequent request on that profile fails with all in cooldown or unavailable until cooldown clears. A single incompatible request effectively takes the whole provider down for a while.

Fix

Added `clampAdaptiveEffortForProvider` in `src/agents/anthropic-transport-stream.ts` — a scoped helper that coerces `low`/`minimal` to `medium` only on the `github-copilot` + `opus-4.7` combo. Direct-API anthropic callers and other adaptive models (opus-4.6, sonnet-4.6) retain their current behavior.

Mirrors the existing `OPENAI_MEDIUM_ONLY_REASONING_MODEL_IDS` remap in `openai-reasoning-compat.ts` for the OpenAI-completions path.

Test

Added 3 regression tests:

  1. Clamp applies for both `low` and `minimal` on `github-copilot/opus-4.7` → sends `medium`
  2. No clamp for `anthropic/opus-4.7` (direct API accepts low) → preserves `low`
  3. No clamp for `github-copilot/opus-4.6` (scope guard) → preserves `low`

All existing tests pass (extended the test model factory to accept `provider` without breaking existing call sites). oxlint clean.

Closes #70322.

Changed files

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

Code Example

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

---

if (options.effort) params.output_config = { effort: options.effort };

---

embedded run agent end: runId=... 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 \"low\" is not supported by model
  claude-opus-4.7; supported values: [medium]","code":"invalid_reasoning_effort"}}
lane task error: lane=session:agent:main:discord:channel:... durationMs=13542
  error="FailoverError: LLM request failed: provider rejected the request schema or tool payload."
lane task error: lane=session:agent:main:discord:channel:... durationMs=3528
  error="FailoverError: No available auth profile for github-copilot (all in cooldown or unavailable)."
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw's anthropic-messages path (GitHub Copilot provider) sends output_config.effort = "low" to claude-opus-4.7, which is rejected by Copilot's backend:

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

Because opus-4.7 is an adaptive-thinking model (uses thinking: { type: "adaptive" } + output_config.effort), the existing OpenAI-style reasoningEffortMap remap path (which already knows how to coerce "low" / "minimal""medium" for OPENAI_MEDIUM_ONLY_REASONING_MODEL_IDS) is not applied. So there's no way for a user to get off "low" for this model without manually raising /thinking to medium or higher for every lane, including cron lanes and light heartbeat runs.

In practice this cascades very badly: the 400 failure poisons the github-copilot auth profile, then every subsequent request on that profile fails with No available auth profile for github-copilot (all in cooldown or unavailable) until cooldown clears. A single incompatible effort request effectively takes the whole provider down for a while.

Observed

  • OpenClaw 2026.4.21 on Linux
  • Provider github-copilot, model github-copilot/claude-opus-4.7
  • Thinking level low (via agents.defaults.subagents.thinking: "off" + default reasoning level)
  • Model is on the adaptive-thinking branch (supportsAdaptiveThinking matches opus-4-7 / opus-4.7)

Repro (simplified): any request whose thinking level maps to "low" routed to github-copilot/claude-opus-4.7, e.g. a cron-scheduled agentTurn or a subagent spawned with reasoning effort = low.

Relevant code paths (from installed dist/):

  • dist/anthropic-vertex-stream-*.js — adaptive branch:
    if (options.effort) params.output_config = { effort: options.effort };
    This is emitted for adaptive-thinking models without remapping.
  • dist/*/reasoning-compat-*.js — OpenAI-completions branch has OPENAI_MEDIUM_ONLY_REASONING_MODEL_IDS remap to {minimal: "medium", low: "medium"}, but only for provider === "openai" || "openai-codex" and only on the OpenAI-completions path.

Log excerpt:

embedded run agent end: runId=... 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 \"low\" is not supported by model
  claude-opus-4.7; supported values: [medium]","code":"invalid_reasoning_effort"}}
lane task error: lane=session:agent:main:discord:channel:... durationMs=13542
  error="FailoverError: LLM request failed: provider rejected the request schema or tool payload."
lane task error: lane=session:agent:main:discord:channel:... durationMs=3528
  error="FailoverError: No available auth profile for github-copilot (all in cooldown or unavailable)."

Expected

For adaptive-thinking models served over github-copilot that only accept a subset of effort values, output_config.effort should be coerced (or clamped) to a supported value rather than sent through. Concretely:

  • Include claude-opus-4.7 (and any other adaptive-thinking models with the same constraint) in a MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS set, with the same {minimal: "medium", low: "medium"} remap applied on the adaptive-thinking branch in anthropic-vertex-stream-*.js.
  • Alternatively: expose compat.reasoningEffortMap for the anthropic-messages path the same way it's exposed for OpenAI completions, and document it as a valid key under models.providers.*.models.*.compat (the schema currently has additionalProperties: false and does not declare it, so users can't set it in config).

Also recommended: a 400 invalid_reasoning_effort schema rejection should NOT trip github-copilot auth cooldown. A format-rejection error from the model is not an auth failure and shouldn't poison the profile.

Workaround

Demote claude-opus-4.7 from agents.defaults.model.primary and use claude-sonnet-4.6 (or similar) as default primary. This avoids hitting opus-4.7 at low/minimal effort on background lanes, but any explicit override (cipher agent, cron payload pinning opus-4.7) still breaks if thinking is not manually set to medium+.

Environment

  • OpenClaw: 2026.4.21
  • Node: v22.22.2
  • OS: Linux srv1355327 6.8.0-107-generic
  • Provider: github-copilot (individual baseUrl https://api.individual.githubcopilot.com, api anthropic-messages)

extent analysis

TL;DR

To fix the issue, coerce output_config.effort to a supported value for adaptive-thinking models like claude-opus-4.7 by including them in a MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS set with a remap to {minimal: "medium", low: "medium"}.

Guidance

  • Identify adaptive-thinking models that only accept a subset of effort values and create a MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS set to store them.
  • Apply a remap to {minimal: "medium", low: "medium"} for these models in the anthropic-vertex-stream-*.js file.
  • Consider exposing compat.reasoningEffortMap for the anthropic-messages path to allow users to configure the remap.
  • Review the auth cooldown logic to prevent format-rejection errors from poisoning the github-copilot auth profile.

Example

const MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS = {
  'claude-opus-4.7': { minimal: 'medium', low: 'medium' },
  // Add other models with the same constraint here
};

// In anthropic-vertex-stream-*.js
if (options.effort) {
  const modelId = options.modelId;
  if (MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS[modelId]) {
    const effortRemap = MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS[modelId];
    params.output_config = { effort: effortRemap[options.effort] || options.effort };
  } else {
    params.output_config = { effort: options.effort };
  }
}

Notes

This solution assumes that the anthropic-vertex-stream-*.js file is the correct place to apply the remap. Additional testing and verification may be necessary to ensure the fix works as expected.

Recommendation

Apply the workaround by demoting claude-opus-4.7 from agents.defaults.model.primary and using claude-sonnet-4.6 as the default primary model, and then work on implementing the MEDIUM_ONLY_ADAPTIVE_EFFORT_MODEL_IDS set and remap to prevent similar issues in the future. This will prevent the github-copilot auth profile from being poisoned by format-rejection errors.

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 github-copilot claude-opus-4.7: output_config.effort="low" rejected, poisons auth profile [1 pull requests, 1 participants]