Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: guard memory saves by loaded identity (#10494)

Adam Eivy23a3fbcb7281
diff --git a/client/src/components/cos/tabs/MemoryEditModal.jsx b/client/src/components/cos/tabs/MemoryEditModal.jsx
index 18c5a2555a..55926aa70a 100644
--- a/client/src/components/cos/tabs/MemoryEditModal.jsx
+++ b/client/src/components/cos/tabs/MemoryEditModal.jsx
@@ -56,6 +56,7 @@ export default function MemoryEditModal({ memory, apps, onSave, onClose }) {
const handleSubmit = async (e) => {
e.preventDefault();
+ if (saving || fullMemory?.id !== memory.id) return;
if (!formData.content.trim()) {
toast.error('Content is required');
return;
@@ -329,7 +330,7 @@ export default function MemoryEditModal({ memory, apps, onSave, onClose }) {
</button>
<button
type="submit"
- disabled={saving || !fullMemory || !formData.content.trim()}
+ disabled={saving || fullMemory?.id !== memory.id || !formData.content.trim()}
className="flex items-center justify-center gap-2 px-5 py-3 min-h-[44px] bg-port-accent/20 hover:bg-port-accent/30 text-port-accent rounded-lg text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<Save size={18} />
diff --git a/docs/API.md b/docs/API.md
index 290d15bac2..6e4de2d14b 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -318,10 +318,11 @@ Context tools remain read-only. Semantic reads and writes are independent, defau
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/memory` | List memories with filters |
-| GET | `/memory/:id` | Get single memory |
+| GET | `/memory/:id` | Get current memory, or local historical text with `?version=N` |
+| GET | `/memory/:id/versions` | List local history metadata; `limit` (default 20, max 100) and `offset` |
| POST | `/memory` | Create memory |
-| PUT | `/memory/:id` | Update memory |
-| DELETE | `/memory/:id` | Delete (soft) memory |
+| PUT | `/memory/:id` | Update memory; optional `expectedVersion` rejects stale edits with 409, `changeReason` and `changedBy` annotate history |
+| DELETE | `/memory/:id` | Archive; optional `reason` and `supersededBy` query fields retain retirement context; `hard=true` purges history too |
| POST | `/memory/search` | Semantic search |
| GET | `/memory/categories` | List categories |
| GET | `/memory/tags` | List tags |