feat(agent): add silent scheduled task runs#983
Conversation
✅ Tests passed — 1223/1227
|
Greptile SummaryThis PR adds a "Run silently" toggle to scheduled tasks, letting users opt into a visible browser run instead of the existing hidden-page background mode. It also refactors
Confidence Score: 3/5The core silent/visible routing logic is sound, but the sync path will silently overwrite a user's visible-run preference on any remote update. The packages/browseros-agent/apps/agent/lib/schedules/syncSchedulesToBackend.ts — specifically the Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as NewScheduledTaskDialog
participant Storage as scheduledJobStorage
participant Runner as scheduledJobRuns
participant CS as ChatService
participant Browser as Browser.newPage
participant Server as AiSdkAgent / prompt.ts
UI->>Storage: save job (runSilently: true/false)
Runner->>Storage: read job on alarm fire
Runner->>CS: "getChatServerResponse({ runSilently })"
CS->>CS: "isScheduledTask && runSilently !== false?"
alt "Silent run (runSilently = true)"
CS->>Browser: newPage about:blank hidden:true
Browser->>Browser: cdp.Browser.createTab hidden:true
CS->>Server: buildSystemPrompt scheduledTaskRunSilently:true
Note over Server: Hidden-page constraints in prompt
else "Visible run (runSilently = false)"
CS->>CS: use provided browserContext as-is
CS->>Server: buildSystemPrompt scheduledTaskRunSilently:false
Note over Server: Visible-browsing guidance in prompt
end
|
|
Refinery rejected this merge request after CI gate. GitHub Tests / server-browser failed because the new tests/browser/browser.test.ts mocks @browseros/shared/constants/limits with only CONTENT_LIMITS, causing tests/browser/backends/cdp.test.ts to fail importing CDP_LIMITS from the mocked module. Source issue bosmain-445 has been reopened for rework; this branch is not merged. |
Fixes #447
Verification: