Skip to content

Commit 4454819

Browse files
tahierhussainclaude
andcommitted
fix(backend): address PR review — drop debug print, mirror intent onto Chat
Removes a leftover debug print in process_message that flooded logs with every Redis stream payload (potentially exposing user prompts). Also restores the pre-PR behavior where Chat.chat_intent tracks the latest message's intent. _resolve_chat_intent now mirrors the persisted intent onto chat_message.chat as well, so the PastConversations badge (which reads chat.chat_intent_name from ChatSerializer) populates correctly for chats created after this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 360f4f0 commit 4454819

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backend/backend/application/context/llm_context.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def _resolve_chat_intent(self, chat_message_id: str, data: dict, content: Any) -
7878
chat_message = ChatMessage.objects.get(chat_message_id=chat_message_id)
7979
chat_message.chat_intent = chat_intent
8080
chat_message.save(update_fields=["chat_intent"])
81+
# Mirror the pre-PR behavior where Chat.chat_intent tracked the
82+
# latest message's intent (used by PastConversations badge).
83+
chat_message.chat.chat_intent = chat_intent
84+
chat_message.chat.save(update_fields=["chat_intent"])
8185
except Exception as e:
8286
logging.error(f"Failed to persist chat_intent={intent_name}: {e}")
8387

@@ -93,7 +97,6 @@ def process_message(
9397
discussion_status: str
9498
):
9599
data = json.loads(payload["data"])
96-
print("\n=============\n", data, "\n==========\n")
97100
if payload.get("type") == "status" and payload.get("status") == "failed":
98101
payload = json.loads(payload["data"])
99102
if payload and "error_message" in payload:

0 commit comments

Comments
 (0)