Skip to content

Delete single memories by id; rename forget_session to delete_session - #14

Merged
dani1005 merged 3 commits into
mainfrom
feat/delete-tools
Nov 16, 2026
Merged

dani1005 merged 3 commits into
mainfrom
feat/delete-tools

Conversation

@dani1005

@dani1005 dani1005 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What

  • New delete_memories tool over POST /api/v2/memory/delete_by_ids: up to 50 episode ids per call, always sent with the caller's user_id, so another user's id counts as not found. It reports how many were actually removed. The tool description says the profile is not updated right away.
  • list_memories / search_memory start each episode with its id, as [id ...], which is what delete_memories takes. The tool strips the brackets and an id: label if a model copies them along.
  • forget_session renamed to delete_session (title "Delete this conversation") to match the /delete and /delete_by_ids endpoints. The cloud connector has not been submitted to the directories yet, so this is the cheapest moment to rename.
  • Self-hosted: the upgrade hint now names EverOS 1.6.0, the first release with both endpoints. README says the same. A 503 SESSION_BUSY now replies "nothing was deleted, retry in a minute" instead of raising.
  • delete_by_ids always sends app_id/project_id. Self-hosted EverOS locates the files by them, and the cloud checks them as guards (evermind-everos-cloud!277), so an id from another app or project counts as not found.

Why

Tracked in everme-context#18: users need to delete individual memories through MCP. Both backends are ready: cloud since !263 added the user_id guard, and self-hosted since EverOS 1.6.0.

Verification

  • pytest: 102 passed. ruff check / ruff format --check: clean.
  • Live against EverOS Cloud: the ids show in list_memories. Delete works and is verified through both list and search. When user B passes user A's id, nothing is deleted and A's memory stays. A malformed id gets a clean "nothing was deleted".
  • Live against a local EverOS 1.6.0 server: the scoped and owner-guarded payload is accepted, a malformed id gets a clean reply, and delete_session works.

Merge order

Merge after evermind-everos-cloud!277 is deployed. Until then the cloud refuses app_id/project_id on delete_by_ids (422). Then re-run the live check against Cloud.

After merge

Release 0.2.0 (version bump + tag).

🤖 Generated with Claude Code

- New delete_memories tool over POST /api/v2/memory/delete_by_ids: up to
  50 episode ids, always guarded to the caller's user_id, reports how many
  were actually removed. A malformed id rejects the whole batch, which the
  tool reports as "nothing was deleted".
- list_memories and search_memory now show each episode's id.
- forget_session is renamed delete_session ("Delete this conversation"),
  matching the /delete and /delete_by_ids endpoints.
- Self-hosted: the upgrade hint names EverOS 1.6.0, the first release with
  both endpoints, and a 503 SESSION_BUSY now says to retry in a minute.
- The cloud's delete_by_ids takes no app_id/project_id (and rejects unknown
  fields), so the scope is only sent to self-hosted servers.

Verified live against EverOS Cloud (delete, owner guard, malformed id) and
a local EverOS 1.6.0 server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers; this can merge as far as I am concerned.

I reviewed the full origin/main...HEAD diff, the surrounding client/server/conversation code and callers, and the relevant history and PR release context. I found no repository-specific AGENTS.md, CLAUDE.md, or CONTEXT guidance files. I also checked backward compatibility (the forget_session rename is intentional before connector-directory submission), the cloud versus self-hosted wire contracts, per-user deletion guard, destructive tool annotations, session/save ordering, and that tests were expanded rather than weakened.

Verification: uv run pytest -q (102 passed), ruff check . (passed), and ruff format --check . (11 files already formatted).

…w-ups

- delete_by_ids always sends app_id and project_id. Self-hosted EverOS
  locates the files by them; the cloud now checks them as guards
  (evermind-everos-cloud!277), so an id from another app or project counts
  as not found. Until !277 is deployed the cloud refuses the two fields,
  so this merges after it.
