SCAL-320648 mcp changes to support spotter model through tools - #197
Open
pradeepburugula wants to merge 1 commit into
Open
SCAL-320648 mcp changes to support spotter model through tools#197pradeepburugula wants to merge 1 commit into
pradeepburugula wants to merge 1 commit into
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
pradeepburugula
force-pushed
the
spotter-model-mcp
branch
3 times, most recently
from
August 6, 2026 10:34
a210f5a to
721d536
Compare
# Conflicts: # src/servers/mcp-server.ts # test/servers/mcp-server.spec.ts
pradeepburugula
force-pushed
the
spotter-model-mcp
branch
from
August 6, 2026 11:17
721d536 to
7d9c606
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new V3 tool surface ("Spotter Model") that lets an MCP client build a ThoughtSpot data model conversationally through the Lumos agentic backend. The agent plans, then auto-builds tables/joins/columns, and the model is saved as a worksheet — all driven by four new tools.
Branch
spotter-model-mcp(on forkpradeepburugula/mcp-server), rebased onto the latestmain(#195 cluster blocklist); one commit ahead.New tools
create_model_sessionmodel_session_id.send_model_messageget_model_updatessendwindow (e.g. the ~1–2 min auto-build).finalize_modelFlow:
create_model_session → send_model_message → get_model_updates (as needed) → finalize_model.Implementation notes
send_model_messageopens the Lumos SSE stream (surfacing auth/conn errors synchronously), consumes it in the background into a normalizedModelUpdatestream, and long-polls storage inline so short turns complete in one call.model-put/model-get) + an append-only, bookmarked update stream (model-append/model-updates) in the existingConversationStorageServerSQLiteDO — additive tables/routes, no new DO class or migration.transaction_id+generation_no(Lumos sends nochoice_id); generation threading coerces string→number and accumulates the working set; save requires the full working set.mrdupdate so a client won't finalize an unbuilt plan./prism/?op=WorksheetOperation), matching the modelling UI's Save. ASAVE_VIA_LUMOSenv flag (default off) routes save through Lumos instead — unverified end-to-end, gated intentionally.get_model_updates/senduse a ~60s server-side long-poll window, chosen to keep round-trips low without hitting the MCP connector's per-call timeout.latest(2026-07-31); the prior V2 date is now a pinned entry.Config
SAVE_VIA_LUMOS(default"false") — feature flag for the Lumos save path.Reviewer guide (suggested reading order)
src/servers/tool-definitions.tsModelUpdateshape. Read first for the contract.src/servers/mcp-server.tscall*handlers,consumeModelStreamToStorage(SSE→updates),pollModelUpdates,buildChoiceAnswer,advanceGeneration,looksLikeMrd,isSaveViaLumosEnabled.src/thoughtspot/thoughtspot-client.ts/chat/init(ChatInitV2),/chat/{id}/stream,mintSessionCookie; save via bach/prism(default) andsaveModelViaLumos(flagged).src/thoughtspot/thoughtspot-service.tssrc/thoughtspot/types.tsModelSessionState,ModelUpdate,ModelUpdatesState.src/servers/conversation-storage-server.tssrc/storage-service/storage-service.tsStorageServiceClientmethods calling the DO routes.src/servers/version-registry.tslatest(2026-07-31).wrangler.jsoncSAVE_VIA_LUMOSvar added.test/**Where to spend attention: streaming lifecycle + the ~60s window vs. connector timeout; choice binding & generation threading; the
looksLikeMrdheuristic; the default-vs-Lumos save path; DO stream concurrency.Testing
get_model_updates→ generation 2→3→4, producing a 7-table / 6-join / 50-column model → finalize review.main. No newtsc/biome errors beyond the repo baseline.