Skip to content

fix(anthropic): strip styled Claude model ids - #651

Merged
JerrettDavis merged 5 commits into
headroomlabs-ai:mainfrom
Kumario1:fix/claude-model-ansi-stripping
Jun 13, 2026
Merged

fix(anthropic): strip styled Claude model ids#651
JerrettDavis merged 5 commits into
headroomlabs-ai:mainfrom
Kumario1:fix/claude-model-ansi-stripping

Conversation

@Kumario1

@Kumario1 Kumario1 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #626 by normalizing Anthropic/Claude model ids that contain ANSI escape sequences or dangling style suffixes before provider lookups and upstream forwarding. The branch has been updated onto current main and the proxy handler conflicts have been resolved.

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Tests only

Changes Made

  • Normalize Anthropic model ids before context/pricing lookup.
  • Sanitize Anthropic /v1/models metadata and styled /v1/models/{id} passthrough paths.
  • Sanitize /v1/messages request body model ids before upstream forwarding.
  • Resolved current-main conflicts while preserving newer model_override and streaming passthrough behavior.

Testing

  • Unit tests
  • Route/proxy tests
  • Lint/static checks
  • Manual testing

Test Output

UV_SKIP_WHEEL_FILENAME_CHECK=1 uv run --with pytest --with fastapi --with httpx --with uvicorn --with h2 python -m pytest tests/test_providers/test_anthropic.py tests/test_provider_proxy_routes.py::test_anthropic_model_metadata_strips_ansi_model_ids tests/test_provider_proxy_routes.py::test_anthropic_model_detail_path_strips_ansi_model_id tests/test_provider_proxy_routes.py::test_anthropic_messages_strips_ansi_model_id_before_upstream -q
17 passed, 2 warnings in 39.91s

UV_SKIP_WHEEL_FILENAME_CHECK=1 uv run --with ruff ruff check headroom/providers/anthropic.py headroom/proxy/handlers/openai.py headroom/proxy/handlers/anthropic.py tests/test_providers/test_anthropic.py tests/test_provider_proxy_routes.py
All checks passed!

Real Behavior Proof

  • Environment: Windows 11, Python 3.13.3, focused local worktree for PR fix(anthropic): strip styled Claude model ids #651 after merging current upstream/main.
  • Exact command / steps: Merged current main, resolved conflicts in Anthropic/OpenAI proxy handlers, ran the PR's targeted provider/proxy tests and ruff checks.
  • Observed result: Styled Anthropic model metadata, model-detail path, and messages upstream sanitization tests pass; ruff reports no issues.
  • Not tested: Full repository mypy/pre-commit; existing unrelated Windows fcntl typing errors block full hook execution locally.

Review Readiness

  • I have performed a self-review
  • This PR is ready for human review

Description

This PR prepares fix(anthropic): strip styled Claude model ids for review by documenting the intended change, validation evidence, and remaining merge-readiness context.

Linked issues: #626

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Tests only

Changes Made

  • Commit: fix(anthropic): normalize styled model ids
  • Commit: fix(proxy): strip styled Anthropic model ids
  • Commit: fix: format anthropic model sanitization
  • Commit: Merge remote-tracking branch 'upstream/main' into review/pr-651
  • Touches headroom/cache/dynamic_detector.py
  • Touches headroom/providers/anthropic.py
  • Touches headroom/proxy/handlers/anthropic.py
  • Touches headroom/proxy/handlers/openai.py
  • Touches tests/test_provider_proxy_routes.py
  • Touches tests/test_providers/test_anthropic.py

Testing

  • GitHub checks reviewed
  • Metadata/template validation
  • Local functional testing

Test Output

gh pr view 651 --repo chopratejas/headroom --json statusCheckRollup
- PR Governance / template: FAILURE
- CI / changes: SUCCESS
- Init E2E / docker-init-e2e: SUCCESS
- Wrap E2E / docker-wrap-e2e: SUCCESS
- Wrap Native E2E / wrap-native (ubuntu-latest): SUCCESS
- Wrap Native E2E / wrap-native (macos-latest): SUCCESS
- CI / commitlint: SUCCESS
- PR Governance / label: SUCCESS
- CI / lint: SUCCESS
- CI / build-wheel: SUCCESS
- CI / prefetch-model: SUCCESS
- CI / build: SUCCESS

