feat(delegate-task): ⚙️ make sync subagent timeout configurable via syncPollTimeoutMs
Allow users to set `background_task.syncPollTimeoutMs` in config to override the default 10-minute sync subagent timeout. Affects sync task, sync continuation, and unstable agent task paths. Minimum value: 60000ms (1 minute). Co-authored-by: Wine Fox <fox@ling.plus>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ToolContextWithMetadata, OpencodeClient } from "./types"
|
||||
import type { SessionMessage } from "./executor-types"
|
||||
import { getTimingConfig } from "./timing"
|
||||
import { DEFAULT_SYNC_POLL_TIMEOUT_MS, getTimingConfig } from "./timing"
|
||||
import { log } from "../../shared/logger"
|
||||
import { normalizeSDKResponse } from "../../shared"
|
||||
|
||||
@@ -32,10 +32,11 @@ export async function pollSyncSession(
|
||||
toastManager: { removeTask: (id: string) => void } | null | undefined
|
||||
taskId: string | undefined
|
||||
anchorMessageCount?: number
|
||||
}
|
||||
},
|
||||
timeoutMs?: number
|
||||
): Promise<string | null> {
|
||||
const syncTiming = getTimingConfig()
|
||||
const maxPollTimeMs = Math.max(syncTiming.MAX_POLL_TIME_MS, 50)
|
||||
const maxPollTimeMs = Math.max(timeoutMs ?? DEFAULT_SYNC_POLL_TIMEOUT_MS, 50)
|
||||
const pollStart = Date.now()
|
||||
let pollCount = 0
|
||||
let timedOut = false
|
||||
|
||||
Reference in New Issue
Block a user