fix(schedules): submit scheduled runs via prompt_async with SSE monitoring (#335)

* fix(schedules): submit scheduled runs via prompt_async with SSE monitoring

* fix(session): use session directory for SSE and queries when it differs from repo path
This commit is contained in:
Chris Scott authored and GitHub committed 2026-08-10 10:42:35 -04:00
1 parent 1666d0de8f
commit cfe2031c04
15 files changed
+538 -199

No files matched your search

+7 -2
View File
@@ -31,6 +31,7 @@ export const DEFAULT_DESTRUCTIVE_BASH_PATTERNS = [
export const SchedulePermissionConfigSchema = z.object({
allowExternalDirectory: z.boolean().default(false),
allowQuestions: z.boolean().default(false),
bashDenyPatterns: z.array(z.string().min(1).max(200)).max(200)
.default([...DEFAULT_DESTRUCTIVE_BASH_PATTERNS]),
})
@@ -58,8 +59,9 @@ export type SchedulePermissionRuleset = SchedulePermissionRule[]
* `{ permission, pattern, action }` rules (`PermissionV1.Ruleset`), evaluated
* with last-match-wins semantics (see https://opencode.ai/docs/permissions).
* A leading `*`/`*` allow rule sets the allow-all baseline; the trailing
* `external_directory` and `bash` deny rules then override it for external
* directory access and matching destructive command patterns.
* `external_directory`, `question` and `bash` deny rules then override it for
* external directory access, agent questions that would block an unattended run
* with nobody to answer them, and matching destructive command patterns.
*/
export function buildSchedulePermissionRuleset(
config: SchedulePermissionConfig | null | undefined,
@@ -69,6 +71,9 @@ export function buildSchedulePermissionRuleset(
if (!cfg.allowExternalDirectory) {
ruleset.push({ permission: 'external_directory', pattern: '*', action: 'deny' })
}
if (!cfg.allowQuestions) {
ruleset.push({ permission: 'question', pattern: '*', action: 'deny' })
}
for (const pattern of cfg.bashDenyPatterns) {
ruleset.push({ permission: 'bash', pattern, action: 'deny' })
}