From a44fd4cf3a0c3d7ae33b7664341a0a9bff07aaaa Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Wed, 1 Jul 2026 00:11:08 +0900 Subject: 大規模履歴向けread_messages pagination対応 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mcp/tools/write_message.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mcp/tools/write_message.c') diff --git a/src/mcp/tools/write_message.c b/src/mcp/tools/write_message.c index f9c078a..c4b18cc 100644 --- a/src/mcp/tools/write_message.c +++ b/src/mcp/tools/write_message.c @@ -185,6 +185,14 @@ call_write_message(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_search_index_free(context->search_index); context->search_index = NULL; } + if (context->history_index + && !tiny_history_index_add(context->history_index, + context->store, + tiny_store_entry_count(context->store) - 1)) + { + tiny_history_index_free(context->history_index); + context->history_index = NULL; + } tiny_json_init(&json); tiny_json_raw(&json, "{\"status\":\"OK\",\"message\":"); tiny_mcp_tool_append_message(&json, &written); -- cgit v1.2.3