From 84607bb113700c6274da7ae38bb322ee360be993 Mon Sep 17 00:00:00 2001 From: "cristiano.hoshikawa" Date: Mon, 10 Aug 2026 20:20:30 -0300 Subject: [PATCH] =?UTF-8?q?bugfix:=20Pubsub=20sequence.=20Em=20algumas=20s?= =?UTF-8?q?ituacoes,=20o=20MongoDB=20permite=20especificar=20a=20chave=20e?= =?UTF-8?q?m=20operacoes=20update,=20por=C3=A9m=20Autonomous=20nao=20e=20p?= =?UTF-8?q?ermissivo=20para=20esta=20e=20outras=20situacoes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/agent_framework/analytics/tim_sequence.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libs/agent_framework/src/agent_framework/analytics/tim_sequence.py b/libs/agent_framework/src/agent_framework/analytics/tim_sequence.py index 388e17b..48cc75e 100644 --- a/libs/agent_framework/src/agent_framework/analytics/tim_sequence.py +++ b/libs/agent_framework/src/agent_framework/analytics/tim_sequence.py @@ -175,6 +175,20 @@ def _next_sequence_mongodb_sync( now = datetime.now(timezone.utc) expires_at = now + timedelta(seconds=ttl_seconds) if ttl_seconds > 0 else None + # update: dict[str, Any] = { + # "$inc": {"sequence": 1}, + # "$set": { + # "agentId": agent_id or os.getenv("AGENT_NAME") or "agent", + # "sessionId": session_id, + # "transactionId": transaction_id, + # "sequenceScope": "transaction" if transaction_id else "session", + # "updatedAt": now, + # }, + # "$setOnInsert": { + # "_id": key, + # "createdAt": now, + # }, + # } update: dict[str, Any] = { "$inc": {"sequence": 1}, "$set": { @@ -185,7 +199,6 @@ def _next_sequence_mongodb_sync( "updatedAt": now, }, "$setOnInsert": { - "_id": key, "createdAt": now, }, }