description: "Per-message ratings and notes for finalized assistant messages, for users and maintainers choosing, composing, or debugging the feedback service."
English | 中文
dsh-message-feedback lets product surfaces offer per-message feedback: a user marks an assistant message positive or negative and can attach a short note, and the rating stays with that message. Ratings are stored with the session, survive restarts, and never enter model history or telemetry. Product surfaces read, create, and change ratings through the messageFeedback service, whose list, put, and delete operations are the whole surface. The one deployment setting is the maximum note length (maxNoteBytes), which the Web bundle sets to 8192. Browser controls live in a separate client package; this package provides the service itself.
Choose this service when a product surface should let users rate and annotate individual assistant messages. Feedback attaches only to a finalized message — one that has already been sent — and using the service never starts or resumes an agent. A custom app mounts the service together with session persistence and storage; the shipped Web bundle already composes all of it with maxNoteBytes: 8192.
| Field | Default | Meaning |
|---|---|---|
maxNoteBytes |
required | Maximum UTF-8 byte length accepted for one optional note. |
- id: message-feedback
name: '@deepseek-ai/dsh-message-feedback'
config:
maxNoteBytes: 8192
A note must contain at least one non-whitespace character and fit within the configured byte length; a blank note is rejected with note-blank and an oversized one with note-too-large. Accepted text is stored exactly as submitted — nothing is trimmed. The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc.
Callers use three operations to read and change feedback for a session:
| Operation | Request | Success | Rejected when |
|---|---|---|---|
list |
the session id | the current ratings and notes, in creation order | the session is not found |
put |
session, message, rating, optional note, expected version | the stored rating and note | session not found, message is not a valid target, version conflict, blank or oversized note |
delete |
session, message, expected version | the rating is absent | session not found, version conflict |
Every change must be based on the version the service returned for that rating: a change based on an older version is rejected with version-conflict, and the reply carries the current rating so the caller can see what changed without another read. Deleting a rating that is already absent succeeds, and concurrent changes to different messages do not conflict. An omitted note clears an existing note.
A rating attaches to one finalized assistant message: the message must exist and be an assistant message that was sent. User messages, empty assistant placeholders, and replaced messages are not valid targets and are rejected with target-not-found. Once recorded, the rating and note stay with that message and survive restarts; a fork of the session starts with no feedback.
A rating is committed only after the message it refers to is durably stored, so feedback never points at a message that can be lost. Reading or writing feedback never starts or resumes an agent; the service inspects the persisted session directly.
Read these pages when the package-level contract is not enough. They move from the subsystem types and design boundary to the persistence primitives and the browser consumer that drives this service.
inspect, readFrom, and flush semantics behind the durability barrier.Nothing. ctx.messageFeedback registers no tool, prompt section, model-facing context, or Session event; feedback stays in a Host-owned sidecar unless a separately documented Consumer explicitly exposes it.
Zero. No request, result, rating, note, timestamp, or failure from this package enters a model request.
Independent. Listing or mutating message feedback does not touch a model request prefix and cannot invalidate an otherwise reusable provider cache entry.
These limits define when the service is a poor fit or needs special operational care. They are current package constraints, not a task backlog.
session/disposed/api-session/removed mean detach rather than durable deletion. The service therefore retains empty rows and may leave orphan rows after out-of-band log removal instead of deleting valid feedback on detach.session-not-found; callers retry after retirement materialization.{createdAt, cwd} detects reuse only when those fields differ; a cloned log retaining the same header identity is indistinguishable.list/put/delete carry no authenticated actor or audit identity. A deployment must expose the Host gateway only through its trusted or separately authenticated boundary until authorization and attribution are added.maxNoteBytes bounds one note, but the item count and aggregate retained bytes of one Session row are not capped; an indexed metadata read and deployment-owned row bound remain deferred until a concrete consumer defines their policy.