Repository navigation
feat(schedules): per-schedule switch to keep runs out of the inbox and notifications - #475
Conversation
|
No actionable comments were generated in the recent review.
|
| 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:
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
Possibly related PRs
- chriswritescode-dev/opencode-manager#469: Adds per-job sandbox configuration to scheduled jobs and extends schedule configuration flows.
Merge Risk: 
Minimal · up to 65066
-
No actionable merge-blocking issue was found. Complete the normal checks before merging.
Pre-merge checks: 
3 · 
1 · 
1
-
Failed checks: 1 warning · 1 inconclusive Passed checks: 3 passed-
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
showInInboxsetting 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 lintandpnpm typecheckpass. 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.
Summary
Change
showInInboxonScheduleJobSchema, defaulting totrueon create and optional on update.202610271800-schedule-show-in-inboxaddsschedule_jobs.show_in_inbox INTEGER NOT NULL DEFAULT 1, so existing schedules keep announcing.db/schedules.ts: create and update persist the flag;updateScheduleRunstores a completed run of a quiet job withviewed_at = finished_atin the same UPDATE, so the unread queries and every consumer stay unchanged;isQuietScheduleRunSessionresolves the latest run's job flag for a server-scoped session.services/schedule-config.tsandservices/schedules.tscarry the flag through the job lifecycle.services/notification.ts: drops thesession.idlepush for a quiet session before the local/remote split, so remote servers are covered;session.execution.failedis unchanged.PATCHaccepts it.Validation
pnpm typecheck,pnpm lint: clean (41 pre-existing warnings, 0 errors)pnpm test: cli 449 pass. Backend 4317 pass, 46 fail intest/auth/*andtest/routes/auth.test.ts(stmt.columns is not a functionin the better-auth Kysely adapter); reproduced on an unmodifiedorigin/maincheckout, so not caused by this branch. Frontend 4059 pass, 1 flakyPromptInput.stt.test.tsxcase, also reproducible on unmodifiedorigin/main.Notes
session.execution.failedevent from OpenCode still sends no push; the run stays unread in the inbox. That gap and the session-scoped suppression are open follow-ups.Summary by CodeRabbit