Skip to content

fix: background subagent records are not removed when a session is deleted #1746

Open

Description

@sahrizvi

Found during the v0.12.11 release review of #1643 "fix(tool): run background subagents without blocking the parent when the flag is on". Deferred because it only affects long-running serve processes with the experimental flag on.

backgroundTasks and pendingLaunches in packages/opencode/src/tool/task.ts are module-level maps. Settled records are capped at 1,000, but nothing removes a session's records when the session is deleted, and unsettled records are never evicted, so a long-lived serve process keeps their result promises and output. Remove a session's records on session.deleted, and bound unsettled ones.

Activity

  1. self-assigned this
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions