User Feedback Plugin
The User Feedback plugin adds like/dislike controls to each assistant turn's action row (where the copy button is shown) and provides an admin dashboard for reviewing collected feedback.
Overview
This plugin provides:
- Immediate per-turn
likeanddislikepersistence. - Toggle behavior: clicking an already-active like/dislike undoes the feedback.
- Optional inline free-text feedback after a dislike.
- A consent checkbox (
allow_review) letting users opt in or out of human review of their conversation (defaults to checked). - Retrieval of previously submitted feedback when revisiting a turn.
- An admin dashboard card showing feedback counts.
- A full admin page with feedback details table, filtering, pagination, and CSV export.
Configuration
plugins:
- module: "codumentor.plugins.user_feedback"
class: "UserFeedbackPlugin"
args:
enabled: true
UI Placements
Message Actions (message-actions)
Custom element: x-user-feedback-actions
Behavior:
- Click like: stores immediately. Click again to undo.
- Click dislike: reveals an inline form with a comment input and an "Allow human review" checkbox. Click again (when already disliked) to undo.
- Send: submits the dislike with the optional comment and review consent.
- Cancel: hides the form without storing a dislike.
Admin Panel (admin-panel)
Custom element: x-feedback-admin-card
A summary card rendered on the /admin page showing total, likes, and dislikes counts. Clicking the card navigates to the full feedback admin page.
Admin Page (/plugins/user_feedback/admin)
Custom element: x-feedback-admin-page
A full page (requires admin access) with:
- Summary statistics (total / likes / dislikes).
- Filter dropdown (all / likes only / dislikes only).
- Paginated table showing: type, comment, conversation, turn/message, review consent, and timestamp.
- When
allow_reviewis true, the conversation ID links directly to the conversation (deep-linking to the specific turn when available). - CSV export button for downloading all feedback records.
API Endpoints
All endpoints are mounted under /ui/plugins/user_feedback.
User Endpoints
POST /feedback/{conversation_id}— Upsert feedback for a turn/message.feedback_type:like|dislike(required)turn_id: string (optional, preferred)assistant_message_id: string (optional fallback)comment: string (optional, max 2000 chars)allow_review: boolean (optional, defaults totrue)DELETE /feedback/{conversation_id}— Remove feedback for a turn/message.turn_id: string (optional)assistant_message_id: string (optional)GET /feedback/{conversation_id}/turns/{turn_id}— Fetch feedback for a specific turn.GET /feedback/{conversation_id}/messages/{assistant_message_id}— Fetch feedback for a specific assistant message.
Admin Endpoints (require admin:* permission)
GET /admin/summary— Aggregate counts (total,likes,dislikes).GET /admin/list?limit=&offset=&feedback_type=— Paginated feedback list with summary counts.GET /admin/export.csv?feedback_type=— Download all feedback as CSV.
Storage Model
Feedback is stored in a local SQLite database (user_feedback.sqlite3) keyed by:
conversation_id- user identity
- turn/message identity (
key_idderived fromturn_idorassistant_message_id)
Each record tracks:
feedback_type(like/dislike)comment(optional free text)allow_review(boolean, whether human review is consented)created_at/updated_attimestamps
Notes
- Dislike comments are optional by design.
- Re-submitting on the same turn updates existing feedback instead of creating duplicates.
- The
allow_reviewflag controls whether admins see a clickable link to the conversation in the admin page. Whenfalse, the conversation ID is shown as plain text.