{"record":{"id":"468d588ce733be66","repo":"tinyhumansai/openhuman","slug":"first-non-empty-line-of-line-is-not-a-vali","errorCode":null,"errorMessage":"first non-empty line of {} (line {}) is not a valid _meta object: {err}","messagePattern":"first non-empty line of (.+?) \\(line (.+?)\\) is not a valid _meta object: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/harness/session/transcript.rs","lineNumber":1005,"sourceCode":"    let mut messages: Vec<ChatMessage> = Vec::new();\n    let mut compactions_replayed = 0usize;\n    let mut interrupted_skipped = 0usize;\n\n    // Append-only log replay (Phase A): the first non-empty line MUST be the\n    // `_meta` header; subsequent lines are messages, `compaction` records\n    // (which *replace* the accumulated context), interrupted partials (skipped\n    // for the model-context path), or refreshed `_meta` lines (last wins).\n    let mut seen_first = false;\n    for (line_no, line) in raw.lines().enumerate() {\n        let line = line.trim();\n        if line.is_empty() {\n            continue;\n        }\n\n        if !seen_first {\n            seen_first = true;\n            let ml: MetaLine = serde_json::from_str(line).map_err(|err| {\n                anyhow::anyhow!(\n                    \"first non-empty line of {} (line {}) is not a valid _meta object: {err}\",\n                    path.display(),\n                    line_no + 1,\n                )\n            })?;\n            meta = Some(meta_from_payload(ml.meta));\n            continue;\n        }\n\n        match classify_line(line) {\n            Ok(LineKind::Meta(ml)) => {\n                // Refreshed cumulative meta — last one wins.\n                meta = Some(meta_from_payload(ml.meta));\n            }\n            Ok(LineKind::Compaction(cl)) => {\n                // Reduction record: the reduced context REPLACES everything\n                // accumulated so far, exactly reproducing the old full-rewrite.\n                let replacement: Vec<ChatMessage> =","sourceCodeStart":987,"sourceCodeEnd":1023,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/harness/session/transcript.rs#L987-L1023","documentation":"Transcript replay (Phase A append-only log) requires the first non-empty line of a .jsonl session file to be the `_meta` header object. That line failed to parse as a valid `_meta` JSON object, so the file is not a well-formed transcript — usually a truncated, hand-edited, or pre-Phase-A format file.","triggerScenarios":"Thrown at src/openhuman/agent/harness/session/transcript.rs:1005 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the flagged line in the transcript file and fix or remove the malformed `_meta` header","Restore the file from a backup or earlier session snapshot if it is truncated","Start a fresh transcript if the history is unrecoverable and the old file is not needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}