Skip to content

feat(schedules): per-schedule switch to keep runs out of the inbox and notifications - #475

Merged
chriswritescode-dev merged 1 commit into
mainfrom
feat/schedules-show-in-inbox
Oct 30, 2026
Merged

chriswritescode-dev merged 1 commit into
mainfrom
feat/schedules-show-in-inbox

Conversation

@chriswritescode-dev

@chriswritescode-dev chriswritescode-dev commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Schedules gain a "Show runs in inbox" switch, on by default. When it is off the schedule is quiet: its completed runs never enter the Reports inbox or the unread badge, and no "Session complete" push is sent.
  • Quiet runs still appear in the schedule's run history, the runs list and statistics, and their reports open normally.
  • Failed runs still surface: they stay unread in the inbox and the "Error" push for a session execution failure is unchanged.

Change

  • shared: showInInbox on ScheduleJobSchema, defaulting to true on create and optional on update.
  • Migration 202610271800-schedule-show-in-inbox adds schedule_jobs.show_in_inbox INTEGER NOT NULL DEFAULT 1, so existing schedules keep announcing.
  • db/schedules.ts: create and update persist the flag; updateScheduleRun stores a completed run of a quiet job with viewed_at = finished_at in the same UPDATE, so the unread queries and every consumer stay unchanged; isQuietScheduleRunSession resolves the latest run's job flag for a server-scoped session.
  • services/schedule-config.ts and services/schedules.ts carry the flag through the job lifecycle.
  • services/notification.ts: drops the session.idle push for a quiet session before the local/remote split, so remote servers are covered; session.execution.failed is unchanged.
  • frontend: "Show runs in inbox" switch in the schedule dialog's General tab, saved on create and edit; the job detail shows "Inbox: Every run | Failures only".
  • Assistant schedule docs describe the field and note that PATCH accepts it.

