Add Gmail thread ID to queries, harden cache validation, and clean up API layer#104
Merged
Add Gmail thread ID to queries, harden cache validation, and clean up API layer#104
Conversation
… API layer 1. Gmail Thread ID (source_conversation_id) in query layer: - Add SourceConversationID to MessageSummary and MessageDetail - DuckDB joins conversations parquet; SQLite joins conversations table - Export conversations to Parquet (including Windows CSV fallback) - MCP tools now return source_conversation_id 2. Cache validation hardening: - Shared RequiredParquetDirs for cache builder, TUI, and MCP startup - HasCompleteParquetData checks all required tables, not just messages - missingRequiredParquet detects partial caches and triggers rebuild - buildCacheMu mutex prevents concurrent cache writes - maxID > 0 gate avoids rebuild loops for zero-message accounts - +482 lines of cache edge-case tests 3. Remove dead config and eliminate DTO duplication: - Remove unused server.mcp_enabled config field - Replace duplicate API structs with type aliases to store/scheduler - Collapse ~80 lines of adapter boilerplate to pass-throughs - Add backward-compat test for old configs with mcp_enabled Co-Authored-By: Rob Elkin <[email protected]> Co-Authored-By: Claude Opus 4.6 <[email protected]>
cff1256 to
c934a99
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
This started as adding Gmail thread IDs to MCP responses but grew to include cache validation hardening and API cleanup that came up along the way.
1. Gmail Thread ID (
source_conversation_id) in query layerSourceConversationIDfield toMessageSummaryandMessageDetailmodelsconversationsparquet table; SQLite engine joinsconversationstableconversationstable to Parquet inbuild-cache(including Windows CSV fallback path)list_messages,get_message,search_messages) now returnsource_conversation_id2. Cache validation hardening
RequiredParquetDirslist used by cache builder, TUI, and MCP startupHasCompleteParquetData()checks all required tables exist (not just messages)HasCompleteParquetDatainstead ofHasParquetData— prevents DuckDB errors when tables likeconversationsare missingmissingRequiredParquet()detects partial/broken caches and triggers full rebuild (handles hive-partitioned messages layout)buildCacheMumutex prevents concurrent cache writes from parallel syncsmaxID > 0gate avoids infinite rebuild loops for zero-message accounts3. Remove dead config field and eliminate DTO duplication
server.mcp_enabledconfig field (MCP is always available viamsgvault mcp)APIMessage,APIAttachment,StoreStats,AccountStatusstructs ininternal/apiwith type aliases tostore/schedulertypesserve.goto direct pass-throughsmcp_enabledTest plan
source_conversation_idin search/get/list responsesmcp_enabledOriginally PR #76 (from @robelkin), squashed and rebased cleanly.
🤖 Generated with Claude Code