fix: show n/a for brain doc/chunk counts when stats are unavailable

When skillsArtifact is 'unavailable' or 'unknown' (DB unreachable or
query failure), showing 0/0 is misleading — the counts were never read.
Use n/a instead. Apply the same logic to memory stats when memoryDb is
not available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  2061 passed (2061)
This commit is contained in:
Operator & Claude Code 2026-04-29 13:38:44 +02:00
parent 3fbddcd73b
commit 6afdce3251

View file

@ -776,8 +776,12 @@ export async function handleBrainCommand(
(status.skillsArtifactVersion !== 'unknown'
? ` (${status.skillsArtifactVersion})`
: ''),
`Docs: ${status.skillsDocumentRows} · Chunks: ${status.skillsChunkRows}`,
`Memory: ${status.memoryRows} entries · ${status.memoryEmbeddingRows} embeddings`,
status.skillsArtifact !== 'unavailable' && status.skillsArtifact !== 'unknown'
? `Docs: ${status.skillsDocumentRows} · Chunks: ${status.skillsChunkRows}`
: `Docs: n/a · Chunks: n/a`,
status.memoryDb === 'available'
? `Memory: ${status.memoryRows} entries · ${status.memoryEmbeddingRows} embeddings`
: `Memory: n/a`,
];
if (issues.length > 0) {