Content moderation collected Anthropic image blocks only from source.data, never
from source.url. Since #8312 the /v1/messages -> OpenAI Responses bridge forwards
URL image sources upstream as input_image, so an image sent as
{"type":"url","url":...} (including a data: URI) reached the model without
being moderated, while the same image sent as base64 was. The native Anthropic
path forwarded such images unmoderated as well.
Collect source.url like the other image URL fields; addModerationImage still
accepts only http(s) and data: values.
The previous Codex catalog advertised only "none" for k3.1-pro, so Codex
clients that still hold it send reasoning.effort=none. Preserving none for
K3.1 made those requests fail upstream with HTTP 400 (K3.1 cannot disable
thinking) instead of running at the default effort as they do today.
Keep the existing compatible-upstream rule on the Responses path: strip the
none placeholder for K3.1 exactly like every other Kimi model. The new
catalog no longer advertises none, so current clients are unaffected.
openCodeSessionHintBody built the hint with strconv.Quote, which emits Go
escapes such as \U000f0001 that are not JSON. A session id containing such a
rune (private-use or tag characters, e.g. subdivision flag emoji) was read
back truncated, so different conversations could share one
x-opencode-session. Encode with json.Marshal instead.
Also measure the compaction allocation budget in a child test process, as
main already does for other process-wide allocation counters, so background
goroutines left by other service tests cannot fail it intermittently.
The Anthropic /v1/responses bridge had the same gap as the Chat Completions
bridge: successful OAuth/setup-token responses never refreshed the 5h/7d
subscription windows. Sample the response headers on 2xx exactly like the
Chat Completions path, and cover both bridges in one regression test.
Review follow-up:
- Stop treating parameter errors as safety rejections. The message
matcher no longer uses a bare "moderation" keyword and rejects
"unknown/unrecognized/unsupported parameter" style messages, so
Azure-style "Unrecognized request argument supplied: moderation"
(param null) and error-passthrough rewrites (which drop param/code)
are not recorded with the user's prompt.
- Check explicit safety codes before the param exclusion, so Azure
content filtering (code=content_filter, param=prompt), contentFilter
and ResponsibleAIPolicyViolation are recorded; response_incomplete is
only a 400 for content_filter/moderation reasons and counts as well.
- Show image_safety rows with the hit badge instead of the amber error
badge, and exclude them from the "error" result filter.
Review follow-up for the proxy account count refresh:
- Apply a proxy list response only if it is newer than the last applied
one. Previously a failed newer refresh also discarded a slower older
success, which could leave the selector empty.
- Refresh proxy counts on every `created` event. Batch creation can
partially succeed and keep the dialog open, so opening the dialog was
not enough.
- Test ProxySelector with the real vue-i18n and locale files instead of
a hand-written mock of the plural rule.
The proxy selector in the account dialogs showed a bare number next to
the proxy name, and AccountsView loaded the counts only once on mount,
so they went stale after accounts were created, deleted, imported or
rebound.
- Show "N 个账号" / "N account(s)" on the right of each proxy row, before
the test button, with a tooltip.
- Reload proxies with counts whenever the create, edit or bulk-edit
dialog opens. A sequence guard drops out-of-order responses and a
failed reload keeps the previous list.
Image requests rejected by the upstream safety system (for example
"Your request was rejected by the safety system") were only visible in
the ops error log. They are now also written to the risk control center
as log-only evidence (action=image_safety, mode=risk_control_log_only):
no hash blacklist, no auto-ban count, no email, response unchanged.
Detection covers HTTP 400 from the native Images API, SSE/Responses
error events, model refusal text and content_filter incompletes. 400s
carrying error.param (e.g. an invalid `moderation` value) are excluded.
The record uses the gateway request ID from context so it joins with the
ops error log; the response header may carry the upstream x-request-id.
Refs #8992
Anthropic reports thinking tokens in usage.output_tokens_details.thinking_tokens,
a subset of output_tokens. AnthropicUsage had no such field, so Anthropic
accounts served through /v1/chat/completions and /v1/responses never exposed
reasoning_tokens.
Decode the field, carry it through the stream state and the buffered
ClaudeUsage merge (a reported value, even 0, replaces the previous one), and
emit it as Responses output_tokens_details.reasoning_tokens, which the existing
Responses-to-Chat mapping turns into completion_tokens_details.reasoning_tokens.
Billing is unchanged.
Fixes#9048