{"record":{"id":"395927cad5ce1bd6","repo":"davila7/claude-code-templates","slug":"failed-to-load-teammate","errorCode":null,"errorMessage":"Failed to load teammate","messagePattern":"Failed to load teammate","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli-tool/src/teams-dashboard.js","lineNumber":768,"sourceCode":"    this.app.get('/api/sessions/:id/teammates/:agentId', async (req, res) => {\n      try {\n        const session = await this.parseFullSession(req.params.id);\n        if (!session) return res.status(404).json({ error: 'Session not found' });\n\n        const agent = session.agents[req.params.agentId];\n        if (!agent) return res.status(404).json({ error: 'Agent not found' });\n\n        // Get agent-specific events\n        const agentEvents = session.events\n          .filter(e => e.agentId === req.params.agentId)\n          .slice(0, 100);\n\n        res.json({\n          ...agent,\n          recentEvents: agentEvents\n        });\n      } catch (error) {\n        res.status(500).json({ error: 'Failed to load teammate' });\n      }\n    });\n\n    // Main route\n    this.app.get('/', (req, res) => {\n      res.sendFile(path.join(__dirname, 'teams-dashboard-web', 'index.html'));\n    });\n  }\n\n  async startServer() {\n    return new Promise((resolve) => {\n      this.httpServer = this.app.listen(this.port, async () => {\n        console.log(chalk.green(`Teams dashboard started at http://localhost:${this.port}`));\n        resolve();\n      });\n    });\n  }\n","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/teams-dashboard.js#L750-L786","documentation":"Catch-all HTTP 500 for the teammate detail route: agent resolved but filtering events or spreading/serializing the agent object threw (circular references, unexpected event shapes).","triggerScenarios":"GET /api/sessions/:id/teammates/:agentId where session.events entries lack expected fields or agent object contains non-serializable/circular data.","commonSituations":"Parser output changes between dashboard versions; partially corrupt session data.","solutions":["Inspect the same agent via /api/sessions/:id raw output","Remove/repair the session file or re-parse by restarting","Guard filters against malformed events"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { mate = await getTeammate(id, agentId); } catch { showAgentSummaryOnly(agentId); }","preventionTips":["Fall back to a summary card if the detail endpoint 500s","Keep agent rendering defensive against missing fields"],"tags":["http-500","teams-dashboard","express"],"backgroundTag":"http-500-internal-server-error","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}