Real Behavior Proof

  • Environment: GitHub PR metadata and checks for chopratejas/headroom PR fix(anthropic): strip styled Claude model ids #651.
  • Exact command / steps: Reviewed PR title, commits, changed files, linked issues, labels, and check rollup; appended this maintainer template completion block without replacing the author's original description.
  • Observed result: PR body now contains all required governance sections, checked readiness fields, and a non-placeholder validation evidence block.
  • Not tested: This pass updated PR metadata only; code validation remains represented by the linked GitHub checks and any author-provided evidence above.

Review Readiness

  • I have performed a self-review
  • This PR is ready for human review

@DevanshiVyas

Copy link
Copy Markdown
Member

Thank you for your contribution! Issue 626 has also been addressed in PR. Are your changes still needed? Also, please verify your changes on top of the latest changes in main and add a testing section as mentioned in CONTRIBUTING.md

@JerrettDavis

Copy link
Copy Markdown
Collaborator

Thanks, this is a useful fix and the tests cover the important paths: provider lookup, Anthropic metadata, model-detail passthrough, and /v1/messages sanitization.

The branch is currently conflicted. Please rebase/update against current main and rerun CI so we can review the resolved proxy handler changes before merge.

@github-actions github-actions Bot added the status: has conflicts Pull request has merge conflicts with the base branch label Jun 13, 2026
# Conflicts:
#	headroom/proxy/handlers/anthropic.py
#	headroom/proxy/handlers/openai.py
@github-actions github-actions Bot added status: ci failing Required or reported CI checks are failing and removed status: has conflicts Pull request has merge conflicts with the base branch labels Jun 13, 2026
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.56604% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
headroom/proxy/handlers/openai.py 84.21% 2 Missing and 1 partial ⚠️
headroom/cache/dynamic_detector.py 33.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

PR governance

This PR follows the template and is marked ready for human review.

@github-actions github-actions Bot added the status: needs author action Pull request body or readiness checklist still needs author updates label Jun 13, 2026
@JerrettDavis

Copy link
Copy Markdown
Collaborator

Maintainer follow-up: added the minimal headroom/cache/dynamic_detector.py guard for the full-repo mypy CI failure seen on this PR (_exemplar_embeddings can be None). Focused validation: ests/test_cache/test_dynamic_detector.py passed (35 passed, 3 skipped),
uff check headroom/cache/dynamic_detector.py passed, and mypy headroom/cache/dynamic_detector.py --ignore-missing-imports passed.

@github-actions github-actions Bot added status: ready for review Pull request body is complete and the author marked it ready for human review status: ci failing Required or reported CI checks are failing and removed status: ci failing Required or reported CI checks are failing status: needs author action Pull request body or readiness checklist still needs author updates status: ready for review Pull request body is complete and the author marked it ready for human review labels Jun 13, 2026
@JerrettDavis JerrettDavis added the status: ready for review Pull request body is complete and the author marked it ready for human review label Jun 13, 2026
@JerrettDavis
JerrettDavis merged commit 0c5c89d into headroomlabs-ai:main Jun 13, 2026
27 of 29 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 13, 2026
chopratejas pushed a commit that referenced this pull request Jun 16, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>0.26.0</summary>

##
[0.26.0](v0.25.0...v0.26.0)
(2026-06-16)


### Features

* add Copilot BYOK provider wrapper utilities and CLI support
([#1041](#1041))
([e67ee2a](e67ee2a))
* add dashboard agent usage stats
([#814](#814))
([6d3f39f](6d3f39f))
* Add support for Mistral Vibe CLI
([#935](#935))
([0932b8b](0932b8b))
* attribute reread waste to over-compression via marker check
([#901](#901))
([f928576](f928576))
* **bedrock:** cross-region + Converse compression; bundle proxy binary
in images ([#999](#999))
([0dc2e1c](0dc2e1c))
* **dashboard:** surface compression-vs-cache net impact in Prefix Cache
panel ([#913](#913))
([2a4d300](2a4d300))
* **evals:** adversarial-input robustness grid for compressors
([#918](#918))
([5939004](5939004))
* **parser:** detect re-issued identical tool calls as reread waste
([#909](#909))
([7d4ae86](7d4ae86))
* **policy:** batch deep edits through one cache-bust
([#856](#856) P3a)
([#1015](#1015))
([c2e52fe](c2e52fe))
* **policy:** consume net-cost mutation gate in ContentRouter
([#856](#856) P2)
([#905](#905))
([553ade4](553ade4))
* **proxy:** compress AWS Bedrock InvokeModel requests via configurable
upstream ([#720](#720))
([7edb27a](7edb27a))


### Bug Fixes

* **anthropic:** strip styled Claude model ids
([#651](#651))
([0c5c89d](0c5c89d))
* **anyllm:** forward openai api_base/api_key to the any-llm backend
([#942](#942))
([#954](#954))
([a7ee8a6](a7ee8a6))
* **cache:** guard None exemplar embeddings in dynamic detector
([#950](#950))
([1ec9320](1ec9320))
* **cache:** name the missing piece in semantic detector guard
([#1018](#1018))
([3b0bcee](3b0bcee))
* **ci:** check out repo in PR Governance label job
([#1021](#1021))
([4558bc2](4558bc2))
* **ci:** make PR governance advisory
([#1047](#1047))
([74dff94](74dff94))
* **codex:** compute waste signals on the OpenAI Responses path
([#898](#898))
([b9e2761](b9e2761))
* **codex:** poll /wham/usage for subscription limits (handshake no
longer sends x-codex-* headers)
([#924](#924))
([8c00f71](8c00f71))
* **codex:** PR health label check state
([#986](#986))
([99c874d](99c874d))
* **codex:** retag thread providers so history menu stays whole across
the proxy boundary
([#1034](#1034))
([74ae781](74ae781))
* **codex:** write canonical hooks feature flag and migrate deprecated
codex_hooks ([#743](#743))
([dff6a19](dff6a19))
* **compression:** convert tree-sitter byte offsets to char offsets
([#892](#892))
([b1f700f](b1f700f))
* **compression:** correct JSON array item counting and entropy gate
([#887](#887))
([d6f0f0f](d6f0f0f))
* **compression:** keep container bodies compressible in code handler
([#890](#890))
([16ed73b](16ed73b))
* **compression:** measure short-value threshold on payload, not token
([#889](#889))
([65b0e8c](65b0e8c))
* **compression:** use thread-local tree-sitter parsers in code handler
([#893](#893))
([6cdb846](6cdb846))
* **gemini:** surface functionResponse payloads to waste-signal
detection ([#897](#897))
([9b0c840](9b0c840))
* **learn:** decode directory names with spaces in Windows project paths
([#997](#997))
([#1027](#1027))
([2d3701b](2d3701b))
* **learn:** scan subagent and workflow transcripts
([#1045](#1045))
([0ddd4ed](0ddd4ed))
* **openclaw:** declare headroom_retrieve tool contract
([#947](#947))
([7c8c909](7c8c909))
* **policy:** correct warm-cache penalty in net_mutation_gain to (S +
dT) ([#903](#903))
([0632eba](0632eba))
* **proxy:** add native Bedrock converse-stream route
([#917](#917))
([b08ec15](b08ec15))
* **proxy:** keep codex image-generation WS turns alive through the
relay ([#1000](#1000))
([7dbbb40](7dbbb40))
* **proxy:** make budget enforcement actually work
([#885](#885))
([a14ab45](a14ab45))
* **proxy:** read RTK gain stats globally by default
([#957](#957))
([b70fccb](b70fccb))
* route v1internal code assist requests to cloudcode-pa.googleapis…
([#821](#821))
([e20f16b](e20f16b))
* **serena:** stop the Serena dashboard popup and make --no-serena
actually disable Serena
([#1003](#1003))
([919379a](919379a))
* support Copilot Business subscription auth
([#641](#641))
([0b4a4bd](0b4a4bd))
* wire HEADROOM_EXCLUDE_TOOLS / HEADROOM_TOOL_PROFILES into Click proxy
entrypoint ([#943](#943))
([9b7b436](9b7b436))
* **wrap:** avoid duplicate top-level keys when injecting codex provider
([#884](#884))
([dd22cfd](dd22cfd))


### Code Refactoring

* DRY cache logic, add thread safety, fix Bash exclusion
([#704](#704))
([e36fccd](e36fccd))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
studyzy pushed a commit to studyzy/headroom that referenced this pull request Jun 24, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>0.26.0</summary>

##
[0.26.0](headroomlabs-ai/headroom@v0.25.0...v0.26.0)
(2026-06-16)


### Features

* add Copilot BYOK provider wrapper utilities and CLI support
([headroomlabs-ai#1041](headroomlabs-ai#1041))
([e67ee2a](headroomlabs-ai@e67ee2a))
* add dashboard agent usage stats
([headroomlabs-ai#814](headroomlabs-ai#814))
([6d3f39f](headroomlabs-ai@6d3f39f))
* Add support for Mistral Vibe CLI
([headroomlabs-ai#935](headroomlabs-ai#935))
([0932b8b](headroomlabs-ai@0932b8b))
* attribute reread waste to over-compression via marker check
([headroomlabs-ai#901](headroomlabs-ai#901))
([f928576](headroomlabs-ai@f928576))
* **bedrock:** cross-region + Converse compression; bundle proxy binary
in images ([headroomlabs-ai#999](headroomlabs-ai#999))
([0dc2e1c](headroomlabs-ai@0dc2e1c))
* **dashboard:** surface compression-vs-cache net impact in Prefix Cache
panel ([headroomlabs-ai#913](headroomlabs-ai#913))
([2a4d300](headroomlabs-ai@2a4d300))
* **evals:** adversarial-input robustness grid for compressors
([headroomlabs-ai#918](headroomlabs-ai#918))
([5939004](headroomlabs-ai@5939004))
* **parser:** detect re-issued identical tool calls as reread waste
([headroomlabs-ai#909](headroomlabs-ai#909))
([7d4ae86](headroomlabs-ai@7d4ae86))
* **policy:** batch deep edits through one cache-bust
([headroomlabs-ai#856](headroomlabs-ai#856) P3a)
([headroomlabs-ai#1015](headroomlabs-ai#1015))
([c2e52fe](headroomlabs-ai@c2e52fe))
* **policy:** consume net-cost mutation gate in ContentRouter
([headroomlabs-ai#856](headroomlabs-ai#856) P2)
([headroomlabs-ai#905](headroomlabs-ai#905))
([553ade4](headroomlabs-ai@553ade4))
* **proxy:** compress AWS Bedrock InvokeModel requests via configurable
upstream ([headroomlabs-ai#720](headroomlabs-ai#720))
([7edb27a](headroomlabs-ai@7edb27a))


### Bug Fixes

* **anthropic:** strip styled Claude model ids
([headroomlabs-ai#651](headroomlabs-ai#651))
([0c5c89d](headroomlabs-ai@0c5c89d))
* **anyllm:** forward openai api_base/api_key to the any-llm backend
([headroomlabs-ai#942](headroomlabs-ai#942))
([headroomlabs-ai#954](headroomlabs-ai#954))
([a7ee8a6](headroomlabs-ai@a7ee8a6))
* **cache:** guard None exemplar embeddings in dynamic detector
([headroomlabs-ai#950](headroomlabs-ai#950))
([1ec9320](headroomlabs-ai@1ec9320))
* **cache:** name the missing piece in semantic detector guard
([headroomlabs-ai#1018](headroomlabs-ai#1018))
([3b0bcee](headroomlabs-ai@3b0bcee))
* **ci:** check out repo in PR Governance label job
([headroomlabs-ai#1021](headroomlabs-ai#1021))
([4558bc2](headroomlabs-ai@4558bc2))
* **ci:** make PR governance advisory
([headroomlabs-ai#1047](headroomlabs-ai#1047))
([74dff94](headroomlabs-ai@74dff94))
* **codex:** compute waste signals on the OpenAI Responses path
([headroomlabs-ai#898](headroomlabs-ai#898))
([b9e2761](headroomlabs-ai@b9e2761))
* **codex:** poll /wham/usage for subscription limits (handshake no
longer sends x-codex-* headers)
([headroomlabs-ai#924](headroomlabs-ai#924))
([8c00f71](headroomlabs-ai@8c00f71))
* **codex:** PR health label check state
([headroomlabs-ai#986](headroomlabs-ai#986))
([99c874d](headroomlabs-ai@99c874d))
* **codex:** retag thread providers so history menu stays whole across
the proxy boundary
([headroomlabs-ai#1034](headroomlabs-ai#1034))
([74ae781](headroomlabs-ai@74ae781))
* **codex:** write canonical hooks feature flag and migrate deprecated
codex_hooks ([headroomlabs-ai#743](headroomlabs-ai#743))
([dff6a19](headroomlabs-ai@dff6a19))
* **compression:** convert tree-sitter byte offsets to char offsets
([headroomlabs-ai#892](headroomlabs-ai#892))
([b1f700f](headroomlabs-ai@b1f700f))
* **compression:** correct JSON array item counting and entropy gate
([headroomlabs-ai#887](headroomlabs-ai#887))
([d6f0f0f](headroomlabs-ai@d6f0f0f))
* **compression:** keep container bodies compressible in code handler
([headroomlabs-ai#890](headroomlabs-ai#890))
([16ed73b](headroomlabs-ai@16ed73b))
* **compression:** measure short-value threshold on payload, not token
([headroomlabs-ai#889](headroomlabs-ai#889))
([65b0e8c](headroomlabs-ai@65b0e8c))
* **compression:** use thread-local tree-sitter parsers in code handler
([headroomlabs-ai#893](headroomlabs-ai#893))
([6cdb846](headroomlabs-ai@6cdb846))
* **gemini:** surface functionResponse payloads to waste-signal
detection ([headroomlabs-ai#897](headroomlabs-ai#897))
([9b0c840](headroomlabs-ai@9b0c840))
* **learn:** decode directory names with spaces in Windows project paths
([headroomlabs-ai#997](headroomlabs-ai#997))
([headroomlabs-ai#1027](headroomlabs-ai#1027))
([2d3701b](headroomlabs-ai@2d3701b))
* **learn:** scan subagent and workflow transcripts
([headroomlabs-ai#1045](headroomlabs-ai#1045))
([0ddd4ed](headroomlabs-ai@0ddd4ed))
* **openclaw:** declare headroom_retrieve tool contract
([headroomlabs-ai#947](headroomlabs-ai#947))
([7c8c909](headroomlabs-ai@7c8c909))
* **policy:** correct warm-cache penalty in net_mutation_gain to (S +
dT) ([headroomlabs-ai#903](headroomlabs-ai#903))
([0632eba](headroomlabs-ai@0632eba))
* **proxy:** add native Bedrock converse-stream route
([headroomlabs-ai#917](headroomlabs-ai#917))
([b08ec15](headroomlabs-ai@b08ec15))
* **proxy:** keep codex image-generation WS turns alive through the
relay ([headroomlabs-ai#1000](headroomlabs-ai#1000))
([7dbbb40](headroomlabs-ai@7dbbb40))
* **proxy:** make budget enforcement actually work
([headroomlabs-ai#885](headroomlabs-ai#885))
([a14ab45](headroomlabs-ai@a14ab45))
* **proxy:** read RTK gain stats globally by default
([headroomlabs-ai#957](headroomlabs-ai#957))
([b70fccb](headroomlabs-ai@b70fccb))
* route v1internal code assist requests to cloudcode-pa.googleapis…
([headroomlabs-ai#821](headroomlabs-ai#821))
([e20f16b](headroomlabs-ai@e20f16b))
* **serena:** stop the Serena dashboard popup and make --no-serena
actually disable Serena
([headroomlabs-ai#1003](headroomlabs-ai#1003))
([919379a](headroomlabs-ai@919379a))
* support Copilot Business subscription auth
([headroomlabs-ai#641](headroomlabs-ai#641))
([0b4a4bd](headroomlabs-ai@0b4a4bd))
* wire HEADROOM_EXCLUDE_TOOLS / HEADROOM_TOOL_PROFILES into Click proxy
entrypoint ([headroomlabs-ai#943](headroomlabs-ai#943))
([9b7b436](headroomlabs-ai@9b7b436))
* **wrap:** avoid duplicate top-level keys when injecting codex provider
([headroomlabs-ai#884](headroomlabs-ai#884))
([dd22cfd](headroomlabs-ai@dd22cfd))


### Code Refactoring

* DRY cache logic, add thread safety, fix Bash exclusion
([headroomlabs-ai#704](headroomlabs-ai#704))
([e36fccd](headroomlabs-ai@e36fccd))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
DevZonayed pushed a commit to DevZonayed/headroom that referenced this pull request Aug 17, 2026
## Description

Fixes headroomlabs-ai#626 by normalizing Anthropic/Claude model ids that contain ANSI
escape sequences or dangling style suffixes before provider lookups and
upstream forwarding. The branch has been updated onto current `main` and
the proxy handler conflicts have been resolved.

## Type of Change

- [x] Bug fix
- [ ] New feature
- [ ] Documentation
- [ ] Refactor
- [x] Tests only

## Changes Made

- Normalize Anthropic model ids before context/pricing lookup.
- Sanitize Anthropic `/v1/models` metadata and styled `/v1/models/{id}`
passthrough paths.
- Sanitize `/v1/messages` request body model ids before upstream
forwarding.
- Resolved current-main conflicts while preserving newer
`model_override` and streaming passthrough behavior.

## Testing

- [x] Unit tests
- [x] Route/proxy tests
- [x] Lint/static checks
- [ ] Manual testing

### Test Output

```text
UV_SKIP_WHEEL_FILENAME_CHECK=1 uv run --with pytest --with fastapi --with httpx --with uvicorn --with h2 python -m pytest tests/test_providers/test_anthropic.py tests/test_provider_proxy_routes.py::test_anthropic_model_metadata_strips_ansi_model_ids tests/test_provider_proxy_routes.py::test_anthropic_model_detail_path_strips_ansi_model_id tests/test_provider_proxy_routes.py::test_anthropic_messages_strips_ansi_model_id_before_upstream -q
17 passed, 2 warnings in 39.91s

UV_SKIP_WHEEL_FILENAME_CHECK=1 uv run --with ruff ruff check headroom/providers/anthropic.py headroom/proxy/handlers/openai.py headroom/proxy/handlers/anthropic.py tests/test_providers/test_anthropic.py tests/test_provider_proxy_routes.py
All checks passed!
```

## Real Behavior Proof

- Environment: Windows 11, Python 3.13.3, focused local worktree for PR
headroomlabs-ai#651 after merging current `upstream/main`.
- Exact command / steps: Merged current main, resolved conflicts in
Anthropic/OpenAI proxy handlers, ran the PR's targeted provider/proxy
tests and ruff checks.
- Observed result: Styled Anthropic model metadata, model-detail path,
and messages upstream sanitization tests pass; ruff reports no issues.
- Not tested: Full repository mypy/pre-commit; existing unrelated
Windows `fcntl` typing errors block full hook execution locally.

## Review Readiness

- [x] I have performed a self-review
- [x] This PR is ready for human review


<!-- headroom-maintainer-template-completion:start -->

## Description

This PR prepares `fix(anthropic): strip styled Claude model ids` for
review by documenting the intended change, validation evidence, and
remaining merge-readiness context.

Linked issues: headroomlabs-ai#626

## Type of Change

- [x] Bug fix
- [ ] New feature
- [ ] Documentation
- [ ] Refactor
- [ ] Tests only

## Changes Made

- Commit: fix(anthropic): normalize styled model ids
- Commit: fix(proxy): strip styled Anthropic model ids
- Commit: fix: format anthropic model sanitization
- Commit: Merge remote-tracking branch 'upstream/main' into
review/pr-651
- Touches `headroom/cache/dynamic_detector.py`
- Touches `headroom/providers/anthropic.py`
- Touches `headroom/proxy/handlers/anthropic.py`
- Touches `headroom/proxy/handlers/openai.py`
- Touches `tests/test_provider_proxy_routes.py`
- Touches `tests/test_providers/test_anthropic.py`

## Testing

- [x] GitHub checks reviewed
- [x] Metadata/template validation
- [ ] Local functional testing

### Test Output

```text
gh pr view 651 --repo chopratejas/headroom --json statusCheckRollup
- PR Governance / template: FAILURE
- CI / changes: SUCCESS
- Init E2E / docker-init-e2e: SUCCESS
- Wrap E2E / docker-wrap-e2e: SUCCESS
- Wrap Native E2E / wrap-native (ubuntu-latest): SUCCESS
- Wrap Native E2E / wrap-native (macos-latest): SUCCESS
- CI / commitlint: SUCCESS
- PR Governance / label: SUCCESS
- CI / lint: SUCCESS
- CI / build-wheel: SUCCESS
- CI / prefetch-model: SUCCESS
- CI / build: SUCCESS
```

## Real Behavior Proof

- Environment: GitHub PR metadata and checks for `chopratejas/headroom`
PR headroomlabs-ai#651.
- Exact command / steps: Reviewed PR title, commits, changed files,
linked issues, labels, and check rollup; appended this maintainer
template completion block without replacing the author's original
description.
- Observed result: PR body now contains all required governance
sections, checked readiness fields, and a non-placeholder validation
evidence block.
- Not tested: This pass updated PR metadata only; code validation
remains represented by the linked GitHub checks and any author-provided
evidence above.

## Review Readiness

- [x] I have performed a self-review
- [x] This PR is ready for human review

<!-- headroom-maintainer-template-completion:end -->

---------

Co-authored-by: Tejas Chopra <chopratejas@gmail.com>
Co-authored-by: JerrettDavis <mxjerrett@gmail.com>
DevZonayed pushed a commit to DevZonayed/headroom that referenced this pull request Aug 17, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>0.26.0</summary>

##
[0.26.0](headroomlabs-ai/headroom@v0.25.0...v0.26.0)
(2026-06-16)


### Features

* add Copilot BYOK provider wrapper utilities and CLI support
([headroomlabs-ai#1041](headroomlabs-ai#1041))
([1d0335f](headroomlabs-ai@1d0335f))
* add dashboard agent usage stats
([headroomlabs-ai#814](headroomlabs-ai#814))
([d8967bd](headroomlabs-ai@d8967bd))
* Add support for Mistral Vibe CLI
([headroomlabs-ai#935](headroomlabs-ai#935))
([38b5af6](headroomlabs-ai@38b5af6))
* attribute reread waste to over-compression via marker check
([headroomlabs-ai#901](headroomlabs-ai#901))
([77c0ec8](headroomlabs-ai@77c0ec8))
* **bedrock:** cross-region + Converse compression; bundle proxy binary
in images ([headroomlabs-ai#999](headroomlabs-ai#999))
([d036c4a](headroomlabs-ai@d036c4a))
* **dashboard:** surface compression-vs-cache net impact in Prefix Cache
panel ([headroomlabs-ai#913](headroomlabs-ai#913))
([b422a9e](headroomlabs-ai@b422a9e))
* **evals:** adversarial-input robustness grid for compressors
([headroomlabs-ai#918](headroomlabs-ai#918))
([7c51254](headroomlabs-ai@7c51254))
* **parser:** detect re-issued identical tool calls as reread waste
([headroomlabs-ai#909](headroomlabs-ai#909))
([d828b57](headroomlabs-ai@d828b57))
* **policy:** batch deep edits through one cache-bust
([headroomlabs-ai#856](headroomlabs-ai#856) P3a)
([headroomlabs-ai#1015](headroomlabs-ai#1015))
([2168943](headroomlabs-ai@2168943))
* **policy:** consume net-cost mutation gate in ContentRouter
([headroomlabs-ai#856](headroomlabs-ai#856) P2)
([headroomlabs-ai#905](headroomlabs-ai#905))
([38b3cb4](headroomlabs-ai@38b3cb4))
* **proxy:** compress AWS Bedrock InvokeModel requests via configurable
upstream ([headroomlabs-ai#720](headroomlabs-ai#720))
([c105902](headroomlabs-ai@c105902))


### Bug Fixes

* **anthropic:** strip styled Claude model ids
([headroomlabs-ai#651](headroomlabs-ai#651))
([b7bbdc9](headroomlabs-ai@b7bbdc9))
* **anyllm:** forward openai api_base/api_key to the any-llm backend
([headroomlabs-ai#942](headroomlabs-ai#942))
([headroomlabs-ai#954](headroomlabs-ai#954))
([343f47c](headroomlabs-ai@343f47c))
* **cache:** guard None exemplar embeddings in dynamic detector
([headroomlabs-ai#950](headroomlabs-ai#950))
([82ec599](headroomlabs-ai@82ec599))
* **cache:** name the missing piece in semantic detector guard
([headroomlabs-ai#1018](headroomlabs-ai#1018))
([dce6749](headroomlabs-ai@dce6749))
* **ci:** check out repo in PR Governance label job
([headroomlabs-ai#1021](headroomlabs-ai#1021))
([2fc7e08](headroomlabs-ai@2fc7e08))
* **ci:** make PR governance advisory
([headroomlabs-ai#1047](headroomlabs-ai#1047))
([629fef0](headroomlabs-ai@629fef0))
* **codex:** compute waste signals on the OpenAI Responses path
([headroomlabs-ai#898](headroomlabs-ai#898))
([b9f7c1e](headroomlabs-ai@b9f7c1e))
* **codex:** poll /wham/usage for subscription limits (handshake no
longer sends x-codex-* headers)
([headroomlabs-ai#924](headroomlabs-ai#924))
([852598e](headroomlabs-ai@852598e))
* **codex:** PR health label check state
([headroomlabs-ai#986](headroomlabs-ai#986))
([b231076](headroomlabs-ai@b231076))
* **codex:** retag thread providers so history menu stays whole across
the proxy boundary
([headroomlabs-ai#1034](headroomlabs-ai#1034))
([7f045a6](headroomlabs-ai@7f045a6))
* **codex:** write canonical hooks feature flag and migrate deprecated
codex_hooks ([headroomlabs-ai#743](headroomlabs-ai#743))
([c85a7c3](headroomlabs-ai@c85a7c3))
* **compression:** convert tree-sitter byte offsets to char offsets
([headroomlabs-ai#892](headroomlabs-ai#892))
([7a1bb9c](headroomlabs-ai@7a1bb9c))
* **compression:** correct JSON array item counting and entropy gate
([headroomlabs-ai#887](headroomlabs-ai#887))
([0442b2e](headroomlabs-ai@0442b2e))
* **compression:** keep container bodies compressible in code handler
([headroomlabs-ai#890](headroomlabs-ai#890))
([54d19cc](headroomlabs-ai@54d19cc))
* **compression:** measure short-value threshold on payload, not token
([headroomlabs-ai#889](headroomlabs-ai#889))
([4732d5e](headroomlabs-ai@4732d5e))
* **compression:** use thread-local tree-sitter parsers in code handler
([headroomlabs-ai#893](headroomlabs-ai#893))
([56fe715](headroomlabs-ai@56fe715))
* **gemini:** surface functionResponse payloads to waste-signal
detection ([headroomlabs-ai#897](headroomlabs-ai#897))
([8bf9bbb](headroomlabs-ai@8bf9bbb))
* **learn:** decode directory names with spaces in Windows project paths
([headroomlabs-ai#997](headroomlabs-ai#997))
([headroomlabs-ai#1027](headroomlabs-ai#1027))
([f227015](headroomlabs-ai@f227015))
* **learn:** scan subagent and workflow transcripts
([headroomlabs-ai#1045](headroomlabs-ai#1045))
([d39ec02](headroomlabs-ai@d39ec02))
* **openclaw:** declare headroom_retrieve tool contract
([headroomlabs-ai#947](headroomlabs-ai#947))
([f2dd153](headroomlabs-ai@f2dd153))
* **policy:** correct warm-cache penalty in net_mutation_gain to (S +
dT) ([headroomlabs-ai#903](headroomlabs-ai#903))
([b4b1f90](headroomlabs-ai@b4b1f90))
* **proxy:** add native Bedrock converse-stream route
([headroomlabs-ai#917](headroomlabs-ai#917))
([0839329](headroomlabs-ai@0839329))
* **proxy:** keep codex image-generation WS turns alive through the
relay ([headroomlabs-ai#1000](headroomlabs-ai#1000))
([8ee761d](headroomlabs-ai@8ee761d))
* **proxy:** make budget enforcement actually work
([headroomlabs-ai#885](headroomlabs-ai#885))
([1f5489b](headroomlabs-ai@1f5489b))
* **proxy:** read RTK gain stats globally by default
([headroomlabs-ai#957](headroomlabs-ai#957))
([7aab9a6](headroomlabs-ai@7aab9a6))
* route v1internal code assist requests to cloudcode-pa.googleapis…
([headroomlabs-ai#821](headroomlabs-ai#821))
([2a6d1ae](headroomlabs-ai@2a6d1ae))
* **serena:** stop the Serena dashboard popup and make --no-serena
actually disable Serena
([headroomlabs-ai#1003](headroomlabs-ai#1003))
([a0f9da3](headroomlabs-ai@a0f9da3))
* support Copilot Business subscription auth
([headroomlabs-ai#641](headroomlabs-ai#641))
([8995fcb](headroomlabs-ai@8995fcb))
* wire HEADROOM_EXCLUDE_TOOLS / HEADROOM_TOOL_PROFILES into Click proxy
entrypoint ([headroomlabs-ai#943](headroomlabs-ai#943))
([cc913e8](headroomlabs-ai@cc913e8))
* **wrap:** avoid duplicate top-level keys when injecting codex provider
([headroomlabs-ai#884](headroomlabs-ai#884))
([5c686e2](headroomlabs-ai@5c686e2))


### Code Refactoring

* DRY cache logic, add thread safety, fix Bash exclusion
([headroomlabs-ai#704](headroomlabs-ai#704))
([19ef66b](headroomlabs-ai@19ef66b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ci failing Required or reported CI checks are failing status: ready for review Pull request body is complete and the author marked it ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] headroom wrap claude corrupts model name with ANSI escape codes

4 participants