Skip to content

fix: report import step failures correctly (#1303)#1309

Merged
syzsunshine219 merged 2 commits intoMemTensor:mainfrom
CaralHsi:fix-1303-import-step-failures
Mar 23, 2026
Merged

fix: report import step failures correctly (#1303)#1309
syzsunshine219 merged 2 commits intoMemTensor:mainfrom
CaralHsi:fix-1303-import-step-failures

Conversation

@CaralHsi
Copy link
Collaborator

Description

The import/migration flow could report overall success (ok: true) even when non-fatal sub-steps failed on imported items (summarization/dedup/embedding), because these failures were only logged or silently ignored and never propagated to import state.

This PR keeps import behavior compatible (still stores raw memory when possible), but correctly reports step-level failures in migration state and final done payload:

  • Track per-item step failures (summarization, dedup, embedding) in item events.
  • Aggregate step failures in migration state (stepFailures) and compute success from both hard errors and step failures.
  • Final done/stopped SSE payload now includes full state and ok: false when any step fails.
  • migrate/status and replayed migrate/stream done events now surface this status consistently.
  • Added structured logs for successful full-step import vs partial-step failures.

Related Issue (Required): Fixes #1303

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Added apps/memos-local-openclaw/tests/migration-status.test.ts to verify:

  • import state is marked unsuccessful when step failures exist even without fatal errors;
  • clean path remains successful;
  • explicit item errors still produce failure.

Executed:

  • npm test -- tests/migration-status.test.ts (from apps/memos-local-openclaw)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@CaralHsi CaralHsi deleted the branch MemTensor:main March 23, 2026 06:02
@CaralHsi CaralHsi closed this Mar 23, 2026
@CaralHsi CaralHsi reopened this Mar 23, 2026
@CaralHsi CaralHsi changed the base branch from dev-20260319-v2.0.10 to dev-20260323-v2.0.11 March 23, 2026 06:46
@syzsunshine219 syzsunshine219 changed the base branch from dev-20260323-v2.0.11 to main March 23, 2026 12:40
@syzsunshine219 syzsunshine219 merged commit 95fb6d3 into MemTensor:main Mar 23, 2026
16 checks passed
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: Memory import reports success even when summarization / dedup / embedding steps fail

2 participants