From fd657ea422564bef3b8b5d00e8f0c4c6c522be6b Mon Sep 17 00:00:00 2001 From: Mourya Balabhadra Date: Fri, 13 Nov 2026 23:32:49 -0800 Subject: [PATCH 1/6] SCAL-352370: store the analytical session with each chat-history answer A ThoughtSpot analytical session belongs to the Org it was created in. After an Org switch the old session rejects new messages, so the agent opens a new one and later charts live there. The chat history kept one session id per chat, so on reopen those charts were looked up in the first session and came back wrong or not at all. - Tag every answer and Show work query with the session it was polled from, and let a newer create_analysis_session replace the stored one. - Store the session on each reply and each answer placeholder, plus how many questions the reply sent (ts_message_count). Number answers within their own session on reopen, so a session another Org cannot read keeps its placeholders and the SDK shows its notice instead of the app dropping them. - Pair replies with ThoughtSpot messages by that count instead of assuming one message per reply, which dropped charts when the agent retried within a reply. - Load Show work answers from the reply's session; reject sessions the chat never used. - Additive migration: new turns columns, older replies pinned once to the chat's session. Co-Authored-By: Claude Opus 5.5 --- mcp/python-react-agent-simple-ui/README.md | 32 +- .../client/src/App.tsx | 46 ++- ...th_spotter3_mcp_server_and_chat_history.py | 291 ++++++++++++++---- .../server/spotter3_core.py | 49 ++- 4 files changed, 322 insertions(+), 96 deletions(-) diff --git a/mcp/python-react-agent-simple-ui/README.md b/mcp/python-react-agent-simple-ui/README.md index 6bd4373..0a8d222 100644 --- a/mcp/python-react-agent-simple-ui/README.md +++ b/mcp/python-react-agent-simple-ui/README.md @@ -118,7 +118,7 @@ Then put an `