You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(chat): 👍/👎 feedback on assistant messages — closes chat↔eval loop
Foundation for the closed feedback loop the system has been missing.
Every assistant message can now be rated by the viewer; the rating
lives on the chat_messages row itself (rating: -1/0/+1 +
rating_comment). When user-auth lands this can move to a join table
without changing the API surface — the rating semantic is the same
either way.
Migration 033 adds two nullable-on-display, non-null-on-storage
columns. ORM model updated. ChatMessageResponse exposes the rating so
already-rated messages show their state when conversation history
loads.
API: PUT /chat/conversations/{cid}/messages/{mid}/rating accepts
{rating: -1|0|1, comment?: str}. Setting rating to 0 also clears the
comment (so the two never disagree). Validates the message belongs to
the conversation; bumps conversation.updated_at so sort order
reflects the activity.
UI: small 👍 / 👎 buttons in the assistant message header, next to
Copy and Delete. Click toggles the rating (clicking the active one
clears it). Optimistic local update so the click feels instant; on
API failure we revert and show a toast. Buttons only appear for
assistant messages — user messages stay clean.
This commit deliberately stops at "rating is captured and visible".
The next step (promoting +1 messages into qa_eval gold samples and
surfacing -1 ones for admin review) is a separate piece that can
work on whatever feedback accumulates here.
0 commit comments