openhuman
openhuman copied to clipboard
Thread labels/categories for list organization (briefings, notifications, work, ...)
Summary
Add labels (or tags / categories) on conversation threads so the UI can group, filter, and scan the thread list. Examples: Briefings (e.g. morning briefing cron), Notifications (proactive / app-pushed threads), Work (main working chats), Onboarding, etc. Labels should be set automatically when possible (cron source, proactive source, user-created) and allow user overrides where product allows.
Problem
- The thread list is a flat list of titles (
Threadinapp/src/types/thread.ts;ConversationThread/ConversationThreadSummaryinsrc/openhuman/memory/conversations/types.rsandrpc_models.rs) with no dimension for “what kind of conversation is this?”. - Product flows that are obviously different (scheduled briefing vs a focus work thread vs system proactive messages) all look the same, so users cannot organize or mute whole classes of threads.
- We already have hints in the product (e.g. proactive
thread_idpatterns likeproactive:…insrc/openhuman/channels/proactive.rs, cronsourcecron:…on events) that could seed label assignment but are not surfaced as first-class thread metadata today.
Proposed model (for discussion)
- Label keys — Small, stable set of well-known labels (e.g.
briefing,notification,work,onboarding,system) plus optional custom user labels later; store asVec<String>or a singleprimary_label+tags[]depending on product. - Source of truth — Core + workspace persistence (same place threads are stored under
conversations/) so labels survive restart and work across clients; extendConversationThread/ summaries andthread_upsert/thread_createRPCs with optionallabels(orcategory). - Dynamic assignment
- Cron / proactive: When a thread is created or first message is tied to
cron:<job_id>orproactive:*/morning_briefing, set labelbriefing(ornotificationper product copy). - User-initiated default:
workorgeneral. - Rule table in one place (core helper) so new agents (welcome, help) map to known labels.
- Cron / proactive: When a thread is created or first message is tied to
- User control — Thread list: chips or a sectioned list by label; optional “change label” in thread header / overflow (subject to product).
- Backfill — One-time or lazy migration: infer label from
title/idprefix / first messageextra_metadatawhere possible.
Non-goals (initial cut)
- Full Gmail-style user-defined label management with sharing — can be phase 2.
- Replacing thread titles — labels complement titles.
Acceptance criteria
- [ ] Schema + API — Thread records and
openhuman.threads_*(or equivalent) list/upsert responses include label(s);apptypes updated (app/src/types/thread.ts). - [ ] Persistence — New/updated threads store labels in workspace; existing threads get a sane default after migration or “uncategorized”.
- [ ] Automatic labels — At least: morning briefing / cron proactive path assigns
briefing(or agreed name); proactive in-app stream can usenotification(exact strings TBD in implementation). - [ ] UI — Thread list can group or filter by label (minimum: filter pill or sections); empty states per section if needed.
- [ ] Tests — Core unit test for label persistence + one Vitest for list rendering with mixed labels.
- [ ] Docs — Short note in architecture or
docsfor label vocabulary and how new features should register default labels.
Related code (starting points)
src/openhuman/memory/conversations/types.rs—ConversationThread(add fields)src/openhuman/threads/ops.rs—threads_list,thread_upsert,thread_create_newsrc/openhuman/memory/rpc_models.rs—ConversationThreadSummaryapp/src/store/threadSlice.ts/app/src/types/thread.ts— client model + list UI entry pointssrc/openhuman/channels/proactive.rs—thread_idfor proactive delivery (label inference)- Cron / morning briefing —
src/openhuman/cron/seed.rs, job names
@oxoxDev bro this was done ?
Yes, shipped via PR #947 (merge b11b8f33). Schema, persistence, auto-inference (briefing/notification), UI label tabs, core+vitest tests all in. Only missing piece is the docs note on label vocabulary.