diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-07-01 00:11:08 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-07-01 00:11:08 +0900 |
| commit | a44fd4cf3a0c3d7ae33b7664341a0a9bff07aaaa (patch) | |
| tree | 5c3152e7df8b16b207d6ebd69dfaf205765a8044 /src/mcp/tools/rebuild_index.c | |
| parent | e3db01cd487c5b666366885367c8bfff4a6a09da (diff) | |
大規模履歴向けread_messages pagination対応
Diffstat (limited to 'src/mcp/tools/rebuild_index.c')
| -rw-r--r-- | src/mcp/tools/rebuild_index.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mcp/tools/rebuild_index.c b/src/mcp/tools/rebuild_index.c index 69f8341..7208d77 100644 --- a/src/mcp/tools/rebuild_index.c +++ b/src/mcp/tools/rebuild_index.c @@ -11,6 +11,7 @@ call_rebuild_index(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_mcp_tools_context_t *context = tiny_mcp_tools_context_current(); tiny_rebuild_report_t report; tiny_search_index_t *rebuilt; + tiny_history_index_t *history; tiny_store_status_t status; tiny_json_buffer_t json; (void)tool; @@ -25,9 +26,14 @@ call_rebuild_index(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_mcp_tool_add_error(result, tiny_store_status_name(status), "index rebuild failed"); return; } + tiny_history_index_free(context->history_index); + context->history_index = NULL; rebuilt = tiny_mcp_tools_build_search_index(context->store); - if (!rebuilt) + history = tiny_history_index_build(context->store); + if (!rebuilt || !history) { + tiny_search_index_free(rebuilt); + tiny_history_index_free(history); tiny_search_index_free(context->search_index); context->search_index = NULL; tiny_mcp_tool_add_error(result, "INTERNAL_ERROR", "search index allocation failed"); @@ -35,6 +41,7 @@ call_rebuild_index(const mcpc_tool_t *tool, mcpc_ucbr_t *result) } tiny_search_index_free(context->search_index); context->search_index = rebuilt; + context->history_index = history; tiny_json_init(&json); tiny_json_raw(&json, "{\"status\":\"OK\",\"messages_indexed\":"); tiny_json_u64(&json, report.messages_indexed); |
