Skip to content

Surface or quarantine invalid Auto Memory inbox patches #26523

Description

@SandyTao520

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitykind/bugpriority/p2Important but can be addressed in a future release.status/bot-triagedworkstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions