Skip to content

🐛 fix(userMemories): missing cancel webhook api for cascading cancellation#13742

Merged
nekomeowww merged 2 commits into
canaryfrom
neko/dev/memory-cascading-cancel
Apr 11, 2026
Merged

🐛 fix(userMemories): missing cancel webhook api for cascading cancellation#13742
nekomeowww merged 2 commits into
canaryfrom
neko/dev/memory-cascading-cancel

Conversation

@nekomeowww

Copy link
Copy Markdown
Member

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

🔀 Description of Change

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

Before After
... ...

📝 Additional Information

@vercel

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 11, 2026 7:44pm

Request Review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@codecov

codecov Bot commented Apr 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.74194% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.56%. Comparing base (5613935) to head (aa44b8f).
⚠️ Report is 3 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff            @@
##           canary   #13742     +/-   ##
=========================================
  Coverage   66.56%   66.56%             
=========================================
  Files        2020     2020             
  Lines      171174   171203     +29     
  Branches    16641    20675   +4034     
=========================================
+ Hits       113941   113964     +23     
- Misses      57109    57115      +6     
  Partials      124      124             
Flag Coverage Δ
app 58.61% <100.00%> (+<0.01%) ⬆️
database 92.49% <50.00%> (-0.07%) ⬇️
packages/agent-runtime 79.72% <ø> (ø)
packages/context-engine 83.33% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.86% <ø> (ø)
packages/model-runtime 84.30% <ø> (ø)
packages/prompts 69.24% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.14% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 65.70% <ø> (ø)
Services 52.19% <ø> (ø)
Server 66.31% <100.00%> (+0.01%) ⬆️
Libs 52.83% <ø> (ø)
Utils 91.01% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bab5349d3d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +113 to +115
metadata: nextMetadata,
status: AsyncTaskStatus.Error,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep cancelled tasks terminal during in-flight completions

This handler writes status: Error once, but topic workers that were already running still call incrementUserMemoryExtractionProgress in src/server/services/memory/userMemory/extract.ts, which unconditionally rewrites status to processing or success. If cancellation arrives mid-topic, the task can leave the cancelled state and look active/completed again, so cancellation is not durable.

Useful? React with 👍 / 👎.

Comment on lines +107 to +110
const asyncTaskModel = new AsyncTaskModel(db, task.userId);
await asyncTaskModel.update(task.id, {
error: new AsyncTaskError(
AsyncTaskErrorType.TaskCancelled,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject cancellation for tasks that are already finished

The route updates any matching task to TaskCancelled without first verifying it is still pending/processing. A delayed or retried cancel webhook can therefore overwrite a previously success (or already failed) task into cancelled, which corrupts task history and misreports state to clients.

Useful? React with 👍 / 👎.

@nekomeowww nekomeowww merged commit e0f97c4 into canary Apr 11, 2026
33 of 34 checks passed
@nekomeowww nekomeowww deleted the neko/dev/memory-cascading-cancel branch April 11, 2026 20:35
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.

1 participant