Skip to content

feat(routines): report runs in source conversations - #562

Merged
milind-soni merged 1 commit into
mainfrom
codex/routine-thread-delivery
Aug 29, 2026
Merged

feat(routines): report runs in source conversations#562
milind-soni merged 1 commit into
mainfrom
codex/routine-thread-delivery

Conversation

@milind-soni

@milind-soni milind-soni commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • remember the trusted conversation that created a routine while keeping every provider run isolated in its own task
  • upsert one compact lifecycle card in that source conversation for queued, running, input needed, completed, failed, cancelled, and missed states
  • route unread state and desktop alerts back to the source; Review opens the authoritative execution task for approvals or questions
  • preserve complete run history in Routines and expose grounded latest-run status to agents answering questions such as did it run
  • support bot tasks and channels, legacy routines without provenance, and deleted-source fallback without recreating orphan transcripts

Safety and behavior

Calendar/API callers cannot forge a source conversation. Lifecycle content is bounded and redacted before persistence. Replayed terminal events and marking failures seen do not re-mark the source unread.

Verification

  • pnpm typecheck
  • 249 focused routine, server integration, store, notification, routing, and component tests passed
  • full suite: 2319 tests passed; one steering timing test flaked in the combined run and passed immediately when rerun alone
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Routine activity now appears as status cards in bot and group conversations.
    • View completion summaries, failures, missed runs, and review requests directly from conversation history.
    • Open available routine execution details from the status card.
    • Routine updates and notifications are routed to the originating conversation.
    • Waiting routines now explain the required review action.
  • Bug Fixes

    • Notifications remain visible when another conversation is currently open.
    • Sensitive information is removed from routine names, summaries, errors, and status details.

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openmausbot-docs Ready Ready Preview Aug 29, 2026 1:27pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e088e2e-3583-4c27-a0ea-2b4c90af82bf

📥 Commits

Reviewing files that changed from the base of the PR and between 910822a and bce7ce5.

📒 Files selected for processing (18)
  • server/index.test.ts
  • server/index.ts
  • server/routine-requests.test.ts
  • server/routines.test.ts
  • server/routines.ts
  • server/store.test.ts
  • server/store.ts
  • shared/routine-run.ts
  • src/components/ChatView.tsx
  • src/components/GroupView.tsx
  • src/components/RoutineRunCard.test.ts
  • src/components/RoutineRunCard.tsx
  • src/lib/notify.test.ts
  • src/lib/notify.ts
  • src/lib/routines.ts
  • src/lib/taskTimeline.ts
  • src/state/store.test.ts
  • src/state/store.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Routine runs now retain source conversation provenance, synchronize redacted lifecycle cards, route notifications and unread state to the source conversation, expose latest run details, and render status cards in bot and group transcripts.

Changes

Routine lifecycle reporting

Layer / File(s) Summary
Routine provenance and lifecycle state
shared/routine-run.ts, server/routines.ts, server/routines.test.ts, server/routine-requests.test.ts, src/lib/routines.ts
Routine and run data now retain source threads, waiting attention, redacted runtime text, and lifecycle callbacks. Tests cover persistence, validation, run-now provenance, missed runs, and attention clearing.
Conversation lifecycle cards and agent reporting
server/index.ts, server/store.ts, server/index.test.ts, server/store.test.ts
Server callbacks now upsert routine.run cards in source conversations, route failure and completion state, expose latest run details, and prevent transcript recreation for deleted source tasks.
Routine card rendering and notification routing
src/components/RoutineRunCard.tsx, src/components/RoutineRunCard.test.ts, src/components/ChatView.tsx, src/components/GroupView.tsx, src/state/store.tsx, src/state/store.test.ts, src/lib/notify.ts, src/lib/notify.test.ts, src/lib/taskTimeline.ts
The client now renders routine lifecycle cards, gates run navigation on existing execution tasks, supports the new message kind, and suppresses notifications only when the exact target thread is visible.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: 🟡 Moderate · up to bce7c

Runs now publish lifecycle cards into source conversations, but some transitions can show a status before the underlying routine state is durably saved, leaving users with misleading run information after an interruption or save failure. Updates also depend on each producer applying redaction correctly. Merge should wait for explicit owner acceptance or follow-up on these bounded correctness and data-handling risks.

Sequence Diagram(s)

sequenceDiagram
  participant RoutineManager
  participant ServerIndex
  participant MessageStore
  participant ChatView
  participant NotificationSystem
  RoutineManager->>ServerIndex: emit routine run change
  ServerIndex->>MessageStore: upsert routine.run card in source conversation
  ServerIndex->>NotificationSystem: send source-thread notification
  MessageStore->>ChatView: deliver routine.run message
  ChatView->>RoutineManager: open execution thread when task exists
Loading

Suggested reviewers: willsigmon, aivsomkar

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and verification, but it does not follow the required template. It omits the explicit Why section, Screenshots section for the UI changes, and Checklist ite… Add the required What changed, Why, How it was verified, Screenshots, and Checklist sections. Include UI screenshots or state that they are not applicable, and mark each checklist item as completed or explain any exception.
Docstring Coverage ⚠️ Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: reporting routine runs in their source conversations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the implementation and verification, but it does not follow the required template. It omits the explicit Why section, Screenshots section for the UI changes, and Checklist items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/routine-thread-delivery

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@milind-soni
milind-soni merged commit d9f18a3 into main Aug 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant