feat: rename info to status, add /status slash command

Rename session info endpoint from /sessions/:id/info to /sessions/:id/status
and update frontend tab label accordingly. Add /status slash command that
displays current session metrics (message count, context usage, cache hit
rate, used skills) as formatted text in any channel.
This commit is contained in:
Acbox
2026-04-02 03:28:48 +08:00
parent b3c783fb0b
commit 33b57ee345
14 changed files with 154 additions and 28 deletions
@@ -289,11 +289,11 @@
/>
</div>
<div
v-if="activeRightTab === 'info'"
v-if="activeRightTab === 'status'"
class="absolute inset-0"
>
<SessionInfoPanel
:visible="activeRightTab === 'info'"
:visible="activeRightTab === 'status'"
:override-model-id="overrideModelId"
/>
</div>
@@ -398,7 +398,7 @@ const reasoningPopoverOpen = ref(false)
// ---- Right sidebar panel ----
type RightTabId = 'terminal' | 'files' | 'info'
type RightTabId = 'terminal' | 'files' | 'status'
interface RightTab {
id: RightTabId
@@ -409,7 +409,7 @@ interface RightTab {
const rightTabs = computed<RightTab[]>(() => [
{ id: 'terminal', label: 'Terminal', icon: TerminalSquare },
{ id: 'files', label: t('chat.files'), icon: FolderOpen },
{ id: 'info', label: 'Info', icon: BarChart3 },
{ id: 'status', label: 'Status', icon: BarChart3 },
])
const activeRightTab = ref<RightTabId | null>(null)
@@ -104,7 +104,7 @@ import { storeToRefs } from 'pinia'
import { useQuery } from '@pinia/colada'
import { Sparkles, ExternalLink } from 'lucide-vue-next'
import { ScrollArea } from '@memohai/ui'
import { getBotsByBotIdSessionsBySessionIdInfo } from '@memohai/sdk'
import { getBotsByBotIdSessionsBySessionIdStatus } from '@memohai/sdk'
import type { HandlersSessionInfoResponse } from '@memohai/sdk'
import { useChatStore } from '@/store/chat-list'
import { openInFileManagerKey } from '../composables/useFileManagerProvider'
@@ -119,9 +119,9 @@ const { currentBotId, sessionId } = storeToRefs(chatStore)
const openInFileManager = inject(openInFileManagerKey, undefined)
const { data: info } = useQuery({
key: () => ['session-info', currentBotId.value ?? '', sessionId.value ?? '', props.overrideModelId ?? ''],
key: () => ['session-status', currentBotId.value ?? '', sessionId.value ?? '', props.overrideModelId ?? ''],
query: async () => {
const { data } = await getBotsByBotIdSessionsBySessionIdInfo({
const { data } = await getBotsByBotIdSessionsBySessionIdStatus({
path: {
bot_id: currentBotId.value!,
session_id: sessionId.value!,