mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
## Summary - Rewrites failed `morning_briefing` cron alert bodies to a concrete recovery message instead of the generic agent fallback. - Strips `<openhuman-link>` tags from cron alert bodies before they are persisted to the notification center. - Uses recent-notification dedupe for cron alerts so repeated identical failures do not spam the list. - Sanitizes notification card previews on the frontend so raw OpenHuman link markup is never rendered as text. ## Problem - Failed morning briefing runs stored the generic agent failure message directly in the notifications store. - That message is designed for chat bubbles and includes internal `<openhuman-link>` markup. - The notification center renders integration notification bodies as plain text, so users saw raw markup and a non-actionable error. ## Solution - Add a cron alert body formatter that detects the built-in morning briefing failure shape and replaces it with actionable copy. - Preserve normal successful briefing content, while stripping any OpenHuman link tags down to their visible label for notification previews. - Route cron notification persistence through the existing `insert_if_not_recent` dedupe helper. - Add frontend preview formatting plus component coverage for link-markup stripping. ## Submission Checklist - [x] Tests added or updated (happy path + at least one failure / edge case) per [Testing Strategy](../gitbooks/developing/testing-strategy.md#failure-path-requirement) - [x] **Diff coverage ≥ 80%** — local coverage run is blocked by missing libclang; CI coverage gate will verify changed lines. - [x] Coverage matrix updated — N/A: behavior-only cron/notification rendering fix, no feature row added/removed/renamed. - [x] All affected feature IDs from the matrix are listed in the PR description under `## Related` — N/A: no matrix feature ID changed. - [x] No new external network dependencies introduced (mock/local tests only) - [x] Manual smoke checklist updated if this touches release-cut surfaces ([`docs/RELEASE-MANUAL-SMOKE.md`](../docs/RELEASE-MANUAL-SMOKE.md)) — N/A: notification rendering copy only. - [x] Linked issue closed via `Closes #NNN` in the `## Related` section ## Impact - Runtime: cron alert persistence and notification center preview rendering. - User-visible: morning briefing failures now explain likely recovery steps; raw `<openhuman-link>` markup is hidden in notifications. - Compatibility: chat-facing generic agent fallback remains unchanged. ## Related - Closes #2279 - Follow-up PR(s)/TODOs: verify the final desktop notification flow on macOS build hardware once CI artifacts are available. --- ## AI Authored PR Metadata (required for Codex/Linear PRs) ### Linear Issue - Key: N/A - URL: N/A ### Commit & Branch - Branch: `codex/2279-morning-briefing-notifications` - Commit SHA: `513e41ccd39f483563460cf742246ab9850d1cfc` ### Validation Run - [x] `pnpm --filter openhuman-app exec prettier --check src/components/notifications/NotificationCard.tsx src/components/notifications/NotificationCard.test.tsx` passed. - [x] `pnpm typecheck` passed. - [x] `pnpm --filter openhuman-app test -- src/components/notifications/NotificationCard.test.tsx` passed. - [x] Rust fmt/check (if changed): `cargo fmt --all --check` passed. - [x] Focused Rust tests: blocked locally; see Validation Blocked. - [x] Tauri fmt/check (if changed): N/A: no Tauri shell changes. ### Validation Blocked - `command:` `cargo test --lib cron_alert_body --manifest-path Cargo.toml` - `error:` `whisper-rs-sys` build script could not find `clang.dll` / `libclang.dll`; `LIBCLANG_PATH` is unset in this Windows environment. - `impact:` focused Rust tests could not run locally, but the scheduler tests are included for CI. - `note:` full `pnpm --filter openhuman-app format:check` also reports pre-existing repo-wide Prettier drift; changed notification files pass targeted Prettier check. ### Behavior Changes - Intended behavior change: failed morning briefing cron alerts now use actionable notification copy and identical recent cron alerts are skipped. - User-visible effect: notification bodies do not show raw OpenHuman link markup. ### Parity Contract - Legacy behavior preserved: successful cron output still reaches proactive delivery and notification persistence; chat fallback message remains unchanged. - Guard/fallback/dispatch parity checks: unit tests cover morning briefing failure rewrite, link stripping, duplicate alert persistence, and frontend preview rendering. ### Duplicate / Superseded PR Handling - Duplicate PR(s): none found for #2279 at PR creation time. - Canonical PR: this PR. - Resolution (closed/superseded/updated): N/A <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Notification previews no longer show raw markup tags and now collapse whitespace, improving readability. * **Improvements** * Morning briefing failures display a clear, user-friendly failure message. * Repeated cron job alerts are deduplicated to reduce notification noise. * **Tests** * Added tests covering notification preview formatting, cron alert rewriting, and deduplication. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/tinyhumansai/openhuman/pull/2296?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: aqilaziz <gonzes7@gmail.com> Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
Tauri + React + Typescript
This template should help get you started developing with Tauri, React and Typescript in Vite.