Skip to content

fix(memory-core): drain L3 cascade during pipeline destroy - #1111

Open
Gout999 wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
Gout999:agent/fix-pipeline-destroy-l3-flush
Open

fix(memory-core): drain L3 cascade during pipeline destroy#1111
Gout999 wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
Gout999:agent/fix-pipeline-destroy-l3-flush

Conversation

@Gout999

@Gout999 Gout999 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep the destroy-time drain window open long enough for an already-accepted L2 task to enqueue its L3 persona cascade.
  • Drain the L2 queue before checking L3 idle, so an L3 task created by L2 cannot be missed by destroy().
  • Add a regression test that holds L3 open and verifies destroy() waits for it to finish.

Root cause

destroy() marks the pipeline as destroyed before flushing pending L2 timers. The L2 task still runs, but triggerL3() immediately returns because of the destroyed guard. In addition, _doFlush() checked L2 and L3 idle concurrently; an idle L3 check could resolve before L2 enqueued its cascade.

Fixes #1049.

Validation

  • Focused Vitest: vitest run src/utils/pipeline-manager.test.ts — 1/1 passed.
  • Focused TypeScript check with strict mode — passed.
  • git diff --check — passed.

Signed-off-by: Gout999 <gout999@users.noreply.github.com>
@Gout999
Gout999 marked this pull request as ready for review August 21, 2026 14:37
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you so much for your attention and contribution! We will arrange an internal review for this PR shortly, and all feedback will be shared right here in the discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] destroy flush runs L2 but suppresses its L3 cascade

2 participants