Validation

  • pnpm typecheck, pnpm lint: clean (41 pre-existing warnings, 0 errors)
  • pnpm test: cli 449 pass. Backend 4317 pass, 46 fail in test/auth/* and test/routes/auth.test.ts (stmt.columns is not a function in the better-auth Kysely adapter); reproduced on an unmodified origin/main checkout, so not caused by this branch. Frontend 4059 pass, 1 flaky PromptInput.stt.test.tsx case, also reproducible on unmodified origin/main.
  • Focused schedule run: schedule-show-in-inbox, schedule-migrations, schedule-config, schedules, notification-service, assistant-mode — all pass.

Notes

  • A quiet run that fails without a session.execution.failed event from OpenCode still sends no push; the run stays unread in the inbox. That gap and the session-scoped suppression are open follow-ups.
  • Real web push delivery with VAPID configured was not exercised; it remains a manual check.

Summary by CodeRabbit

  • New Features
    • Added a “Show runs in inbox” setting for scheduled jobs, enabled by default. Turn it off to keep successful runs out of the Reports inbox and suppress their completion notifications.
    • Failed runs still appear in the inbox and can send notifications. The setting is available when creating or editing a schedule and is shown in its execution settings.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 6d0c6e8d-6e25-4626-9a6b-993cd73e3846
Commits

Reviewing files that changed from the base of the PR and between 02bd0c0 and 65066ab.

Files selected for processing: 28
  • backend/src/db/migrations/202610271800-schedule-show-in-inbox.ts
  • backend/src/db/migrations/index.ts
  • backend/src/db/schedules.ts
  • backend/src/services/assistant-mode.ts
  • backend/src/services/notification.ts
  • backend/src/services/schedule-config.ts
  • backend/test/db/schedule-migrations.test.ts
  • backend/test/db/schedule-show-in-inbox.test.ts
  • backend/test/db/schedules.permission.test.ts
  • backend/test/db/schedules.test.ts
  • backend/test/services/git/GitService.real.test.ts
  • backend/test/services/notification-service.test.ts
  • backend/test/services/schedule-config.test.ts
  • backend/test/services/schedules-remote.test.ts
  • backend/test/services/schedules.permission.test.ts
  • backend/test/services/schedules.test.ts
  • frontend/src/components/schedules/GeneralTab.tsx
  • frontend/src/components/schedules/JobDetailTab.tsx
  • frontend/src/components/schedules/RepoSchedulesContent.test.tsx
  • frontend/src/components/schedules/ScheduleJobDialog.inbox.test.tsx
  • frontend/src/components/schedules/ScheduleJobDialog.mcp.test.tsx
  • frontend/src/components/schedules/ScheduleJobDialog.permissions.test.tsx
  • frontend/src/components/schedules/ScheduleJobDialog.sandbox.test.tsx
  • frontend/src/components/schedules/ScheduleJobDialog.serverTarget.test.tsx
  • frontend/src/components/schedules/ScheduleJobDialog.tsx
  • frontend/src/components/schedules/__tests__/schedule-utils.test.ts
  • frontend/src/components/schedules/schedule-utils.ts
  • shared/src/schemas/schedule.ts

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.

Walkthrough

Schedule jobs now have a showInInbox setting. The setting is configurable in the schedule dialog and persisted in the database. Completed runs for quiet jobs are marked viewed, and matching session-idle notifications are suppressed. Failed and cancelled runs remain unviewed.

Changes: Schedule inbox visibility

Layer / File(s) Summary
Setting contract and database migration
shared/src/schemas/schedule.ts, backend/src/db/migrations/*, backend/test/db/schedule-migrations.test.ts
Schedule schemas add showInInbox, defaulting to true for creation. A migration adds the database column with a default of 1.
Persist schedule settings
backend/src/services/schedule-config.ts, backend/src/db/schedules.ts, backend/test/db/schedule-show-in-inbox.test.ts, backend/test/db/schedules.test.ts, backend/test/services/schedule-config.test.ts, backend/test/services/schedules*.test.ts, backend/test/services/git/GitService.real.test.ts
Creation defaults the setting to true, and updates retain the existing value when the request omits it. Database queries persist and return the setting. Related test fixtures and assertions include the new field.
Quiet run completion and notification handling
backend/src/db/schedules.ts, backend/src/services/notification.ts, backend/src/services/assistant-mode.ts, backend/test/db/schedule-show-in-inbox.test.ts, backend/test/db/schedules.test.ts, backend/test/services/notification-service.test.ts
Completed runs for quiet jobs are stored as viewed. The notification service suppresses matching SESSION_IDLE events. Tests cover completion states, session lookup, and local and remote notifications.
Schedule dialog and job details
frontend/src/components/schedules/GeneralTab.tsx, frontend/src/components/schedules/ScheduleJobDialog.tsx, frontend/src/components/schedules/JobDetailTab.tsx, frontend/src/components/schedules/schedule-utils.ts, frontend/src/components/schedules/*test.tsx, frontend/src/components/schedules/__tests__/schedule-utils.test.ts
The dialog exposes the setting, defaults it to enabled, and submits it for new and existing jobs. Job details display the setting as “Every run” or “Failures only.”

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ScheduleJobDialog
  participant ScheduleConfig
  participant ScheduleDatabase
  participant NotificationService
  ScheduleJobDialog->>ScheduleConfig: Submit showInInbox setting
  ScheduleConfig->>ScheduleDatabase: Persist schedule setting
  ScheduleDatabase->>ScheduleDatabase: Mark completed quiet run as viewed
  NotificationService->>ScheduleDatabase: Check session for quiet schedule run
  ScheduleDatabase-->>NotificationService: Return quiet-run result
  NotificationService->>NotificationService: Suppress matching SESSION_IDLE event
Loading

Possibly related PRs

Merge Risk: Minimal · up to 65066

No actionable merge-blocking issue was found. Complete the normal checks before merging.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Inconclusive The description covers the template's Summary section with a clear explanation of the switch and its behavior. It also includes a Change section and a Validation section with test results. However, th… Add the 'Type of Change' section and select the applicable option (this appears to be 'New feature'). Add the 'Checklist' section from the template and mark each item that applies. Confirm the code style rules, the TypeScript types, the tes…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title "feat(schedules): per-schedule switch to keep runs out of the inbox and notifications" matches the main change. The diff adds a per-schedule showInInbox setting that keeps completed runs o…
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: Title check

Explanation

The title "feat(schedules): per-schedule switch to keep runs out of the inbox and notifications" matches the main change. The diff adds a per-schedule showInInbox setting that keeps completed runs out of the Reports inbox, unread badge, and completion push. It also follows a conventional commit style. The title does not mention the migration or the failure-run behavior, which is expected for a short title.

Full details: Docstring Coverage

Explanation

Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 28 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description covers the template's Summary section with a clear explanation of the switch and its behavior. It also includes a Change section and a Validation section with test results. However, the template's Type of Change section (checkbox list) and Checklist section are absent. The author does not indicate the change type, and the checklist items (style, types, test coverage, lint, typecheck) are not marked. The validation section does state that typecheck and lint passed, so some checklist information is present in prose.

Resolution

Add the 'Type of Change' section and select the applicable option (this appears to be 'New feature'). Add the 'Checklist' section from the template and mark each item that applies. Confirm the code style rules, the TypeScript types, the test coverage target, and that pnpm lint and pnpm typecheck pass. The Validation section already reports lint and typecheck results, so those items can be checked directly.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chriswritescode-dev
chriswritescode-dev merged commit af37ac3 into main Oct 30, 2026
2 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