mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
feat: add session info panel with message count, context usage, cache stats, and skills
Add GET /bots/:bot_id/sessions/:session_id/info API endpoint that returns per-session message count, latest input token usage with model context window, aggregated KV cache hit rate, and skills invoked via use_skill tool calls. Frontend Info tab in the right sidebar now displays this data in a compact key-value layout with a context usage progress bar and clickable skill links.
This commit is contained in:
@@ -4386,6 +4386,63 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{bot_id}/sessions/{session_id}/info": {
|
||||
"get": {
|
||||
"description": "Get aggregated info for a chat session including message count, context usage, cache stats, and used skills",
|
||||
"tags": [
|
||||
"sessions"
|
||||
],
|
||||
"summary": "Get session info",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Bot ID",
|
||||
"name": "bot_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Session ID",
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Optional model UUID override for context window",
|
||||
"name": "model_id",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.SessionInfoResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{bot_id}/settings": {
|
||||
"get": {
|
||||
"description": "Get agent settings for current user",
|
||||
@@ -10866,6 +10923,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.CacheStats": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cache_hit_rate": {
|
||||
"type": "number"
|
||||
},
|
||||
"cache_read_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"cache_write_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total_input_tokens": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.ChannelMeta": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -10892,6 +10966,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.ContextUsage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"context_window": {
|
||||
"type": "integer"
|
||||
},
|
||||
"used_tokens": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.CreateContainerRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -11350,6 +11435,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.SessionInfoResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cache_stats": {
|
||||
"$ref": "#/definitions/handlers.CacheStats"
|
||||
},
|
||||
"context_usage": {
|
||||
"$ref": "#/definitions/handlers.ContextUsage"
|
||||
},
|
||||
"message_count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"skills": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.SkillItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user