Skip to content

SCAL-322108: Enable chat history support for MCP server#172

Open
mouryabalabhadra wants to merge 4 commits into
mainfrom
SCAL-322108
Open

SCAL-322108: Enable chat history support for MCP server#172
mouryabalabhadra wants to merge 4 commits into
mainfrom
SCAL-322108

Conversation

@mouryabalabhadra

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the showSpotterPastConversations tenant flag and refactors how data source discovery (auto mode) is handled when creating agent conversations. Specifically, it updates the MCP server, ThoughtSpot client, and ThoughtSpot service to pass these flags downstream, validates that auto mode is enabled when no explicit data source is provided, and adds comprehensive integration and unit tests. Feedback suggests simplifying the redundant string conversion of showSpotterPastConversations to a direct boolean cast.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/servers/mcp-server.ts Outdated
Comment thread src/thoughtspot/thoughtspot-client.ts Outdated
) {
(client as any).createAgentConversationWithAutoMode = async ({
dataSourceId,
showSpotterPastConversations,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer naming this flag saveChatEnabled in all function headers instead of showSpotterPastConversations

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sure

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Done in commit Rename showSpotterPastConversations to saveChatEnabled in function headers. Renamed showSpotterPastConversationssaveChatEnabled across all function headers in thoughtspot-client.ts, thoughtspot-service.ts, types.ts, and mcp-server.ts. The raw ThoughtSpot API response field (info.configInfo?.showSpotterPastConversations) is preserved when mapping to the internal saveChatEnabled property.

Comment thread src/servers/mcp-server.ts Outdated
const allowlist = rawAllowlist
.split(",")
.map((id) => id.trim())
.filter(Boolean);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need to filter? Shouldn't all clusters in the allow list be "true"?

@mouryabalabhadra mouryabalabhadra Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just eliminates any accidental blank strings but we can remove it

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removed .filter(Boolean) in the same commit. Note that the if (!clusterId) guard ensures the cluster ID is always a non-empty truthy value before the allowlist check, so empty strings in the allowlist can never produce a false positive match.

@mouryabalabhadra

Copy link
Copy Markdown
Collaborator Author

@copilot review the pr

…aders; remove filter(Boolean) from allowlist

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown

@copilot review the pr

Reviewed. The changes look good overall — the gating logic for isSpotterChatHistoryEnabled() is clear and correct, and the saveChatEnabled flag flows properly through the call chain. One automated check flagged removing .filter(Boolean) as a potential security concern, but this is a false positive since clusterId is already validated to be truthy before the allowlist check, preventing any empty-string match. No other issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants