docs(FN-823): clarify agent log content is never truncated per-entry

- Clarify in dashboard README that agent log entries are never truncated
- Add maxLength safeguards in store (getAgentLog), routes, useAgentLogs, and useMultiAgentLogs hooks
- Add tests for store, AgentLogViewer component, useAgentLogs hook, useMultiAgentLogs hook, and dashboard routes
- All tests verify that log text and detail fields are preserved in full without per-entry truncation
This commit is contained in:
gsxdsm
2026-04-04 01:41:13 -07:00
parent 3516394e9f
commit c78f49a8db
11 changed files with 280 additions and 2 deletions

View File

@@ -4,6 +4,14 @@ import { fetchAgentLogs } from "../api";
export const MAX_LOG_ENTRIES = 500;
/**
* Cap the total number of log entries to `MAX_LOG_ENTRIES`.
*
* This is a **whole-list cap** — it limits how many entries are kept
* in memory, not the content of any individual entry. Per-entry `text`
* and `detail` fields are never truncated anywhere in the pipeline
* (persistence → API → SSE → hook → rendering).
*/
function capLogEntries(entries: AgentLogEntry[]): AgentLogEntry[] {
return entries.length > MAX_LOG_ENTRIES
? entries.slice(-MAX_LOG_ENTRIES)