google-gemini / google-gemini/gemini-cli
Surface or quarantine invalid Auto Memory inbox patches
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.