Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.

## Unreleased

- Migration `0053_bot_scoped_memory_dedupe` rebuilds the Bot-memory dedupe index per Bot. A fact
one Bot remembered used to be swallowed as a duplicate when a second Bot formed it, leaving the
second Bot unable to recall it; each Bot now keeps its own row. The migration only rebuilds an
index and keeps every row.

**Before upgrading.** Two things change for an existing deployment:
- Migration `0052_shared_brokered_accounts` copies every Composio connection into a new
`brokered_connections` table and leaves `composio_connections` in place, unwritten. Rolling back to
Expand Down
2 changes: 2 additions & 0 deletions server/drizzle/0053_bot_scoped_memory_dedupe.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX "personal_memories_formed_digest_idx";--> statement-breakpoint

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stage the dedupe index change across releases

During a Helm upgrade, a new content digest routed to an old server replica will fail after this drop: the chart runs migrations as a pre-upgrade hook while old replicas still serve (charts/openbot/templates/migrations/job.yaml:24-26), and those replicas issue ON CONFLICT (owner_user_id, import_digest) .... PostgreSQL cannot infer that conflict target from the replacement three-column index, so the insert errors instead of saving the memory; an atomic rollback leaves every rolled-back replica incompatible because the DB migration is not reverted. Stage the conflict/index change across releases so the old target remains valid until old replicas are gone.

Useful? React with 👍 / 👎.

CREATE UNIQUE INDEX "personal_memories_formed_digest_idx" ON "personal_memories" USING btree ("owner_user_id","formed_by_agent_id","import_digest") WHERE "personal_memories"."formed_by" = 'bot';
Loading