Repository navigation
feat(proxy): report DeepSeek as its own provider in dashboard - #2565
JerrettDavis merged 8 commits into
Conversation
OpenAI-compatible chat traffic (chat/completions, GitHub Copilot, custom bases) labels its provider openai unless the upstream host is OpenCode Zen, so DeepSeek requests collapse into the generic openai bucket in the dashboard by_provider / Prometheus requests_by_provider breakdown. Classify by model id: deepseek* models now report provider deepseek. Display-only — pricing stays keyed on the model, not this label. Vendor routing prefixes (deepseek/deepseek-chat) resolve to the underlying model. Closes headroomlabs-ai#1832
PR governanceThis PR does not yet satisfy the required template fields:
Please update the PR body, or move the PR back to draft while it is still in progress. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This pull request has had no recent activity and is being marked stale. Please rebase, resolve conflicts, or comment if it is still actively being worked. |
There was a problem hiding this comment.
Current-main integration preserves the contributor's model-based DeepSeek reporting and known-upstream/xAI precedence. One handler conflict was mechanically reconciled with main's _resolve_openai_chat_forward_path; the contributor attribution assignment AST is identical to its published head, and the chat-path calls match main's AST. All other413incoming patches (414paths total) match old-main to current-main after diff-location normalization. Main-relative scope remains only the intended three Python files. A local UTF-8 reconstruction corrected an initial encoding mistake before tests/final commit; no unintended text/comment changes remain.
Fresh validation:384 passed,27 skipped,2 warnings across provider/passthrough/integration/routing/xAI and incoming-current-main regressions. Three contributor Python files pass Ruff lint/format; candidate offline uv lock check and main-relative whitespace pass. Complete tracked native inputset/everyrecordedinputhash/artifactchecksum verified before reuse of existing3982DLL; not a fresh build. Static assignment/patch proof is not live provider, dashboard or HTTP execution. Previous106attribution/cardinality probe results remain historical; no new106caseclaim. Fresh tests use synthetic/mocked upstreams, not a live DeepSeek credential/account.
Author discussion and all current inline thread states reviewed; no outstanding inline findings or author replies. Recognized upstream labels and fixed unknown-custom bucket remain ahead of model fallback; no hostname-derived telemetry label introduced. Pricing unchanged. Source/test delta contains no workflow/setup/dependency/CLI/native path changes, and current-main publication security gate passes. Contributor correctness/intent unchanged. Maintainers handle CI; no PR merged.
Final qualification: exact head ecc8dc1 contains current upstream/main 0ddaa56. Fresh discussion and paginated review-thread audits contain no new unreviewed findings. Exact CI42311575530 succeeded, all actual Actions runs are terminal, and GitHub reports MERGEABLE. Older cancelled governance artifacts have newer successful replacements; they are not relabeled successful. No failing/action-required checks. Approval refreshed for independent human merge review; nothing merged.
Final current-main requalification
Exact head 46af0f7378cb53a1916dbdd0b5fc40c23f28f5c8.
Qualified against authoritative upstream/main 12864fc8f01a1ca6c58440eccef0dabdd3e595b8. Current-main focused suite:384 passed,27 optional skips,2 pricing-age warnings. Three intended Python files; model-attribution assignment AST preserved and main chat-path call AST identical. Incoming main patches are accounted for. Synthetic/mocked-upstream attribution coverage only; no live DeepSeek/provider/dashboard HTTP claim.
Changed-file lint/format, offline lock and whitespace checks passed during source qualification. The existing native DLL was reused only after the complete recorded native input set, every input hash and artifact checksum were verified; no fresh native build is claimed. Fresh complete conversation/author/Devin audits add no new unreviewed source finding. Exact-head CI is successful, all raw Actions in upstream and recorded repositories are terminal acceptable, rollup has no failing/action-required checks, and GitHub reports MERGEABLE. No PR merged.
🤖 I have created a release *beep* *boop* --- ## [0.44.0](v0.43.1...v0.44.0) (2026-11-09) ### ⚠ BREAKING CHANGES * **packaging:** keep PyTorch extras out of all ([#4067](#4067)) ### Features * **pipeline:** say whose request an OutcomeSnapshot is ([#4698](#4698)) ([a2bcbd1](a2bcbd1)) * **providers:** add Hermes agent wrap support ([#934](#934)) ([7877241](7877241)) * **proxy/model-router:** add shadow mode (HEADROOM_MODEL_ROUTER_LOG_ONLY) ([#2395](#2395)) ([861ef95](861ef95)) * **proxy:** add lossless /v1/compress mode and detect provider by wire shape ([#4617](#4617)) ([33f067a](33f067a)) * **proxy:** expose per-request cost_usd in /stats recent_requests ([#1079](#1079)) ([#1565](#1565)) ([84cedbf](84cedbf)) * **proxy:** expose shared Redis store availability in /health and /metrics ([#4578](#4578)) ([602ca65](602ca65)) * **proxy:** give turn hooks one conversation id per client conversation ([#4496](#4496)) ([94a99ed](94a99ed)) * **proxy:** report DeepSeek as its own provider in dashboard ([#2565](#2565)) ([9ad16a7](9ad16a7)) * **proxy:** show per-request /stats metadata to token-authenticated callers ([#4168](#4168)) ([9b2dec5](9b2dec5)) * **proxy:** unified multi-upstream routing for Anthropic Cloud and local oMLX ([#4597](#4597)) ([f896161](f896161)) * **savings:** carry cumulative actual output_tokens in history checkpoints ([#2921](#2921)) ([8388ff5](8388ff5)) * **wrap:** add `headroom wrap droid` for Factory Droid ([#4143](#4143)) ([bb8d18a](bb8d18a)) * **wrap:** make the Serena code-memory MCP opt-in ([#4509](#4509)) ([2649835](2649835)) ### Bug Fixes * **asgi:** stop buffering when the client disconnects (GHSA-mc2f-vg4v-2fh4) ([#4701](#4701)) ([c6d7081](c6d7081)) * **beacon:** enforce the allowlist below the top-level keys ([#4691](#4691)) ([456288d](456288d)) * **binaries:** fail closed on HEADROOM_BINARIES_ALLOW_UNVERIFIED=0/false ([#3218](#3218)) ([da6d973](da6d973)) * **cache:** record TTL observations with relative filenames ([#4711](#4711)) ([51d9dc5](51d9dc5)) * **cache:** round learned TTL upper bounds up to whole seconds ([#4710](#4710)) ([13347e3](13347e3)) * **cache:** save prefix-tracker state when the exit signal arrives ([#4715](#4715)) ([3ba4223](3ba4223)) * **ccr:** lowercase the hash in the streaming feedback recorders ([#2313](#2313)) ([3912c04](3912c04)) * **ci:** keep the npm publish token out of install and build steps ([#4690](#4690)) ([8f6366c](8f6366c)) * **cli:** resolve active proxy port for read commands ([#3522](#3522)) ([02c4e92](02c4e92)) * **content-router:** trust confident HTML detection over mixed-content heuristics ([#3627](#3627)) ([f50db67](f50db67)) * **dashboard:** lifetime metrics and refresh ([#2374](#2374)) ([eb9932a](eb9932a)) * **doctor:** recognize IPv6 loopback and case-insensitive proxy routing URLs ([#3255](#3255)) ([2b0315b](2b0315b)) * **install:** decode Windows Task Scheduler XML output before parsing ([#3969](#3969)) ([#4064](#4064)) ([b78e07d](b78e07d)) * **install:** make install status agree with doctor when the proxy is reachable ([#3072](#3072)) ([#3141](#3141)) ([05431b2](05431b2)) * **langchain:** check optional integration availability ([#4042](#4042)) ([cde584d](cde584d)) * **learn:** harden analyzer JSON parsing against malformed LLM output ([#2471](#2471)) ([12864fc](12864fc)) * **learn:** support opencode v2 session schema in learn scanner ([#4199](#4199)) ([c05466a](c05466a)) * **lossless:** fold only pure path listings, never markup ([#4716](#4716)) ([0ccd559](0ccd559)) * **memory:** gracefully degrade on context lookup and initialization errors ([#3251](#3251)) ([#4049](#4049)) ([00d4f44](00d4f44)) * **metrics:** cap savings_by_source rows and fold the rest into other ([#4257](#4257)) ([2038fb2](2038fb2)) * **packaging:** keep PyTorch extras out of all ([#4067](#4067)) ([a890521](a890521)) * **proxy:** add --no-ccr-response-handling flag to bypass response buffering ([#3082](#3082)) ([#3100](#3100)) ([ce14271](ce14271)) * **proxy:** bound the Bedrock Prometheus model label ([#4694](#4694)) ([d70a8b7](d70a8b7)) * **proxy:** drop headers named by Connection when forwarding responses ([#4674](#4674)) ([3871b36](3871b36)) * **proxy:** keep cold-turn reasoning drops sticky so the next warm turn reuses the cached prefix ([#4592](#4592)) ([3544cf5](3544cf5)) * **proxy:** keep the Bedrock credentials provider when startup resolution fails ([#4705](#4705)) ([5438f00](5438f00)) * **proxy:** refresh Bedrock AWS credentials before they expire ([#4696](#4696)) ([adc6724](adc6724)) * **proxy:** rename leaked_threads metric to timed_out_workers_total ([#3908](#3908)) ([bd164a2](bd164a2)) * **proxy:** track response.-prefixed item and content-part events in Responses SSE state ([#4695](#4695)) ([8f4122f](8f4122f)) * **router:** compress tool_result blocks in mutable window with trailing messages ([#4717](#4717)) ([0511bcd](0511bcd)) * **router:** ignore shell operators inside quoted arguments in read detection ([#4646](#4646)) ([8cdce17](8cdce17)) * **scripts:** skip ci-precheck in the pre-push hook when a push only deletes refs ([#4702](#4702)) ([cbcf8d8](cbcf8d8)) * **sdk:** keep Vercel AI SDK tool-result output kinds through compression ([#4670](#4670)) ([ce42754](ce42754)) * **search_compressor:** keep kept rows byte-for-byte and in input order ([#3982](#3982)) ([a538740](a538740)) * **smart-crusher:** keep mixed-array dict rows and exact drop count with factor_out_constants ([#4692](#4692)) ([ced2685](ced2685)) * **smart-crusher:** keep the row the question names ([#4713](#4713)) ([e6e2ebb](e6e2ebb)) * **storage:** return the latest snapshot from JSONLStorage.get ([#4675](#4675)) ([b25c45b](b25c45b)) * **tabular:** split fixed-width rows on column boundaries, not on double spaces ([#4541](#4541)) ([b80245e](b80245e)) * **tag-protector:** do not treat a slash in an unquoted attribute as self-closing ([#4681](#4681)) ([d5644cb](d5644cb)) * **tag-protector:** keep the enclosing tag open after a nested close in marker mode ([#4682](#4682)) ([385d487](385d487)) * **telemetry:** keep install ID stateless ([#3542](#3542)) ([27bba79](27bba79)) * **tokenizers:** resolve chatgpt-4o-* aliases to o200k_base ([#4672](#4672)) ([9648d2d](9648d2d)) * **tokenizers:** unwrap BatchEncoding in HuggingFaceTokenizer.count_messages ([#2447](#2447)) ([9eed58f](9eed58f)) * **vertex:** explain Vertex failures in-band, correct the model/region matrix ([#2640](#2640)) ([0ddaa56](0ddaa56)) * **wrap:** route Claude Code's Bedrock mode through Headroom ([#4316](#4316)) ([aa2093b](aa2093b)) ### Dependencies * bump rusqlite from 0.40.2 to 0.41.1 ([#4658](#4658)) ([74b7ac2](74b7ac2)) * bump the cargo-minor-patch group with 3 updates ([#4657](#4657)) ([c01cf07](c01cf07)) * bump the npm-minor-patch group across 1 directory with 2 updates ([#4650](#4650)) ([def4ef1](def4ef1)) * update click requirement from >=8.3.3 to >=8.5.0 ([#4655](#4655)) ([ea59ac3](ea59ac3)) * update sqlite-vec requirement from >=0.1.6 to >=0.1.9 ([#4654](#4654)) ([de1a1e0](de1a1e0)) * update tree-sitter requirement from <0.27,>=0.25.2 to >=0.26.0,<0.27 ([#4656](#4656)) ([910588e](910588e)) --- 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: headroom-release[bot] <352661243+headroom-release[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- fix(tokenizers): resolve chatgpt-4o-* aliases to o200k_base (headroomlabs-ai#4672) - fix(proxy): drop headers named by Connection when forwarding responses (headroomlabs-ai#4674) - fix(tokenizers): unwrap BatchEncoding in HuggingFaceTokenizer.count_messages (headroomlabs-ai#2447) - fix(learn): harden analyzer JSON parsing against malformed LLM output (headroomlabs-ai#2471) - fix(ccr): make batch processing import optional so core compression works without httpx (headroomlabs-ai#3478) - feat(proxy): demote cache-mode frozen-prefix restore log from WARNING to INFO (headroomlabs-ai#4635) - fix(dashboard): lifetime metrics and refresh (headroomlabs-ai#2374) - fix(metrics): cap savings_by_source rows and fold the rest into other (headroomlabs-ai#4257) - fix(smart-crusher): keep mixed-array dict rows and exact drop count with factor_out_constants (headroomlabs-ai#4692) - fix(beacon): enforce the allowlist below the top-level keys (headroomlabs-ai#4691) - fix(init): handle non-UTF-8 directory names when deriving the init profile (headroomlabs-ai#4673) - feat(proxy): add lossless /v1/compress mode and detect provider by wire shape (headroomlabs-ai#4617) - fix(proxy): track response.-prefixed item and content-part events in Responses SSE state (headroomlabs-ai#4695) - fix(proxy): apply max_body_bytes to chat completions and responses routes (headroomlabs-ai#4693) - fix(proxy): refresh Bedrock AWS credentials before they expire (headroomlabs-ai#4696) - fix(ci): keep the npm publish token out of install and build steps (headroomlabs-ai#4690) - fix(tag-protector): keep the enclosing tag open after a nested close in marker mode (headroomlabs-ai#4682) - fix(proxy): attach OpenAI chat memory only to a trailing user message (headroomlabs-ai#4680) - feat(proxy): unified multi-upstream routing for Anthropic Cloud and local oMLX (headroomlabs-ai#4597) - feat(proxy/model-router): add shadow mode (HEADROOM_MODEL_ROUTER_LOG_ONLY) (headroomlabs-ai#2395) - feat(proxy): show per-request /stats metadata to token-authenticated callers (headroomlabs-ai#4168) - feat(savings): carry cumulative actual output_tokens in history checkpoints (headroomlabs-ai#2921) - feat(proxy): report DeepSeek as its own provider in dashboard (headroomlabs-ai#2565) - fix(ccr): lowercase the hash in the streaming feedback recorders (headroomlabs-ai#2313) - feat(proxy): expose per-request cost_usd in /stats recent_requests (headroomlabs-ai#1079) (headroomlabs-ai#1565) - feat(proxy): expose shared Redis store availability in /health and /metrics (headroomlabs-ai#4578) - feat(wrap): add `headroom wrap droid` for Factory Droid (headroomlabs-ai#4143) - fix(evals): exclude provider failures from answer scores (headroomlabs-ai#4503) - fix(storage): return the latest snapshot from JSONLStorage.get (headroomlabs-ai#4675) - feat(wrap): make the Serena code-memory MCP opt-in (headroomlabs-ai#4509) - fix(scripts): skip ci-precheck in the pre-push hook when a push only deletes refs (headroomlabs-ai#4702) - fix(wrap): route Claude Code's Bedrock mode through Headroom (headroomlabs-ai#4316) - fix(lossless): fold only pure path listings, never markup (headroomlabs-ai#4716) - fix(tag-protector): do not treat a slash in an unquoted attribute as self-closing (headroomlabs-ai#4681) - fix(proxy): bound the Bedrock Prometheus model label (headroomlabs-ai#4694) - fix(proxy): attach OpenAI Responses memory only to a trailing user item (headroomlabs-ai#4704) - fix(proxy): keep the Bedrock credentials provider when startup resolution fails (headroomlabs-ai#4705) - fix(cache): round learned TTL upper bounds up to whole seconds (headroomlabs-ai#4710) - fix(asgi): stop buffering when the client disconnects (GHSA-mc2f-vg4v-2fh4) (headroomlabs-ai#4701) - fix(cache): save prefix-tracker state when the exit signal arrives (headroomlabs-ai#4715) - fix(router): compress tool_result blocks in mutable window with trailing messages (headroomlabs-ai#4717) - fix(smart-crusher): keep the row the question names (headroomlabs-ai#4713) - fix(cache): record TTL observations with relative filenames (headroomlabs-ai#4711) - feat(proxy): give turn hooks one conversation id per client conversation (headroomlabs-ai#4496) - feat(pipeline): say whose request an OutcomeSnapshot is (headroomlabs-ai#4698) - chore: release 0.44.0 (headroomlabs-ai#4665) - fix(openclaw): return structured retrieval tool results (headroomlabs-ai#4707) - fix(proxy): don't take Claude Code's "Tool loaded." note as the user query (headroomlabs-ai#4714) - fix(wrap): match Serena's unset dashboard key instead of appending a duplicate (headroomlabs-ai#4315) - fix(proxy): keep reserved openai tool names resident during tool search deferral (headroomlabs-ai#4753) - fix(opencode): do not break every request when the proxy URL is empty or invalid (headroomlabs-ai#4750) - fix(sdk): reject sharedcontext maxentries below 1 (headroomlabs-ai#4743) - docs(examples): name the port variable shell-integration.sh reads (headroomlabs-ai#4735) - fix(cache): exclude cold starts from TTL hit evidence (headroomlabs-ai#4728) - fix(cache): scope learned TTL cache to its source file (headroomlabs-ai#4727) - fix(proxy): turn off the image stage when --compressor leaves out image (headroomlabs-ai#4723) - fix(openclaw): let the circuit breaker open on proxy failures (headroomlabs-ai#4755) - fix(benchmarks): drop the duplicate protect_recent=0 table from the proof harness (headroomlabs-ai#4754) - fix(opencode): override effect to patched 4.0.0-beta.103 (headroomlabs-ai#4762) - fix(ci): verify installer provenance in build workflows (headroomlabs-ai#4677) - fix(cache): restore query-only semantic cache lookups (headroomlabs-ai#4709) - fix(memory): resolve pi cwd before injecting project tools (headroomlabs-ai#4618) - fix(examples): validate the macos launchagent port as plain decimal (headroomlabs-ai#4733) - fix(opencode): stop routing non-LLM hosts and paths to the proxy (headroomlabs-ai#4747) (headroomlabs-ai#4758) - fix(sdk): accept string contents and functionCall without args in the Gemini adapter (headroomlabs-ai#4756) - fix(deps): move the wrap E2E harness to npm 12.2.2 and drop the fixed audit exceptions (headroomlabs-ai#4778) - docs(claude): keep Remote Control behind Headroom via an HTTPS_PROXY route (headroomlabs-ai#1779) (headroomlabs-ai#4575) - fix(code-aware): skip the Kompress fallback when Kompress is disabled (headroomlabs-ai#4720) - fix(examples): keep the macos launchagent running when reinstall is declined (headroomlabs-ai#4734) - fix(benchmarks): refuse a dirty or non-git --worktree in codemode_ab (headroomlabs-ai#4736) - fix(opencode): default options-form https.request calls to https (headroomlabs-ai#4749) - fix(cache): preserve Anthropic tool-result blocks on replay (headroomlabs-ai#4765) - fix(cache): order disk writes with result invalidation (headroomlabs-ai#4766) - fix(cache): refresh semantic cache recency on updates (headroomlabs-ai#4767) - fix(sdk): reject "." ".." and NUL plugin names like the python twin (headroomlabs-ai#4771) - fix(sdk): encode the signature hash in client.telemetry.getTool (headroomlabs-ai#4772) - fix(sdk): keep Gemini thought signatures and call ids through the compress round trip (headroomlabs-ai#4777) - fix(proxy): keep hop-by-hop request headers off upstream calls (headroomlabs-ai#4775) - fix(proxy): let an extension declare its install() fail-closed (headroomlabs-ai#4737) (headroomlabs-ai#4773) - fix(sdk): throw typed proxy 4xx errors from compress instead of retrying (headroomlabs-ai#4751) - fix(opencode): keep child process options when the args slot is null or undefined (headroomlabs-ai#4748) - fix(compress): stop adding markers the caller did not ask for (headroomlabs-ai#4678) - fix(deps): patch quinn-udp, rustix and opentelemetry-api advisories (headroomlabs-ai#4835) - deps: bump the cargo-minor-patch group across 1 directory with 11 updates (headroomlabs-ai#4860) - fix(sql): stop granting anon read access to raw proxy telemetry (headroomlabs-ai#4867) - Type-guard memory mode passed to memory_context_inert_reason
Description
Fixes #1832.
DeepSeek traffic through the OpenAI-compatible chat path (chat/completions, GitHub Copilot, custom bases) is labelled provider
openaiunless the upstream host is OpenCode Zen. So DeepSeek requests collapse into the genericopenaibucket in the dashboardby_provider/ Prometheusrequests_by_providerbreakdown — the reporter sees no separate DeepSeek line.Closes #1832
Type of Change
Changes Made
provider_label_from_model()inpassthrough.py:deepseek*model ids now report providerdeepseek.custom_chat_provider or provider_label_from_model(model) or "openai".deepseek/deepseek-chat,github/deepseek-v4) resolve to the underlying model; the prefix table is ordered so adding more OpenAI-compatible providers later is a one-line change.Testing
pytest)ruff check .)mypy headroom)Test Output
Real Behavior Proof
pytest/ruff/mypyas above.tests/test_proxy_passthrough.py— DeepSeek ids (incl. vendor prefixes and casing) map to providerdeepseek; OpenAI/o-series/zen ids stay unlabelled.deepseek*requests now surface as a distinctdeepseekprovider in theby_provider/requests_by_providerbreakdown instead of folding intoopenai.Review Readiness
Checklist
CHANGELOG.md— it is generated by release-please from my Conventional Commit PR title (a CI guard enforces this)Additional Notes
Documentation checklist item is N/A — this is a display-only provider-label classification with no user-facing config or docs surface. Manual testing box left unchecked: validated at the unit boundary rather than a live DeepSeek dashboard round.
Maintainer current-main requalification
Exact head
ecc8dc149036ca65dd9828ab17e31e0a9f35c06c, upstream main0ddaa56c21cdc01c4774391fdcc69e987ecc4e5c.Current-main integration preserves the contributor's model-based DeepSeek reporting and known-upstream/xAI precedence. One handler conflict was mechanically reconciled with main's _resolve_openai_chat_forward_path; the contributor attribution assignment AST is identical to its published head, and the chat-path calls match main's AST. All other413incoming patches (414paths total) match old-main to current-main after diff-location normalization. Main-relative scope remains only the intended three Python files. A local UTF-8 reconstruction corrected an initial encoding mistake before tests/final commit; no unintended text/comment changes remain.
Fresh validation:384 passed,27 skipped,2 warnings across provider/passthrough/integration/routing/xAI and incoming-current-main regressions. Three contributor Python files pass Ruff lint/format; candidate offline uv lock check and main-relative whitespace pass. Complete tracked native inputset/everyrecordedinputhash/artifactchecksum verified before reuse of existing3982DLL; not a fresh build. Static assignment/patch proof is not live provider, dashboard or HTTP execution. Previous106attribution/cardinality probe results remain historical; no new106caseclaim. Fresh tests use synthetic/mocked upstreams, not a live DeepSeek credential/account.
Author discussion and all current inline thread states reviewed; no outstanding inline findings or author replies. Recognized upstream labels and fixed unknown-custom bucket remain ahead of model fallback; no hostname-derived telemetry label introduced. Pricing unchanged. Source/test delta contains no workflow/setup/dependency/CLI/native path changes, and current-main publication security gate passes. Contributor correctness/intent unchanged. Exact published-head hosted checks and final fresh discussion/main/mergeability guard remain before approval. Maintainers handle CI; no PR merged.
Exact-head hosted checks are being handled by maintainers. No new finding in the reviewed scope; formal approval awaits exact-head hosted qualification; nothing merged.