Skip to content

Production harden smart reminders and medicine reminder framework #254

Description

@ucguy4u

Problem

The smart reminder / notification tool-planning framework is now merged to main, but it still needs a production hardening pass before we treat it as release-ready for long-term reminders such as medicine schedules, due-date reminders, family routines, and calendar sync.

The current framework keeps the LLM generic and routes deterministic behavior through app tools, which is the right direction. This ticket is for the next developer to take that merged foundation through platform validation, QA coverage, and release readiness.

Current State

Merged to main in commit 339ce7b.

Implemented foundation includes:

  • Generic schedule_notification planning path for chat-to-reminder requests.
  • Deterministic parser coverage for medicine, billing, family, habits, one-time, daily, interval, meal-relative, and repeat-until-done reminders.
  • Notification metadata for category, schedule type, completion requirement, follow-up policy, streaks, and points.
  • Calendar sync prompt after eligible reminders.
  • Focused agent-chat analyze/tests passing during merge.

Scope

In Scope

  • Production-harden smart reminders on both iOS and Android.
  • Validate notification permissions, scheduling, cancellation, and completion flows on real devices/simulators.
  • Validate medicine reminders without giving dosage or medical advice.
  • Validate due-date reminders that repeat until the user marks them done.
  • Validate calendar sync confirmation and rejection flows.
  • Add or update tests so future tool development can remain deterministic and low-change.
  • Add release/QA notes for the supported reminder patterns.

Out Of Scope

  • Medical advice, dosage recommendations, drug interaction checks, or clinical decision support.
  • EHR/doctor/pharmacy integrations.
  • Cloud sync for reminders.
  • A full medication adherence product beyond local reminders and completion tracking.

Acceptance Criteria

  • Chat prompt Remind me to take Minoxidil every 12 hours starting at 8am creates two daily medicine notifications at 08:00 and 20:00 with category medicine and schedule type interval_hours.
  • Chat prompt Remind me to take Metformin after breakfast and dinner creates meal-relative medicine reminders using deterministic app defaults, with no medical advice in the response.
  • Chat prompt Remind me to recharge my electricity bill tomorrow by tomorrow and keep asking until I do it creates a billing due-date reminder that repeats daily until completed.
  • Chat prompt Drop my children to tuition every day at four o clock creates a family daily reminder without overlapping calendar lookup behavior.
  • Check my schedule for today continues to route to calendar lookup, not reminder creation.
  • Calendar sync prompt appears only for eligible single reminders, not multi-notification medicine interval plans.
  • Confirming calendar sync creates the calendar event through the deterministic connector.
  • Rejecting calendar sync leaves only the Airo notification.
  • Notification inbox can mark completion and reflects completion/streak/points state without duplicating reminders.
  • Repeat-until-done reminders stop or reschedule according to follow_up_policy=daily_until_done after completion.
  • iOS notification permission, scheduled delivery, and calendar permission behavior are verified on simulator or real device.
  • Android notification permission, scheduled delivery, exact/inexact alarm behavior, and background delivery are verified on emulator or real device.
  • Focused tests pass: flutter analyze lib/features/agent_chat test/features/agent_chat and flutter test test/features/agent_chat.
  • At least one platform journey test or documented manual QA script exists for the end-to-end reminder flow.

Implementation Notes

Key files to inspect first:

  • app/lib/features/agent_chat/domain/services/reminder_request_parser.dart
  • app/lib/features/agent_chat/domain/services/agent_skill_orchestrator.dart
  • app/lib/features/agent_chat/data/connectors/notification_connector.dart
  • app/lib/features/agent_chat/data/services/agent_notification_scheduler.dart
  • app/lib/features/agent_chat/data/connectors/calendar_connector.dart
  • app/lib/features/agent_chat/presentation/screens/chat_screen.dart
  • app/lib/features/agent_chat/presentation/screens/notifications_screen.dart
  • app/test/features/agent_chat/domain/services/reminder_request_parser_test.dart
  • app/test/features/agent_chat/domain/services/agent_skill_orchestrator_test.dart

Recommended approach:

  1. Start with existing focused tests and add missing edge cases before platform changes.
  2. Keep the LLM prompt/tool contract generic; add deterministic app tools/parsers for new behavior.
  3. Avoid making medicine-specific LLM logic responsible for safety-critical interpretation.
  4. Treat platform permission and scheduling behavior as product-critical, not just technical setup.
  5. Document any OS limitations clearly in QA/release notes.

Agent

Main owner: agent/ai-llm

Secondary coordination likely needed from mobile/platform QA, but keep one main owner for board hygiene.

Estimate

2-3 focused engineering days, depending on real-device notification/calendar permission findings.

Risks

  • Notification delivery varies across iOS/Android permissions, power modes, and exact-alarm policy.
  • Medicine reminders must not imply medical advice or dosage validation.
  • Repeat-until-done can annoy users if completion and stop behavior is not reliable.
  • Calendar sync can duplicate events if confirmation state is not handled carefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/ai-llmAI/LLM Agent taskspriority/P1High - Important but not blockingsprint-1Sprint 1 - Foundationtype/taskImplementation task

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions