Skip to content

Let BackgroundTaskObserver observe shutdown cancellation #3760

Description

@Widthdom

Found while dogfooding the locally built cdidx on branch codex/search-audit-issues-20260619.

Duplicate check: no open issue found for BackgroundTaskObserver shutdown cancellation Task.Run CancellationToken.None.

Evidence:

  • BackgroundTaskObserver observes background work via Task.Run using a non-shutdown cancellation token.

Problem:
Observer tasks should participate in process shutdown so cancellation, disposal, and test teardown do not depend on fire-and-forget scheduling behavior.

Acceptance criteria:

  • Thread an appropriate shutdown token into background observer scheduling.
  • Preserve existing exception observation behavior.
  • Add tests or teardown coverage proving observer work does not outlive shutdown unexpectedly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcodexenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions