openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Spawn colored sub-mascots for subagents and show their live thought/activity bubbles

Open senamakel opened this issue 7 months ago • 1 comments

[Feature] Spawn colored sub-mascots for subagents and show their live thought/activity bubbles

Summary

When the main mascot spawns subagents, the UI should spawn smaller companion mascots that visually represent those subagents.

Each sub-mascot should:

  • appear when a subagent is spawned
  • have its own color/identity
  • reflect whether it is active, finished, or failed
  • emit a small “thought” / activity bubble so the user can see what that subagent is currently doing

The result should make subagent orchestration feel visible and alive instead of hidden behind abstract cards or timeline rows.

Problem

Today the app already knows when subagents are spawned, completed, and failed, but that information is not integrated into the mascot experience.

What exists today:

  • the core emits subagent lifecycle events (SubagentSpawned, SubagentCompleted, SubagentFailed) in src/core/event_bus/events.rs
  • the web channel already streams subagent_spawned, subagent_completed, and subagent_failed events from src/openhuman/channels/providers/web.rs
  • the frontend already receives those events through app/src/services/chatService.ts
  • ChatRuntimeProvider already turns them into thread inference/timeline state in app/src/providers/ChatRuntimeProvider.tsx
  • the mascot UI already exists via app/src/features/human/useHumanMascot.ts and app/src/features/human/Mascot/**

What is missing:

  • subagent activity is still mostly abstract timeline state
  • the mascot has no concept of child/sub-mascots
  • users cannot visually understand which helpers are active, what they are working on, or whether they succeeded/failed
  • the “agent is delegating work behind the scenes” experience is still opaque even though the event stream already exists

This matters because subagents are one of the most interesting parts of the product. If the orchestrator spawns helpers, the UI should make that feel tangible. Small colored sub-mascots with lightweight thought/activity bubbles would make the delegation model much easier to understand and much more delightful.

Solution (optional)

Extend the mascot system so subagent lifecycle events create temporary child mascots around the main mascot.

Product shape:

  • when a subagent is spawned, create a small sub-mascot near the main mascot
  • assign each subagent a stable visual identity for that task lifecycle:
    • distinct color
    • optional label or tooltip
    • active / success / failed state treatment
  • show a compact thought/activity bubble that summarizes what the subagent is doing
  • remove, fade, or settle the sub-mascot when the task completes/fails

Suggested behavior:

  • subagent_spawned -> sub-mascot appears and animates into the scene
  • active/running -> sub-mascot shows a “thinking/working” state and a short activity bubble
  • subagent_completed -> sub-mascot resolves to success and gently fades or returns to idle
  • subagent_failed -> sub-mascot shows failure/error state and surfaces that clearly without breaking the main mascot

Thought/activity bubble content:

  • start with the streamed event message / subagent label already available in the frontend event payload
  • if richer live subagent progress exists or is added later, the sub-mascot system should be able to consume that too
  • bubbles should stay short and glanceable rather than turning into another full transcript pane

Scope expectations:

  • this is primarily an app/frontend experience feature
  • the design should reuse the existing subagent event stream before inventing a new backend protocol
  • if current event payloads are too thin for good activity bubbles, define the minimal extension needed rather than rebuilding the whole transport

Implementation note:

  • this should complement, not replace, the existing thread/timeline representation of subagents. The mascot view is a visual orchestration layer on top of the current chat runtime events.

Acceptance criteria

  • [ ] A sub-mascot appears when a subagent is spawned.

  • [ ] Multiple concurrent subagents can render as multiple sub-mascots.

  • [ ] Each sub-mascot has a visually distinct identity, such as a unique color.

  • [ ] Sub-mascots show a compact thought/activity bubble describing what they are doing.

  • [ ] Sub-mascots reflect running, completed, and failed states.

  • [ ] Sub-mascots resolve/exit cleanly when the corresponding subagent finishes.

  • [ ] The feature is driven from the existing subagent event stream wherever possible.

  • [ ] If additional event data is needed for better thought bubbles, that requirement is explicitly defined and kept minimal.

  • [ ] The mascot system remains performant and understandable even with several concurrent subagents.

  • [ ] Tests cover the key state transitions for spawned/completed/failed sub-mascots.

  • [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by .github/workflows/coverage.yml).

  • [ ] The feature is documented so contributors understand how subagent runtime events map to sub-mascot lifecycle/state.

Related

  • app/src/features/human/useHumanMascot.ts
  • app/src/features/human/Mascot/**
  • app/src/services/chatService.ts
  • app/src/providers/ChatRuntimeProvider.tsx
  • src/core/event_bus/events.rs
  • src/openhuman/channels/providers/web.rs

senamakel avatar May 03 '26 21:05 senamakel

I can take a focused MVP for this: render subagent lifecycle events as small colored sub-mascots around the existing mascot, with running/completed/failed states, compact activity bubbles from the existing event payloads, Vitest coverage for state transitions, and docs for the event-to-mascot lifecycle. I will avoid adding backend protocol unless the current event payloads are insufficient.

EvanWangZ avatar May 18 '26 11:05 EvanWangZ