#26523·gemini-cli

Surface or quarantine invalid Auto Memory inbox patches

Author: SandyTao520Created May 5, 2026Updated Sep 17, 2026
Labelspriority/p2area/agent🔒 maintainer onlyworkstream-rollupstatus/bot-triagedkind/bug

Problem

The memory inbox silently skips invalid memory patches, including malformed patches, patches without hunks, and patches whose targets escape the allowed root. Aggregate dismiss also only removes valid patches. However, the background extractor's pending inbox summary reads every .patch file under the memory inbox and feeds that content back into future extraction prompts.

Relevant code:

  • packages/core/src/commands/memory.ts
  • packages/core/src/services/memoryService.ts

Impact

  • Invalid patch files can become invisible in /memory inbox.
  • Users cannot apply or dismiss those files from the UI.
  • Future extraction runs can still see the hidden invalid files and may keep trying to merge or reason about them.
  • The inbox can accumulate stale, non-actionable artifacts.

Expected Behavior

Invalid memory patches should be visible and dismissible, quarantined, or removed. The background extractor should not repeatedly receive hidden, non-actionable patch files as pending inbox context.

Acceptance Criteria

  • Malformed memory patches do not become invisible permanent artifacts.
  • Invalid patches are either:
    • surfaced in /memory inbox with a clear invalid state and dismiss action,
    • moved to a quarantine/diagnostics location, or
    • deleted consistently with invalid skill patch handling.
  • buildPendingInboxSummary only includes memory patches that are visible and actionable, or clearly marks invalid/quarantined items.
  • Tests cover malformed, no-hunk, and out-of-root memory patch files.

Notes

The current listing behavior is good in that users are not asked to apply unsafe patches. The missing piece is lifecycle management for patches that are filtered out.

Source: google-gemini/gemini-cli