fix(memory): report close-time pending work failures#100308
fix(memory): report close-time pending work failures#100308lin-hongkuan wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 7:53 AM ET / 11:53 UTC. Summary PR surface: Source +14, Tests +36. Total +50 across 3 files. Reproducibility: yes. at source level: current main's Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused logging helper change after the contributor adds redacted real shutdown or close-time log proof that the warning is emitted without changing close ordering. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main's Is this the best way to solve the issue? Yes: adding an optional helper callback and wiring the close path to log with the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0fc29969d960. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +14, Tests +36. Total +50 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
Fixes memory manager close-time diagnostics so rejected pending sync/provider initialization work is no longer swallowed silently.
Issue/Motivation
Fixes #96766.
awaitPendingManagerWorkpreviously caught and discarded errors from bothpendingSyncandpendingProviderInit. If shutdown races with a failed memory sync, SQLite/filesystem failure, or provider initialization failure, the close path could hide the failure completely.Changes
onErrorcallback toawaitPendingManagerWorkand invokes it for rejected pending sync/provider initialization promises.MemoryIndexManager.close()to log close-time pending-work failures with the existingformatErrorMessagehelper.Testing
node scripts/run-vitest.mjs run extensions/memory-core/src/memory/manager.async-search.test.ts— passed (6 tests)pnpm exec oxlint extensions/memory-core/src/memory/manager-async-state.ts extensions/memory-core/src/memory/manager.ts extensions/memory-core/src/memory/manager.async-search.test.ts— 0 warnings/errorspnpm exec oxfmt --check --threads=1 extensions/memory-core/src/memory/manager-async-state.ts extensions/memory-core/src/memory/manager.ts extensions/memory-core/src/memory/manager.async-search.test.ts— passedgit diff --check— passedWhat Problem This Solves
Close-time memory manager failures were invisible:
awaitPendingManagerWorkused emptycatch {}blocks for both pending sync and provider initialization. That made shutdown-time sync/provider failures indistinguishable from clean close and could hide data-loss or provider-init failures.Evidence
main:extensions/memory-core/src/memory/manager-async-state.tsstill had emptycatch {}blocks forpendingSyncandpendingProviderInitbefore this patch.onError, while resolved promises do not.node scripts/run-vitest.mjs run extensions/memory-core/src/memory/manager.async-search.test.ts→ 1 file passed, 6 tests passedpnpm exec oxlint ...→ Found 0 warnings and 0 errorspnpm exec oxfmt --check --threads=1 ...→ All matched files use the correct formatgit diff --check→ cleanNo live SQLite/disk-full shutdown fault was forced; the regression exercises the deterministic promise-rejection paths described by the issue.