feat(human): show subagent companion mascots
Summary
- Adds a
SubMascotLayeron the Human page that renders small colored companion mascots for live sub-agent timeline rows. - Maps existing subagent runtime states to mascot faces and compact activity bubbles: running/thinking, success/happy, and error/concerned.
- Reuses the existing
chatRuntime.toolTimelineByThreaddata fromChatRuntimeProvider; no new backend or socket protocol is introduced. - Adds focused Vitest coverage, capability catalog coverage, and contributor docs for the event-to-sub-mascot lifecycle.
Problem
Subagent lifecycle events already reach the frontend and update thread timeline state, but the Human mascot surface did not expose delegation visually. Users could miss which helpers were active, what they were doing, or whether they finished or failed unless they inspected timeline rows.
Solution
- Build sub-mascot view models from
ToolTimelineEntryrows whose names aresubagent:*and whose entries includeSubagentActivity. - Assign each subagent a stable color from its task/agent identity, cap visible sub-mascots at five, and position them around the main mascot.
- Prefer child tool call, iteration, prompt/detail excerpt, or terminal status for compact activity bubble text.
- Wire the layer into
HumanPageusing the selected or active thread timeline so spawned/completed/failed events resolve through the existing runtime path. - Document the lifecycle mapping in the frontend architecture guide and register the feature in the capability catalog and coverage matrix.
Submission Checklist
If a section does not apply to this change, mark the item as
N/Awith a one-line reason. Do not delete items.
- [x] Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
- [x] Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via
diff-cover) meet the gate enforced by.github/workflows/coverage.yml. Runpnpm test:coverageandpnpm test:rustlocally; PRs below 80% on changed lines will not merge. - [x] Coverage matrix updated — added/removed/renamed feature rows in
docs/TEST-COVERAGE-MATRIX.mdreflect this change (orN/A: behaviour-only change) - [x] All affected feature IDs from the matrix are listed in the PR description under
## Related - [x] No new external network dependencies introduced (mock backend used per Testing Strategy)
- [x] Manual smoke checklist updated if this touches release-cut surfaces (
docs/RELEASE-MANUAL-SMOKE.md) — N/A: Human page visual layer only, not a release-cut smoke surface. - [x] Linked issue closed via
Closes #NNNin the## Relatedsection
Impact
Desktop/web UI impact only: the Human page now shows a glanceable orchestration layer around the existing mascot when the selected or active thread has subagent timeline entries. Existing timeline rows remain the detailed source of truth. The layer caps visible sub-mascots to five to avoid crowding and does not add external network calls or persistence.
Related
- Closes #1140
- Feature ID: 4.3.4 Subagent Mascot Visualization
- Follow-up PR(s)/TODOs: none
AI Authored PR Metadata (required for Codex/Linear PRs)
Keep this section for AI-authored PRs. For human-only PRs, mark each field
N/A.
Linear Issue
- Key: N/A — GitHub issue #1140.
- URL: N/A — https://github.com/tinyhumansai/openhuman/issues/1140
Commit & Branch
- Branch:
codex/OH-1140-sub-mascots - Commit SHA:
4eacfe6f(48139a30contains the implementation;4eacfe6fis an empty CI retrigger commit after a transient cancelled Windows job.)
Validation Run
- [x]
pnpm --filter openhuman-app format:check - [x]
pnpm typecheck - [x] Focused tests:
pnpm --dir app exec vitest run src/features/human/SubMascotLayer.test.tsx src/features/human/HumanPage.test.tsx --config test/vitest.config.ts - [x] Frontend coverage:
pnpm test:coverage— 268 files passed, 1 skipped; 2612 tests passed, 3 skipped. - [x] Rust fmt/check (if changed):
cargo check --manifest-path Cargo.toml;cargo test --manifest-path Cargo.toml about_app --lib. - [x] Tauri fmt/check (if changed): N/A for source changes; pre-push still ran
cargo check --manifest-path app/src-tauri/Cargo.tomlafter initializing vendored submodules. - [x] Push hook:
git push -u fork codex/OH-1140-sub-mascotsand follow-upgit push fork codex/OH-1140-sub-mascotsran format, lint, compile, Tauri rust check, and command-token lint successfully.
Validation Blocked
command:node scripts/codex-pr-preflight.mjs --strict-path --lightweighterror:[FAIL] expected repo path :: expected /workspace/openhuman, got /home/ubuntu/workflow/openhuman-1140impact:No code validation impact. This branch was isolated in a separate worktree to avoid unrelated dirty changes in the main checkout; the preflight's required file, remote, branch naming, and changed-file checks passed.
Behavior Changes
- Intended behavior change: Human page renders colored sub-mascots for existing subagent timeline entries.
- User-visible effect: Users can see delegated subagents, their current activity, and terminal success/failure state around the main mascot.
Parity Contract
- Legacy behavior preserved: Existing
ChatRuntimeProviderevent handling and thread/tool timeline rows remain unchanged. - Guard/fallback/dispatch parity checks: Sub-mascots consume the existing selected/active thread timeline and render nothing when no subagent rows exist.
Duplicate / Superseded PR Handling
- Duplicate PR(s): none found for
Zavianx:codex/OH-1140-sub-mascots. - Canonical PR: this PR.
- Resolution (closed/superseded/updated): N/A.
Summary by CodeRabbit
Release Notes
-
New Features
- Subagent mascots now appear on the Human page as visual companions with activity bubbles displaying real-time status (running, completed, or failed).
-
Tests
- Added comprehensive test coverage for the new subagent mascot visualization feature.
-
Documentation
- Added architecture and test coverage documentation for the subagent mascot system.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5abb7735-9bab-4b5b-a543-8d2f521dc975
📥 Commits
Reviewing files that changed from the base of the PR and between 48139a30a0570c76cafa39d64e75f82140ebd27b and dcb03339f05ff7c202da1a89e5c0dcb4691e51ed.
📒 Files selected for processing (4)
app/src/features/human/HumanPage.tsxapp/src/features/human/SubMascotLayer.tsxdocs/TEST-COVERAGE-MATRIX.mdsrc/openhuman/about_app/catalog.rs
🚧 Files skipped from review as they are similar to previous changes (3)
- app/src/features/human/HumanPage.tsx
- src/openhuman/about_app/catalog.rs
- app/src/features/human/SubMascotLayer.tsx
📝 Walkthrough
Walkthrough
This PR adds SubMascotLayer: a UI layer that derives sub-mascot models from per-thread tool timelines, renders colored Ghosty sub-mascots with status-aware faces and activity bubbles, integrates into HumanPage, and includes unit and integration tests plus docs and capability registration.
Changes
Subagent Mascot Visualization
| Layer / File(s) | Summary |
|---|---|
SubMascotLayer component definition app/src/features/human/SubMascotLayer.tsx |
Adds constants, SubMascotModel/SubMascotLayerProps, hashing/color selection, activity text mapping, subMascotModelsFromTimeline, and SubMascotLayer component that renders Ghosty mascots with clamped activity bubbles and status-driven styling. |
SubMascotLayer unit tests app/src/features/human/SubMascotLayer.test.tsx |
Tests subMascotModelsFromTimeline filtering and face/activity derivation for running/success/error states; tests SubMascotLayer DOM output, data-status attributes, bubble text, and empty-render behavior. |
HumanPage integration app/src/features/human/HumanPage.tsx |
Selects current thread id and reads chatRuntime.toolTimelineByThread[threadId] (fallback EMPTY_TIMELINE); renders SubMascotLayer inside the mascot stage with the selected timeline entries. |
HumanPage test updates and integration test app/src/features/human/HumanPage.test.tsx |
Refactors test harness to use real chatRuntime, mascot, and thread reducers, enhances ./Mascot mock (Ghosty), allows injecting a preconfigured store, and adds a test that dispatches timeline/thread actions and asserts sub-mascot UI presence and text. |
Capability and documentation src/openhuman/about_app/catalog.rs, src/openhuman/about_app/catalog_tests.rs, docs/TEST-COVERAGE-MATRIX.md, gitbooks/developing/architecture/frontend.md |
Adds conversation.subagent_mascots capability (Beta) and test expectation; updates TEST-COVERAGE-MATRIX and adds "Human Mascot Surface" docs describing SubMascotLayer's mapping from ChatRuntime timelines to mascot visuals. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
#1520: HumanPage surface overlap — touches the same HumanPage rendering area; may conflict with or require coordination if HumanPage is migrated into a MascotChatPane.
Poem
🐰 Tiny paws and rounded ears,
Colored friends appear in tiers,
Bubbles whisper what they do,
Running, done, or error too—
Subagents dance, a playful crew.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title "feat(human): show subagent companion mascots" directly describes the main change—adding sub-mascots for subagents on the Human page, which aligns with the primary objective in the PR. |
| Linked Issues check | ✅ Passed | All core acceptance criteria from #1140 are met: sub-mascots spawn with distinct colors, show running/success/error states, display activity bubbles, reuse existing event streams, include comprehensive tests (127+ lines), and meet documentation requirements. |
| Out of Scope Changes check | ✅ Passed | All changes directly support subagent mascot visualization: new SubMascotLayer component, HumanPage integration, comprehensive tests, backend capability catalog entry, and documentation. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add
eslintto devDependencies.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.