Commit 32b210e
feat: add ability to set frequency on automations running
* feat(api): add isDueToday scheduler helper
* test(api): use .spec.ts suffix and fix misleading test title
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(api): harden isDueToday exhaustive check and document UTC contract
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(db): add per-automation scheduleFrequency and lastRunAt
* refactor(api): remove stale schedule field from browserbase DTOs and update service
The BrowserAutomation.schedule column was dropped in the previous commit.
TypeScript did not catch the dangling DTO entries or updateBrowserAutomation
param because object spread does not trigger excess-property checks, but
Prisma would throw "Unknown argument" at runtime if a caller supplied the
field.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(api): respect integrationScheduleFrequency in integration orchestrator
* fix(api): retry integration task on transient execution error
Previously, integrationLastRunAt was written whenever the check loop
completed, even if one or more checks returned status='error' (meaning
the check could not execute). On weekly+ schedules this would push the
retry out a full period. Distinguish 'error' (infra issue, retry) from
'failed' (legitimate finding, ran successfully).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(api): respect scheduleFrequency in browser automation orchestrator
* docs(api): clarify browser orchestrator retry comment
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(api): accept scheduleFrequency in automation and task PATCH endpoints
* feat(app): add SchedulePicker component
* feat(app): add schedule picker to browser automation config
* feat(app): add schedule edit dialog for evidence automations
* feat(app): add integration schedule picker on task detail
* feat(app): show schedule summary on automation cards
* fix(app,api): repair test fixtures and guard missing schedule frequency
Updates test fixtures for Task schema additions (integrationScheduleFrequency,
integrationLastRunAt, previousStatus, archivedAt, lastCompletedAt),
adds TaskFrequency to the @db mock in browserbase.controller.spec so
the new @IsEnum(TaskFrequency) DTO decorator resolves at module load,
and fixes an undefined-index access in AutomationOverview when the
scheduleFrequency field is missing on stale client types.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style(api): apply prettier to SALE-49 files
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address cubic review findings on schedule UI and DTOs
- TaskIntegrationChecks: compute "Next run" from scheduleFrequency +
lastRunAt rather than hardcoding daily 6 AM UTC (was misleading for
non-daily schedules).
- Task response DTOs (swagger.dto.ts + task-responses.dto.ts): expose
integrationScheduleFrequency and integrationLastRunAt so API
consumers see them in generated documentation.
- ScheduleSummary: render locale-agnostic YYYY-MM-DD and anchor "now"
to UTC midnight to prevent server/client hydration mismatches.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(app): daily period is 1 day in TaskIntegrationChecks next-run calc
daily: 0 caused the "next run" display to always skip to tomorrow even
when the task was due today. Align with ScheduleSummary's PERIOD_DAYS map.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(api): include integrationScheduleFrequency in createTask response
The TaskResponseDto now declares integrationScheduleFrequency as a
required field; the createTask service method must populate it from
the persisted row to satisfy the contract.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(app): inline schedule picker on automation overview, render label not enum
Replaces EditScheduleDialog with an inline SchedulePicker on the
automation Settings tab — fewer clicks, no Dialog focus-trap quirks
when interacting with the DS Select. Also forces SelectValue to
render the human label (e.g. "Daily") rather than falling back to
the raw enum string when re-opened.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(app): metrics schedule + next-run reflect frequency in user's TZ
- MetricsSection now takes scheduleFrequency + lastRunAt and re-derives
the Schedule and Next Run labels per change.
- "Every day at 9:00 AM UTC" → "Every day at 4:00 AM EST" (or whatever
the user's locale resolves), and the same TZ is shown on Next Run for
consistency.
- Both labels are computed client-only to avoid SSR/CSR drift across
timezones; placeholder em-dash during SSR.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(app): use @trycompai/ui Select in SchedulePicker
The DS Select uses base-ui internals whose portaled popover fights with
the Radix-based Dialog focus trap (closes immediately on click in
BrowserAutomationConfigDialog). @trycompai/ui Select is Radix-based
like the Dialog, so the two co-operate. Same API shape so callers
don't change. Test mock updated accordingly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(app): show next-run as next tick (not now + period) when never run
For null lastRunAt the orchestrator's isDueToday short-circuits to true,
so the automation runs on the very next 09:00 UTC tick. The previous
math added a full period to "now", over-projecting a never-run weekly
automation a full week into the future.
Apply the same fix to ScheduleSummary on automation cards.
Also tighten the MetricsSection test's UTC-absence assertion to use a
word-boundary regex so it can't pass on a label that legitimately
contains "UTC".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Mariano <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8c37800 commit 32b210e
59 files changed
Lines changed: 2048 additions & 779 deletions
File tree
- apps
- api/src
- browserbase
- dto
- tasks
- automations
- dto
- dto
- schemas
- trigger
- browser-automation
- integration-platform
- app/src
- app/(app)/[orgId]/tasks
- [taskId]
- automations/[automationId]/overview/components
- automation/[automationId]/hooks
- components
- browser-automations
- hooks
- components
- components
- packages/db/prisma
- migrations/20260424164600_custom_task_schedules
- schema
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
| |||
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
76 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
| |||
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
20 | | - | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
356 | | - | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
366 | | - | |
367 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
| |||
402 | 408 | | |
403 | 409 | | |
404 | 410 | | |
405 | | - | |
406 | 411 | | |
| 412 | + | |
407 | 413 | | |
408 | 414 | | |
409 | | - | |
| 415 | + | |
410 | 416 | | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
416 | 422 | | |
| 423 | + | |
417 | 424 | | |
418 | 425 | | |
419 | 426 | | |
| |||
848 | 855 | | |
849 | 856 | | |
850 | 857 | | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
855 | 867 | | |
856 | 868 | | |
857 | 869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
94 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | | - | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
139 | 147 | | |
140 | 148 | | |
141 | 149 | | |
| |||
186 | 194 | | |
187 | 195 | | |
188 | 196 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 197 | | |
193 | 198 | | |
194 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
| |||
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
83 | 99 | | |
84 | 100 | | |
85 | 101 | | |
| |||
172 | 188 | | |
173 | 189 | | |
174 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
175 | 203 | | |
176 | 204 | | |
177 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
88 | 102 | | |
0 commit comments