Add unit tests for group ratio, cross-group retry, and price calculation:
- Group ratio CRUD and special ratio override (12 tests)
- HandleGroupRatio with auto-group and special ratios (5 tests)
- ModelPriceHelper with group ratio in price/ratio modes (3 tests)
- Channel selection priority, groups, weighted LB (6 tests)
- RetryParam and AutoGroup service logic (7 tests)
Also restore the group pricing card in model detail SideSheet.
Backend endpoints were removed but frontend still called them causing
404s. ChannelPricingCard no longer fetches, channelPricingApi and
pricingTagApi return empty stubs to keep dependent components stable.
Replace bytes.Replace with gjson.GetBytes+sjson.SetBytes in passthrough
mode to correctly handle JSON whitespace variations and avoid silently
sending empty body on read errors. Also add log search count limit to
prevent slow COUNT queries on large log tables.
Expose channel public_name in the edit modal and load a larger channel page when building model settings views.
Co-Authored-By: Codex <noreply@anthropic.com>
Use adaptive thinking for Claude requests and rewrite passthrough bodies that still contain the legacy enabled type.
Co-Authored-By: Codex <noreply@anthropic.com>
Reject redemption requests from synced users, surface a localized API message, and cover both model- and controller-level paths with tests.
Co-Authored-By: Codex <noreply@anthropic.com>
Delete leftover channel pricing controllers and routes after removing channel pricing, and align relay price helpers with global pricing plus user channel ratio only.
Co-Authored-By: Codex <noreply@anthropic.com>
gpt-5.4 returns `arguments` as a JSON object for some tools (e.g.
apply_patch, tool_search), but ResponsesOutput.Arguments was typed as
string, causing json.Unmarshal to fail on every such SSE event.
The failure silently dropped all output_item events and the
response.completed event from the forwarded stream, so:
- the client never received tool call content
- usage/token counts could not be extracted (billed as 0)
- client reported "stream closed before response.completed"
Fix: change Arguments to json.RawMessage and add GetArguments() which
normalises both forms to a plain string (unescapes JSON strings,
returns raw bytes for objects).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Register Prometheus ChannelCollector in GetMetrics() sync.Once block
- Add MetricsMiddleware to /v1 and /v1beta relay router groups when metrics enabled
- Remove public_name field from channel creation form and validation
- Restore InvitationCard in topup page
- Extract fetchSearchPage helper in useModelsData to eliminate ~50 lines of duplication; fix setSearching with finally block; use Axios params for URL encoding; fix missing vendor_counts update during paginated search
- Fix vendor ordering in HomePricingFilters to follow vendorsMap sort_order; fix O(n²) Array.includes to use Set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DoApiRequest previously called io.ReadAll on every request body to apply
passthrough model mapping, even when the feature was disabled. This
caused unnecessary memory pressure for large request bodies (long
conversations, multipart image uploads).
Split the guard logic into needsPassthroughModelMapping() so that
ReadAll is only called when all conditions are met (feature enabled +
passthrough mode + model mapped). Non-passthrough requests now pass
the original io.Reader directly to http.NewRequest without buffering.
Rewrite tests to verify combined guard + modify behavior.