- Episodes lead with a delimited "[id <id>]", so id-like text in the body
  can't pass for the real id.
- delete_memories strips the brackets and an "id:"/"id " label a model
  copies along, so a copied display value no longer rejects the batch.

From the review of the hosted server (evermemos-backend!602).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: deploy evermind-everos-cloud!277 and rerun the Cloud live check before merging.

The code delta itself looks sound: deletion is now guarded by user, app, and project on both backends, and the displayed-ID normalization is bounded to wrappers the tool itself emits. I found no code finding to mark inline. However, the PR explicitly records that the currently deployed Cloud rejects app_id/project_id on delete_by_ids with 422 until !277 is deployed. Because every hosted delete_memories call now sends those fields, merging before that prerequisite would break the new tool in ordinary Cloud use. This stance can be lifted once deployment and the requested live check are confirmed; no MCP code change is otherwise requested.

For this revision I rechecked repository guidance (none present), the full target diff and delta from my prior review, surrounding client/config/server callers and history, backward compatibility, test changes, and the identity/scope architecture. Tests were expanded, not weakened. Verification: uv run pytest -q (111 passed), ruff check . (passed), ruff format --check . (11 files already formatted); both GitHub CI jobs also pass.

…e line

delete_memories takes just the id from "ID:6af5", "[ID 6af5]" and a copied
whole line ("[id 6af5] [2026-...] ..."). Ids starting with "id" pass through.
From the review of the hosted server (evermemos-backend!602).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dani1005
dani1005 marked this pull request as draft November 12, 2026 05:37

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: confirm evermind-everos-cloud!277 is deployed and rerun the Cloud live check before merging.

The new copied-ID parser introduces no code finding: its label match is separator-bound, case-insensitive, and preserves legitimate IDs beginning with id. The existing deployment prerequisite is still explicitly present in the PR record, with no confirmation that it has completed.

At this fourth-round bar, the prerequisite remains blocking on all three required facts: this change introduces the always-scoped Cloud payload; every ordinary hosted delete_memories call reaches it; and while the deployed API returns 422 for those fields, an operator has no MCP-side workaround. Once deployment and the live check are confirmed, I have no remaining objection.

I rechecked the delta and full target diff, surrounding callers/history, backward compatibility, identity/scope architecture, repository guidance (none present), and that tests were expanded rather than weakened. Verification: uv run pytest -q (115 passed), ruff check . (passed), ruff format --check . (11 files already formatted); both GitHub CI jobs pass.

@dani1005
dani1005 marked this pull request as ready for review November 16, 2026 07:35
@dani1005

Copy link
Copy Markdown
Member Author

evermind-everos-cloud!277 is live in prod (release-20261102_v7/v8): delete_by_ids now accepts app_id/project_id. Live check against prod Cloud, run with the open-source server's branch, which sends the same payload:

  • user A in app x saves a memory; list_memories shows [id 6afab22212716ae9ce2025ec] …
  • the same user from app y deletes that id → nothing deleted (scope guard)
  • user B in app x deletes it → nothing deleted (owner guard); A still has it
  • A in app x passes the whole copied line ([id …] [2026-…] The User stated …) → Deleted 1 of 1; list is empty after
    Marking ready for review.

@gloryfromca

Copy link
Copy Markdown
Member

No blockers; this can merge as far as I am concerned.

Thanks — the production deployment plus the scope-guard, owner-guard, and copied-line deletion checks satisfy the prerequisite behind my blocker. I have no remaining objection on this revision.

Fresh verification: uv run pytest -q (115 passed), ruff check . (passed), and ruff format --check . (11 files already formatted).

@dani1005
dani1005 merged commit feaec33 into main Nov 16, 2026
2 checks passed
@dani1005
dani1005 deleted the feat/delete-tools branch November 16, 2026 22:13
@dani1005 dani1005 mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants