davila7/claude-code-templates · error
Failed to load summary
Error message
Failed to load summary
What it means
HTTP 500 from the teams dashboard GET /api/summary when reducing over this.sessions (totalSessions/totalAgents) throws — practically only if this.sessions contains unexpected entries (null rows, missing agentCount).
Source
Thrown at cli-tool/src/teams-dashboard.js:670
})),
count: this.sessions.length,
timestamp: new Date().toISOString()
});
} catch (error) {
res.status(500).json({ error: 'Failed to load sessions' });
}
});
// Global summary stats
this.app.get('/api/summary', async (req, res) => {
try {
res.json({
totalSessions: this.sessions.length,
totalAgents: this.sessions.reduce((sum, s) => sum + s.agentCount, 0),
timestamp: new Date().toISOString()
});
} catch (error) {
res.status(500).json({ error: 'Failed to load summary' });
}
});
// Full session detail (triggers parse)
this.app.get('/api/sessions/:id', async (req, res) => {
try {
const session = await this.parseFullSession(req.params.id);
if (!session) return res.status(404).json({ error: 'Session not found' });
res.json({
id: session.id,
projectName: session.projectName,
gitBranch: session.gitBranch,
startTime: session.startTime,
endTime: session.endTime,
duration: session.duration,
agents: session.agents,
teammateNames: session.teammateNames,View on GitHub (pinned to a0851ed10c)
Solutions
- Restart dashboard to re-parse sessions
- Inspect this.sessions for entries missing agentCount; remove corrupt session files
- Check parser handles empty/partial session files
Example fix
// before totalAgents: this.sessions.reduce((sum, s) => sum + s.agentCount, 0) // after totalAgents: this.sessions.reduce((sum, s) => sum + (s.agentCount || 0), 0)
Defensive patterns
Strategy: fallback
Try / catch
try { summary = await getSummary(); } catch { summary = { totalSessions: 0, totalAgents: 0 }; } Prevention
- Treat summary as optional UI data with a zeroed fallback
- Guard against missing agentCount when consuming raw APIs
When it happens
Trigger: GET /api/summary after session parsing produced entries without agentCount (null/undefined), making the reduce arithmetic throw on null.
Common situations: Partial or corrupt session files parsed into malformed session objects; parser version mismatch after upgrade.
Related errors
- Failed to load sessions
- Failed to load session
- Failed to load communications
- Failed to load tasks
- Failed to load teammate
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/25c5987d32614c08.
Report an issue: GitHub.