gemini-cli - 💡(How to fix) Fix Surface or quarantine invalid Auto Memory inbox patches [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26523Fetched 2026-05-06 06:35:48
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1parent_issue_added ×1

Fix Action

Fix / Workaround

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.

  • 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.

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.

RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

Modify the buildPendingInboxSummary function to filter out invalid memory patches and ensure that the memory inbox UI displays or quarantines them.

Guidance

  • Review the packages/core/src/services/memoryService.ts file to identify where invalid patches are being filtered out and modify the logic to either display them with an invalid state or move them to a quarantine location.
  • Update the buildPendingInboxSummary function in packages/core/src/commands/memory.ts to only include valid memory patches or clearly mark invalid ones.
  • Implement tests to cover different types of invalid memory patches, such as malformed, no-hunk, and out-of-root patches.
  • Consider adding a mechanism to periodically clean up stale, non-actionable artifacts from the memory inbox.

Example

No code example is provided as the issue does not contain specific code snippets that can be modified.

Notes

The current implementation prioritizes user safety by not displaying unsafe patches, but it lacks proper lifecycle management for invalid patches, leading to accumulation of stale artifacts.

Recommendation

Apply a workaround by modifying the buildPendingInboxSummary function and the memory inbox UI to handle invalid patches, as a more comprehensive solution would require significant changes to the existing codebase.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING