feat(tui): allow backgrounding synchronous subagents (#30488)

This commit is contained in:
Kit Langton 2026-06-04 23:40:52 -04:00 committed by GitHub
commit 3003867c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 527 additions and 35 deletions

View file

@ -12,12 +12,13 @@ export const tmpdir = async () => {
}
}
async function remove(dir: string, retries = 10): Promise<void> {
async function remove(dir: string, retries = 30): Promise<void> {
try {
await fs.rm(dir, { recursive: true, force: true })
} catch (error) {
if (retries === 0 || !error || typeof error !== "object" || !("code" in error) || error.code !== "EBUSY")
throw error
Bun.gc(true)
await Bun.sleep(100)
return remove(dir, retries - 1)
}