Share worker session setup and teardown between background jobs
The description and research workers repeated the same sandbox, credential and agent-session opening, including the abort race that destroys a late-arriving session, and the same session -> sandbox -> credential teardown chain. openWorkerSession now owns both. The description worker also races its sandbox opening against abort, which the research worker already did. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test unit passed: worker-session.test.ts covers teardown order, destroy failure, open failure, late session and late sandbox after abort, and a real just-bash sandbox Assistant-verification: mutation check passed: removing late-open destroy or credential release fails the helper tests Assistant-verification: bun test passed: 1611 pass, 2 skip, 0 fail Assistant-verification: bun run types passed: all workspaces and E2E Assistant-verification: bun run ci passed: dprint, oxlint, tokens Co-authored-by: Alex Lavaee <lavaman131@github.com>
Parent4cf49aa
4 files changed+232-56
StackedSplit