davila7/claude-code-templates · error
Failed to load communications
Error message
Failed to load communications
What it means
Catch-all HTTP 500 for the communications route: session parsed but accessing session.communications.length threw (communications undefined) or JSON serialization failed.
Source
Thrown at cli-tool/src/teams-dashboard.js:730
hasMore: start + pageSize < session.events.length
});
} catch (error) {
res.status(500).json({ error: 'Failed to load timeline' });
}
});
// Communications
this.app.get('/api/sessions/:id/communications', 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({
communications: session.communications,
count: session.communications.length
});
} catch (error) {
res.status(500).json({ error: 'Failed to load communications' });
}
});
// Tasks
this.app.get('/api/sessions/:id/tasks', 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({
tasks: session.tasks,
count: session.tasks.length
});
} catch (error) {
res.status(500).json({ error: 'Failed to load tasks' });
}
});
View on GitHub (pinned to a0851ed10c)
Solutions
- Update/restart the dashboard so the parser fills defaults
- Guard with (session.communications || []) — or remove the problematic session file
- Check /api/sessions/:id output shape
Example fix
// before communications: session.communications, count: session.communications.length // after communications: session.communications || [], count: (session.communications || []).length
Defensive patterns
Strategy: fallback
Validate before calling
const detail = await fetch(`/api/sessions/${id}`).then(r => r.json());
if (!Array.isArray(detail.communications)) fallbackToEmpty(); Type guard
const hasComms = (s) => Array.isArray(s?.communications);
Try / catch
try { comms = await getComms(id); } catch { comms = { communications: [], count: 0 }; } Prevention
- Default to empty arrays when the field is missing
- Show 'no communications' rather than an error state
When it happens
Trigger: GET /api/sessions/:id/communications where the parser omitted the communications field (older session format or empty log).
Common situations: Sessions produced by an older CLI version lacking teammate messaging; partially written logs.
Related errors
- Failed to load sessions
- Failed to load summary
- Failed to load session
- 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/eb95cc447a6058c7.
Report an issue: GitHub.