Skip to content

fix(room): honest room_delete reporting across CLI/HTTP/MCP - #1179

Merged
ajianaz merged 1 commit into
developfrom
fix/room-delete-reporting
Sep 3, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/room-delete-reporting

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

What

  • delete_room() (store + facade) now returns the number of memory links removed by the cascade, instead of ()
  • DELETE /room/delete response becomes { deleted, unlinked_memories, note }
  • MCP uteke_room_delete reports the actual link count instead of a fixed claim
  • CLI room delete prints the count; --json output includes unlinked_memories
  • Fixed misleading registry description ("Delete a room and all its memories") and regenerated docs/api-reference.md via docgen

Why

Closes #1173. Incident on 2026-08-31 (room codecora-product): the Hermes tool called room_delete, all room memory links were removed by cascade, yet the tool replied "memories preserved" — while the API registry claimed the opposite ("and all its memories"). Both messages were wrong; the room-scoped memories became unreachable from any room path even though rows survive in the store. Forensics show core semantics were already unlink-only at HEAD and v0.13.x; the defect is reporting/documentation, not data handling.

Testing

  • cargo fmt + cargo clippy --workspace --all-targets clean
  • cargo test --workspace: 629 passed, 0 failed (incl. updated delete_room_success / delete_room_cascades_room_memories)
  • Live CLI smoke (scratch store): room with 2 memories → delete → reply "2 memory link(s) removed; memories are preserved"; all 3 test memories still searchable in store; room recall empty
  • Live HTTP smoke (uteke-serve, scratch store): DELETE /room/delete?room_id=... → {"deleted":"http-demo","unlinked_memories":1,"note":"..."}; memory still retrievable via POST /search
  • docgen regenerated and idempotent (no CI staleness)

…nlinked memories (#1173)

Incident (2026-08-31, room codecora-product): MCP room_delete wiped all
room memory links while the tool replied 'memories preserved' — and the
HTTP registry description claimed 'delete a room and all its memories'.
Both messages were wrong in opposite directions; from an agent's point
of view the room-scoped data became unreachable (memories survive in
the store but lose their only room access path).

Core delete_room() is and was unlink-only (ON DELETE CASCADE removes
room_memories/room_documents links only). This change makes every
surface tell the truth:

- store delete_room() now returns the number of removed memory links
- HTTP DELETE /room/delete responds { deleted, unlinked_memories, note }
- MCP uteke_room_delete reports the count instead of a fixed claim
- CLI room delete prints the count; --json includes unlinked_memories
- api_registry description fixed + docs/api-reference.md regenerated

Semantics stay unlink-only (consistent with CLI behavior all along);
no destructive purge path is added in this PR.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit bd2288c into develop Sep 3, 2026
16 checks passed
@ajianaz
ajianaz deleted the fix/room-delete-reporting branch September 3, 2026 14:53
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.

[tool] room_delete wipes room memories while reporting 'memories preserved' (inconsistent with CLI unlink behavior)

1 participant