feat(messages): AI suggested replies (LC-548) #518
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-548-suggest-reply"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
LC-548: AI suggested replies (Round 4, Vein B - next-gen AI)
A "Suggest reply" action on a received message drafts 2-3 tappable reply chips and drops the tapped one into the composer. Never auto-sent. Second action mode of the existing composer-LLM path (LC-532), so it reuses the same panel slot and apply/dismiss handlers.
How it works
POST /messages/{id}/suggest-reply: gate on a configured LLM, enforce room access, assemble a short window of recent top-level turns ending at the target message (labelled by display name, system/empty turns skipped, bounded), and ask the operator model for a few short candidate replies from the viewer's point of view.parse_suggestionsturns the raw completion into clean chips: one per line, ordered/bullet list markers and a surrounding quote pair stripped, blanks dropped, deduped, capped at 3, over-long lines skipped.[data-lc-llm]exactly like Translate, and hidden on your own / synthetic-actor messages (you reply to others, not yourself).#composer-ai-panel. Each chip is its owndata-lc-ai-applybutton carrying its full draft in a[data-lc-ai-suggestion]span; the sharedlive.jshandler now prefers the chip-local suggestion and still falls back to the single-suggestion LC-532 assistant.Trust / privacy posture
Same as
compose_assistandsummary: onecomplete()call, gated on an LLM being configured, room access enforced. Chat text leaves the device only on an explicit tap and only when an operator LLM is set. When no LLM is configured the endpoint 400s and the menu item is CSS-hidden.Tests
parse_suggestions/strip_list_marker(list markers, quotes, dedup, cap, blanks) - run in CI (lib).routes_suggest_reply.rs: happy-path chips with markers stripped and per-chip suggestion spans, 404 on a missing message, 400 with no LLM.Gates:
just check, fulljust test,just test-saasall green.🤖 Generated with Claude Code
https://claude.ai/code/session_01S5obszLoUgUi8qaF7Hi5qz
Add POST /messages/{id}/suggest-reply: gate on a configured LLM, enforce room access, assemble a short window of recent top-level turns ending at the target message, and ask the operator model for 2-3 short candidate replies from the viewer's point of view. parse_suggestions turns the raw completion into clean chips (one per line, list markers and surrounding quotes stripped, blanks dropped, deduped, capped). Same trust posture as compose_assist / summary: one complete() call, chat text leaves the device only on an explicit tap and only when an LLM is configured. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5obszLoUgUi8qaF7Hi5qzDrive /messages/{id}/suggest-reply over HTTP with a mock LLM: the happy path returns tappable chips with list markers stripped and per-chip data-lc-ai-suggestion spans; a missing message is 404; and with no LLM configured the endpoint 400s so room text is never forwarded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5obszLoUgUi8qaF7Hi5qz