Repository navigation
fix(llc): show Company OS router notices as toasts via live events (#21045) - #21090
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
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. |
|
Code review (code-reviewer pass) at 47f2d1b Verdict: CHANGES (two should-fix items; nothing blocks the design) Checked: 0 behind main; 6 files; no failing checks; no inline review threads, one bot comment that only reports a rate limit.
Items 1 and 2 should be fixed in this PR; 3 and 4 are cheap to include. |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
…tice text, mount real layout in test (#21045)
|
Code review (code-reviewer pass) at f289270 Verdict: APPROVE. Delta reviewed: 032db6d and 0d5a91e (since 47f2d1b). 15 commits behind main.
|
|
Defect confirmed and fixed (ccd68fc). Wire shape: the router passes the producer fields as Fix ( Tests ( Other consumers: LlcSidebar and CompanyDashboard read only Backend: Not run locally; needs CI. |
mrveiss
left a comment
There was a problem hiding this comment.
Verdict: APPROVE @ ccd68fc
Delta reviewed: ccd68fc (composable + notices test only; the rest since e35c623 is main merges). Previous approval: e35c623.
Wire shape verified hop by hop: liveness_monitor.py:343-353 and budget_watchdog.py:236 publish to Redis; router.py _event_payload + :209 hand the producer fields to publisher.py:56-64, which builds the envelope; live_event_manager.py:150-155 sends it whole as payload. The router is the only producer onto company:{id} live channels, so every handled type (heartbeat_missed, budget., work_item.handoff, approval_, sprint_, generic) arrives nested; none arrives flat. noticeFields returns {} for a missing or non-object inner payload, so agent is '' and the NoAgent text is used.
| Severity | File:line | Finding | Fix |
|---|---|---|---|
| Low | useLlcCompanyNotices.ts:103-109 | Dedupe key is `type | agent, without reason. A second heartbeat_missed` with another reason for the same agent inside 30 s is merged. The test title says "agent and reason" but only covers agent. |
| Low | useLlcCompanyNotices.ts:53 | LlcEventEnvelope has no other definition in the frontend. Local placement is acceptable. |
Move to a shared types file if a second consumer appears. |
| Info | backend tests | test_notification_router.py checks only company_id/entity_id; the nested payload the frontend depends on is not pinned. |
Add an envelope contract test to #21338. |
Tests: wire() matches publisher.py field for field; asserts are on rendered text; the recovery and dedupe tests would fail pre-fix (agent '' gives the NoAgent text and one merged toast). No new i18n keys, no console.*, no any. Unresolved threads: 0.
Refs #21045
Thinking Path
Company OS router events are republished to the
company:{id}live channel, which every member receives, but nothing in the UI turned them into a notice. The unuseduseLLCNotifications.tswas a parallel transport with zero importers. The canonical path isuseLiveEvents().subscribe('company:{id}')and display throughuseNotificationBus(toasts).Single-issue rationale
One defect: router notices never reach a user. The new composable, its mount point, its strings, the removal of the dead parallel transport and the tests all belong to that one fix.
What Changed
useLlcCompanyNoticescomposable: mapsevent_typeto an i18n key and level, calls the notification bus.heartbeat_missedwarns (dedicated string forrecovery_unfiled);budget_warning_80/95warn;budget_exhaustedis a sticky error;agent_*,approval_*,sprint_*are info; unknown types use the generic string;heartbeat_okandllc:activity_createdare ignored. It re-subscribes on company change and unsubscribes on unmount.LlcCompanyLayout.vue(stays mounted across company routes).LlcSidebar.vueis untouched.llc.notices.*keys inen.json(English only).useLLCNotifications.ts(zero importers, no test imports).LlcCompanyLayout.notices.test.tsandrepo_tests/llc_notices_wired_21045_test.py.Owner decisions applied: replace and remove the old composable; show notices as toasts through the notification bus (budget exhaustion sticky); a persistent notification list is a separate feature.
Not delivered: AC3 (the in-app store), because
autobot_shared/store_authority.pyis held by #21027. The droppedllc:notifications:*budget and handoff notices are tracked in #21080. Recipient filtering is #20885 (the composable notes this).Verification
views/llc+components/llc: 70 files, 586 tests passed (5 new). Run locally with a temporary vitest config aliasingreka-uito a stub, becausereka-uiis not installed locally; that config was deleted and is not in the PR.Model Used
Claude Sonnet 5.5
🤖 Generated with Claude Code