Skip to content

ui-server: give clients the recorded attachment reads for a session's sent rows #3589

Closed

Description

@schlessera

Context

Part of #3150. Found while picking up #3155.

#3154 records each read_attachment call's outcome and scope in attachment_reads (migration 078). The decision record says it "drives #3155's sent-row status and never reaches a provider" (docs/decisions/chat-attachments.md, "What #3154 built"). Nothing delivers it to a client:

  • listAttachmentReads (packages/ui-server/src/attachments/store.ts:225-235) and the draft store's attachmentReads(sessionId) (packages/ui-server/src/drafts/store.ts:845-847, re-exported at packages/ui-server/src/drafts/writes.ts:41) have no caller in any route, WebSocket frame or history replay.
  • The SDK has the outcome vocabulary (AttachmentReadOutcome, packages/ui-sdk/src/tool-contracts/attachment.ts:26) but no client-facing shape for a recorded read.

#3155's acceptance criteria require sent rows to keep "not read yet, successful read of a stated scope, partial/truncated read, unavailable reader and failed content read" distinct, from the design's sent-row table (docs/plans/chat-attachments.md §8.4). Without this, a sent row can show only name, kind and size, and must not claim a read state.

Out of scope

The sent-row rendering and copy (#3155). The reader, its bounds and what it records (#3154). Anything that enters provider history: reads stay UI evidence only (provider history).

Scope

An additive, authorized way for a client to get the recorded reads of the session it is viewing, and to learn of a new read without a reload.

Acceptance criteria

  • A client viewing a session gets, for each original that session's messages name, its recorded reads (outcome and scope, no text), only under the existing session/principal authorization: another principal's or another session's reads are never returned.
  • A read recorded during a live turn reaches a connected client viewing that session without a reload.
  • The shape is additive and documented in the contract; a host without it is detectable, so a client shows no read state rather than a wrong one.
  • Nothing about reads enters the provider-facing conversation; the keyless provider-history guards for both backends stay green on the affected paths.

Verification

Route or frame tests through bun run test covering the authorization boundary (another session, another principal) and a live read reaching the client, with a mutation dropping the session filter failing the boundary test. bun run check:pr --base origin/epic/3150-attachments.

Contract impact

Additive: a new HTTP route or WebSocket field, documented in docs/integration-contract/ in the same commit, with the contract label, CONTRACT: commits and a minor changeset. The concrete route or frame is the implementer's choice within those rules.

Activity

  1. added this to the 0.45.0 milestone on Nov 4, 2026
  2. added
    type: featA new capability or a change in user-visible behaviour.
    area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    contractTouches the integration contract: CONTRACT: commit, contract doc updated in the same commit.
    on Nov 4, 2026
  3. self-assigned this
    on Nov 4, 2026
  4. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Claiming for implementation (claim token orch-3589-a1). Branch: feat/3589-attachment-reads, PR against epic/3150-attachments.

    Collision report: path collision on packages/ui-sdk/src/protocol.ts with draft #3582 (unrelated Apify contract work); closure-only reports otherwise.

  5. schlessera commented on Nov 6, 2026

    @schlessera
    OwnerAuthor

    2026-11-06 readiness check: the citations still point at what the issue claims, but two have moved since it was filed. On epic/3150-attachments at 0ec44c466, after #3593 grew the draft store:

    • listAttachmentReads is at packages/ui-server/src/attachments/store.ts:230-240 (was :225-235).
    • The draft store's attachmentReads(sessionId) is at packages/ui-server/src/drafts/store.ts:981-983 (was :845-847).

    drafts/writes.ts:41 and AttachmentReadOutcome (tool-contracts/attachment.ts:26) are unchanged. Neither is a scope change.

  6. 1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.contractTouches the integration contract: CONTRACT: commit, contract doc updated in the same commit.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: featA new capability or a change in user-visible behaviour.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions