fix(server): send response feedback for translated non-streaming messages

Merged
SA
5d ago
+41-0

Before this change, a non-streaming /v1/messages request translated to a chat provider (an Anthropic-format client served by a non-Anthropic model) never notified ResponseFeedbackObservers. Chat completions, Responses, native messages and every streaming path already do.

So an extension that tracks prompt-cache usage per session got nothing for these requests. GoModel Pro's courtesy_reply guardrail (ENTERPILOT/GoModel-pro#58) found this in its e2e tests: such conversations never get past cache state unknown.

Change

  • messages_handler.go: call notifyChatResponseFeedback after the translated non-streaming response, the same way the chat completions handler does.
  • TestMessages_TranslatedNonStreamingNotifiesFeedbackObservers: the observer is called once, with input and cached tokens. It fails without the fix (expected: 1, actual: 0).

Tests

  • go test ./internal/server/ -run "Messages|Feedback|Rewrite" passes.
  • The pre-commit hooks pass, including make test-race, the hot-path performance guard and make lint.
  • The TestAdmin* dashboard tests in internal/server fail locally, because the dashboard assets aren't built in this worktree. The change doesn't touch them.

Written with Claude Code (Claude Opus 5.5).