Repository navigation
feat(conversation): add the chat data contract and its helpers - #113
Conversation
Add src/lib/conversation.ts, the message model and part union every chat component reads: a tool part carrying an approval record beside the call, parallel tool batches, generated images, sources, a streaming status, replies and reactions. It reuses the chat-parts.ts members unchanged. Add groupActivity and summarizeActivity to fold thinking and tool steps into one run, mediaKindOf, and checkAttachments for count, size and duplicate limits. Add the --attention-wash token, mixed from --primary.
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. Notes:
|
TheGreatAxios
left a comment
There was a problem hiding this comment.
Automated multi-agent review: each PR got an independent review, then a second agent re-verified every flag against the branch head; only two-agent-confirmed items are listed below. No blocking issues in this PR.
- minor
src/lib/conversation.ts:60-67— the approval id lives only insideToolApprovalRecord; the plan review asks to carryapprovalIdonPartToolTraceso a host can link a call to its own durable approval entity. Either add an optionalapprovalIdtoPartToolTraceor note the deviation in the PR body. - minor same lines —
timeoutAtis required-nullable vs the plan's optionaltimeoutAt?(arguably clearer; worth a note), andresolvedAtis absent though Interchange carries it — without it, "denied 2m ago" can't render from the record alone. Smallest fix: addresolvedAt?: string. - minor
src/lib/conversation-activity.ts:81-84—formatDurationhas no hours bucket: one hour of thinking renders "Thought for 60m 00s" (verified by running the helper). Add an hours case, or a regression test documenting the current output as intended. - nit
src/lib/attachment-limits.ts:27—identityreads cleaner asidentityOf/duplicateKeyOf. Mechanical rename.
summarizeActivity only knew seconds and minutes, so an hour of
thinking read "Thought for 60m 00s". Durations of an hour or more now
read as hours and minutes ("1h 30m"); shorter ones are unchanged.
4a3b9ae to
863187b
Compare
|
Thanks for the review. Here's what happened to each point. FixedAn hour of thinking showed as "Thought for 60m 00s" (minor)
Not changed, and why
Commit: |
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Approve
Adds the chat message model and the activity, attachment, and media-kind helpers.
Findings
No findings.
mediaKindOf let any video/* media type win over the extension. Servers and desktop browsers report a TypeScript file as an MPEG transport stream (video/mp2t, or video/vnd.dlna.mpeg-tts on Windows), since both use .ts, so index.ts read as video and previewed as a broken player. Those two types now defer to the extension, and stay video when the name has no known extension.
863187b to
0fb8583
Compare
Round 3 fixesA fresh review pass over the stack turned up the points below; each is fixed in a new commit at the end of this branch, and the stack is rebased onto it.
|
0fb8583 to
b98472e
Compare
Add src/lib/conversation.ts, the message model and part union every chat component reads: a tool part carrying an approval record beside the call, parallel tool batches, generated images, sources, a streaming status, replies and reactions. It reuses the chat-parts.ts members unchanged.
Add groupActivity and summarizeActivity to fold thinking and tool steps into one run, mediaKindOf, and checkAttachments for count, size and duplicate limits. Add the --attention-wash token, mixed from --primary.
First in the stack; targets
feat/conversation, which starts atmain(8300019). Part of #94.Notes for review
Verification
bun run typecheckandbun run linton its own (the stack is checked commit by commit).bun run check,bun run build,bun run dep-guard,bun run contrast-testandbun run test:e2e(Playwright specs and the Storybook axe sweep in light and dark) pass.Closes #95