hermes - 💡(How to fix) Fix Add config flag to disable `context-1m-2025-08-07` beta header for Anthropic Enterprise OAuth subscriptions

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…

Some Anthropic Enterprise OAuth subscriptions reject requests that include the context-1m-2025-08-07 beta header with HTTP 400:

The long context beta is not yet available for this subscription.

run_agent.py has reactive retry logic that detects this and re-issues without the beta (drop_context_1m_beta=True path), so the main agent loop recovers. However, auxiliary clients (auxiliary_client.pytitle_generator, vision_tools, etc.) lack this retry path — they catch the 400 and surface a user-visible warning, leaving the aux call permanently failed for the session.

Root Cause

Some Anthropic Enterprise OAuth subscriptions reject requests that include the context-1m-2025-08-07 beta header with HTTP 400:

The long context beta is not yet available for this subscription.

run_agent.py has reactive retry logic that detects this and re-issues without the beta (drop_context_1m_beta=True path), so the main agent loop recovers. However, auxiliary clients (auxiliary_client.pytitle_generator, vision_tools, etc.) lack this retry path — they catch the 400 and surface a user-visible warning, leaving the aux call permanently failed for the session.

Fix Action

Fix / Workaround

Current workaround

Local source patch in agent/anthropic_adapter.py to remove context-1m-2025-08-07 from _COMMON_BETAS:

Code Example

_COMMON_BETAS = [
    "interleaved-thinking-2025-05-14",
    "fine-grained-tool-streaming-2025-05-14",
    # "context-1m-2025-08-07",  # commented out for affected subscriptions
]

---

anthropic:
  drop_context_1m_beta: true   # default false
RAW_BUFFERClick to expand / collapse

Summary

Some Anthropic Enterprise OAuth subscriptions reject requests that include the context-1m-2025-08-07 beta header with HTTP 400:

The long context beta is not yet available for this subscription.

run_agent.py has reactive retry logic that detects this and re-issues without the beta (drop_context_1m_beta=True path), so the main agent loop recovers. However, auxiliary clients (auxiliary_client.pytitle_generator, vision_tools, etc.) lack this retry path — they catch the 400 and surface a user-visible warning, leaving the aux call permanently failed for the session.

Repro

  1. Anthropic OAuth subscription that does not include the 1M context beta (e.g. some Enterprise-tier accounts in 2026).
  2. Run Hermes Gateway with any model + Slack/Telegram adapter.
  3. Send a DM. The main response succeeds (after the retry tax), but:
    • Title generation fails with the 400, no auto-title.
    • Image attachments fail vision analysis with the same 400.

Current workaround

Local source patch in agent/anthropic_adapter.py to remove context-1m-2025-08-07 from _COMMON_BETAS:

_COMMON_BETAS = [
    "interleaved-thinking-2025-05-14",
    "fine-grained-tool-streaming-2025-05-14",
    # "context-1m-2025-08-07",  # commented out for affected subscriptions
]

This works but is reverted on every hermes update.

Suggested fix

Add a top-level config flag, e.g.:

anthropic:
  drop_context_1m_beta: true   # default false

Wire it into build_anthropic_client() in anthropic_adapter.py (existing drop_context_1m_beta parameter, line 482) and into auxiliary_client.py so all aux client constructions pass it through.

Bonus: have the reactive retry in error_classifier.py:469 persist the flip to the session state so subsequent calls in the same session skip the beta probe entirely (existing comment at anthropic_adapter.py:496 says "subsequent requests in the same session don't repeat the probe" — but the persistence only covers the main loop, not aux calls).

References

  • agent/anthropic_adapter.py:249_COMMON_BETAS definition
  • agent/anthropic_adapter.py:482drop_context_1m_beta parameter
  • agent/error_classifier.py:469oauth_long_context_beta_forbidden failover
  • agent/auxiliary_client.py — aux clients that don't pass drop_context_1m_beta

Environment

  • macOS 14.x
  • Python 3.11.15
  • Hermes config v23
  • Anthropic Enterprise OAuth (custom corporate subscription)

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

hermes - 💡(How to fix) Fix Add config flag to disable `context-1m-2025-08-07` beta header for Anthropic Enterprise OAuth subscriptions