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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user