From 551f975886ce5da9628e7ad9db36169b9e4d80ee Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Wed, 17 Jun 2026 17:38:32 +0300 Subject: [PATCH] fix(collab): use '-' instead of ':' in agent page-history jobId BullMQ rejects custom job IDs containing ':' (Redis key separator), throwing "Custom Id cannot contain :" inside the onStoreDocument hook for every agent edit. This broke agent-driven page saves (MCP create_page runs as actor='agent') with HTTP 400. Switch the agent dedup suffix from `${page.id}:agent` to `${page.id}-agent`. The jobId is only used as a BullMQ dedup key and is never parsed by the history processor; page.id is a UUID, so the hyphenated id cannot collide with a human job whose id is a bare page.id. --- .../src/collaboration/extensions/persistence.extension.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/server/src/collaboration/extensions/persistence.extension.ts b/apps/server/src/collaboration/extensions/persistence.extension.ts index 81b8dced..af4137d6 100644 --- a/apps/server/src/collaboration/extensions/persistence.extension.ts +++ b/apps/server/src/collaboration/extensions/persistence.extension.ts @@ -324,7 +324,10 @@ export class PersistenceExtension implements Extension { : pageAge < HISTORY_FAST_THRESHOLD ? HISTORY_FAST_INTERVAL : HISTORY_INTERVAL; - const jobId = isAgent ? `${page.id}:agent` : page.id; + // BullMQ forbids ':' in custom job IDs (it is the Redis key separator), so + // use '-' here. page.id is a UUID, so `${page.id}-agent` cannot collide with + // any human job whose id is a bare page.id. + const jobId = isAgent ? `${page.id}-agent` : page.id; await this.historyQueue.add( QueueJob.PAGE_HISTORY,