diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-07-17 12:15:41 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-07-17 12:15:41 +0900 |
| commit | d57577637c1c1a16176d63d5a89e9eec3c1e4d7c (patch) | |
| tree | 55087498ab17601845446174a2f41f2490a53820 /src/mcp/tools/get_system_health.c | |
| parent | dda043b0ec9d8d9e5da7fe51fc48791086417a9b (diff) | |
fix: sessions paginationとhealth診断を改善
- sessions cursorのエンコード不具合と長いsession IDのバッファ問題を修正
- response budgetに基づくsessionsページングを追加
- get_system_healthにsession_countを追加
- metadata_jsonのフィールド別エラー診断を追加
- CRUD互換性とDebug/Release/ASanテストを確認
Diffstat (limited to 'src/mcp/tools/get_system_health.c')
| -rw-r--r-- | src/mcp/tools/get_system_health.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mcp/tools/get_system_health.c b/src/mcp/tools/get_system_health.c index 893a3b1..4189db3 100644 --- a/src/mcp/tools/get_system_health.c +++ b/src/mcp/tools/get_system_health.c @@ -15,6 +15,11 @@ call_get_system_health(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_mcp_tool_add_error(result, "INTERNAL_ERROR", "tool context is unavailable"); return; } + if (!tiny_mcp_tools_ensure_history_index(context) || !context->history_index) + { + tiny_mcp_tool_add_error(result, "INTERNAL_ERROR", "history index allocation failed"); + return; + } tiny_store_health(context->store, &health); tiny_json_init(&json); tiny_json_raw(&json, "{\"status\":"); @@ -27,6 +32,8 @@ call_get_system_health(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_json_u64(&json, health.snapshot_size); tiny_json_raw(&json, ",\"active_messages\":"); tiny_json_u64(&json, health.active_messages); + tiny_json_raw(&json, ",\"session_count\":"); + tiny_json_u64(&json, tiny_history_index_session_count(context->history_index)); tiny_json_raw(&json, ",\"deleted_messages\":"); tiny_json_u64(&json, health.deleted_messages); tiny_json_raw(&json, ",\"last_sequence\":"); |
