openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Thread labels/categories for list organization (briefings, notifications, work, ...)

Open senamakel opened this issue 7 months ago • 2 comments

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 (Thread in app/src/types/thread.ts; ConversationThread / ConversationThreadSummary in src/openhuman/memory/conversations/types.rs and rpc_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_id patterns like proactive:… in src/openhuman/channels/proactive.rs, cron source cron:… on events) that could seed label assignment but are not surfaced as first-class thread metadata today.

Proposed model (for discussion)

  1. Label keys — Small, stable set of well-known labels (e.g. briefing, notification, work, onboarding, system) plus optional custom user labels later; store as Vec<String> or a single primary_label + tags[] depending on product.
  2. Source of truth — Core + workspace persistence (same place threads are stored under conversations/) so labels survive restart and work across clients; extend ConversationThread / summaries and thread_upsert / thread_create RPCs with optional labels (or category).
  3. Dynamic assignment
    • Cron / proactive: When a thread is created or first message is tied to cron:<job_id> or proactive:* / morning_briefing, set label briefing (or notification per product copy).
    • User-initiated default: work or general.
    • Rule table in one place (core helper) so new agents (welcome, help) map to known labels.
  4. User control — Thread list: chips or a sectioned list by label; optional “change label” in thread header / overflow (subject to product).
  5. Backfill — One-time or lazy migration: infer label from title / id prefix / first message extra_metadata where 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); app types 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 use notification (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 docs for 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_new
  • src/openhuman/memory/rpc_models.rs — ConversationThreadSummary
  • app/src/store/threadSlice.ts / app/src/types/thread.ts — client model + list UI entry points
  • src/openhuman/channels/proactive.rs — thread_id for proactive delivery (label inference)
  • Cron / morning briefing — src/openhuman/cron/seed.rs, job names

senamakel avatar Apr 26 '26 04:04 senamakel

@oxoxDev bro this was done ?

graycyrus avatar May 07 '26 11:05 graycyrus

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.

oxoxDev avatar May 07 '26 11:05 oxoxDev