Retry Anthropic requests after deprecated anthropic-beta header rejection#3657
Conversation
anthropic-beta header rejection
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR updates the API proxy’s Anthropic request handling to recover from upstream 400s caused by deprecated anthropic-beta header values by stripping the rejected value, retrying once, and caching learned deprecated values for subsequent requests.
Changes:
- Detect Anthropic 400 responses indicating a deprecated
anthropic-betavalue, strip only the rejected value, and retry the request once. - Cache deprecated beta values in-memory and proactively strip them from later requests, with warning logs for both retry and cached-strip paths.
- Add regression tests covering the retry behavior and the proactive stripping behavior.
Show a summary per file
| File | Description |
|---|---|
| containers/api-proxy/proxy-request.js | Adds deprecated anthropic-beta detection, single-retry stripping behavior, in-memory caching, and warning logs. |
| containers/api-proxy/server.proxy.test.js | Adds focused tests for Anthropic deprecated beta handling and introduces per-test reset plumbing for the new cache. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
✅ Smoke Test Results
Overall: PASS — Claude engine validation complete.
|
This comment has been minimized.
This comment has been minimized.
Smoke Test: Copilot BYOK (Offline) ModePR #3657: Retry Anthropic requests after deprecated ✅ GitHub MCP - Successfully queried PRs Note: Running in BYOK offline mode ( Status:
|
📡 API Proxy OTEL Tracing Smoke Test Results✅ Scenario 1: Module Loading — ✅ Scenario 2: Test Suite — All 32 OTEL tests passed (span creation, token attributes, parent context, OTLP export, file export) ✅ Scenario 3: Env Var Forwarding — ✅ Scenario 4: Token Tracker Integration — SummaryAll infrastructure tests passing. OTEL module, test suite, env forwarding, and integration points are validated. OTEL tracing not yet active in runtime (expected during development — requires endpoint config and explicit activation).
|
|
PR titles: Refactor agent volume assembly into focused mount modules; Refactor Squid config generation into focused modules; Retry Anthropic requests after deprecated Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
|
Smoke test FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Chroot Runtime Version Test ResultsThe chroot environment test compared runtime versions between the host and the chrooted environment:
Result: Tests did not fully pass. Python and Node.js versions differ between the host runner environment and the chrooted agent container. Context: These version differences are expected when the agent container uses a different base image (Ubuntu 22.04) than the GitHub Actions runner. The chroot test verifies that runtimes are accessible and functional within the chroot environment, even if versions differ.
|
Service Connectivity Test Results❌ Redis: Connection timeout Overall: FAIL — All service checks failed. Services are unreachable at
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS All builds and tests completed successfully across all 18 projects in 8 ecosystems.
|
Smoke Test Results✅ GitHub MCP – PR #3657: Retry Anthropic requests after deprecated Status: PASS 🎉
|
Anthropic now rejects deprecated
anthropic-betavalues such ascontext-1m-2025-08-07, which causes Copilot CLI requests to fail with a 400 and exhaust retries. This change teaches the API proxy to detect that specific rejection, strip only the invalid beta value, and retry once.Proxy retry path
Unexpected value(s) \` for the `anthropic-beta` header`In-memory learning
Observability
Regression coverage