{"record":{"id":"2275e6696234254b","repo":"Hmbown/CodeWhale","slug":"codewhale-session-produced-no-inspectable-events","errorCode":null,"errorMessage":"Codewhale session produced no inspectable events.","messagePattern":"Codewhale session produced no inspectable events\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/pet_watch/pet-native.js","lineNumber":2151,"sourceCode":"            else {\n                const text = str(block.text) ?? '';\n                const operate = text.includes('codewhale:runtime_event');\n                const user = role === 'user' || role === 'User';\n                pushEvent(events, {\n                    schemaVersion: 1, id: idBase, traceId: sessionId, parentId: parentEventId,\n                    startTime: t.start, endTime: t.start, agentId,\n                    name: operate ? 'operate_contract' : user ? 'user_message' : 'assistant_message',\n                    category: operate ? 'orchestration' : user ? 'human' : 'communication',\n                    model, provider, status: 'success',\n                    attributes: { 'codewhale.entry_id': entryId, 'codewhale.seq': seq, role: role ?? 'unknown' },\n                    payload: { text: clip(text) }, raw,\n                });\n            }\n            seq += 1;\n        }\n    }\n    if (!events.length)\n        throw new Error('Codewhale session produced no inspectable events.');\n    for (const event of events) {\n        if (event.openEnded && event.tool)\n            warnings.push(`Tool ${event.id} has no matching tool_result in this snapshot; duration remains unknown.`);\n    }\n    const base = events.reduce((m, e) => Math.min(m, e.startTime), events[0].startTime);\n    for (const event of events) {\n        event.startTime -= base;\n        event.endTime -= base;\n    }\n    const cost = obj(metadata.cost);\n    const sessionCost = num(cost.session_cost_usd);\n    const duration = Math.max(1, events.reduce((m, e) => Math.max(m, e.endTime, e.startTime), 0));\n    const uniqueWarnings = [...new Set(warnings)];\n    return {\n        id: sessionId,\n        name: titleOfSession(metadata, filename),\n        events,\n        duration,","sourceCodeStart":2133,"sourceCodeEnd":2169,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tui/pet_watch/pet-native.js#L2133-L2169","documentation":"After converting all source entries to timeline events, the importer checks that at least one event was produced. If conversion yielded zero events — e.g. every entry lacked usable text/blocks or was skipped — the session is deemed not inspectable and the import fails. This prevents rendering an empty timeline from a non-empty-looking snapshot.","triggerScenarios":"Importing a session whose journal entries/messages all fail conversion: entries with no id-derived event payload, no text, no message content blocks, or only entry kinds the converter ignores.","commonSituations":"Journal entries present but structurally empty (messages with empty content arrays and no text field); a snapshot written by an older/newer format where fields were renamed; hand-edited session files with blank entries.","solutions":["Inspect entries in the session file and confirm each has text, message.text, or non-empty message.content blocks.","Re-export the session with a compatible Codewhale version so fields match the importer's expected schema.","Remove empty placeholder entries and re-import.","Check for format drift: diff an old working export against the failing one."],"exampleFix":"// before (entry converts to nothing)\n{ \"id\": \"e1\", \"kind\": \"user\", \"message\": { \"role\": \"user\", \"content\": [] } }\n// after\n{ \"id\": \"e1\", \"kind\": \"user\", \"message\": { \"role\": \"user\", \"content\": [] }, \"text\": \"hello\" }","handlingStrategy":"validation","validationCode":"const hasConvertible = (s) => (s.journal?.entries ?? []).some(e => e.text || e.message?.text || (e.message?.content ?? []).length > 0);","typeGuard":"const hasText = (e) => typeof e?.text === 'string' || typeof e?.message?.text === 'string' || Array.isArray(e?.message?.content);","tryCatchPattern":"try { importSession(s); } catch (e) { if (e.message.includes('no inspectable events')) reportUnconvertibleSession(s); else throw e; }","preventionTips":["Ensure entries carry text or message.content blocks.","Re-export after upgrading Codewhale to avoid schema drift.","Avoid hand-editing session files; use the exporter.","Dry-run parse and check for zero-entry results before import."],"tags":["import","events","conversion"],"backgroundTag":"empty-result-set","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T16:17:23.217Z"}