Files
oh-my-opencode/src
cpkt9762 14c25cbbf5 feat(background-task): make taskCleanupDelayMs configurable
TASK_CLEANUP_DELAY_MS is the delay between a task reaching a terminal
state (completed/cancelled/errored) and its removal from the in-memory
task store. It is currently a hard-coded 10 minute constant, which is
too short for long-running background workflows: users routinely hit
'task not found' on background_output lookups when they inspect
results more than ~10 minutes after completion.

taskTtlMs (landed in #2825) already exposes the non-terminal task TTL
on BackgroundTaskConfigSchema. This PR mirrors that pattern for the
terminal-state cleanup delay:

- Add taskCleanupDelayMs: z.number().min(60000).optional() to
  BackgroundTaskConfigSchema with JSDoc matching taskTtlMs's style.
- BackgroundManager.scheduleCompletionRemoval() reads
  this.config?.taskCleanupDelayMs ?? TASK_CLEANUP_DELAY_MS, preserving
  the existing 10 min default for unconfigured users.
- Regenerate assets/oh-my-opencode.schema.json.

Default: 600000 ms (10 min, unchanged from current hard-coded value).
Minimum: 60000 ms (1 min).

bun run typecheck: clean.
bun test src/features/background-agent: 411/411 pass.
2026-04-08 21:45:01 +08:00
..