Send per-app provider attribution titles from one gateway app registry

Add openai_gateway/apps.py as the single list of internal gateway apps and
send X-OpenRouter-Title (plus legacy X-Title and HTTP-Referer) per app to
every upstream. Label the Devii agent, bots, modifier, quiz grading, SEO
metadata, community and sync callers. Shorten two app references that
exceeded the 30 character limit and were recorded as default.
Also includes the pending Muse Code, route health and Responses work.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 18:45:09 +01:00
co-authored by Claude Sonnet 5.5
parent ec30ed408c
commit bc11475f29
31 changed files with 2198 additions and 208 deletions
@@ -7,6 +7,7 @@ from devplacepy.services.openai_gateway.usage import (
USAGE_FIELDS,
Pricing,
accumulate_usage,
classify_error,
compute_cost,
new_usage_totals,
normalize_usage,
@@ -325,3 +326,13 @@ def test_upstream_reported_model_get_raising_never_propagates():
raise RuntimeError("boom too")
assert upstream_reported_model(HostileHeaders()) is None
def test_classify_error_model_unavailable_400_is_model_not_found():
body = '{"error":{"type":"server_error","message":"Upstream request failed: Model is unavailable."}}'
assert classify_error(400, None, body) == "model_not_found"
assert classify_error(404, None, "") == "model_not_found"
assert classify_error(400, None, '{"error":"bad schema"}') == "bad_request"
assert (
classify_error(400, None, "context window exceeded") == "context_length"
)