Skip to content

[Bug]: QA Lab can parse partially appended Crabline JSONL records #99648

Description

@RomneyDa

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

QA Lab can read Crabline's JSONL recorder while a record is still being appended, causing an intermittent JSON.parse failure.

Steps to reproduce

  1. Start the Crabline-backed Telegram QA transport.
  2. Append a recorder JSONL record in two writes, pausing after byte 191 before the terminating newline.
  3. Trigger a transport reset while only the first write is visible.
  4. Observe Unterminated string in JSON at position 191.

Expected behavior

Normal recorder polling and reset operations should defer an incomplete trailing record until its newline is written. Completed malformed records and a permanently truncated final record should still fail parsing.

Actual behavior

createCrablineState splits every non-empty fragment and immediately passes it to JSON.parse, including an actively written final fragment. QA Smoke CI observed the failure in native-command-session-target while the other 24 scenarios passed.

OpenClaw version

010b617463797d1a1987c1795e18c91875bf4857 (current main at investigation start); failure observed at 543be4859b0da91cd2133054550b0c632793a0c6.

Operating system

Ubuntu 24.04 GitHub Actions runner

Install method

Repository checkout with pnpm CI setup

Model

mock-openai/gpt-5.5

Provider / routing chain

OpenClaw QA Lab -> mock-openai; Telegram transport -> Crabline local provider

Additional provider/model setup details

The failing scenario uses the deterministic smoke-ci QA profile with the Crabline Telegram transport.

Logs

native-command-session-target: Unterminated string in JSON at position 191 (line 1 column 192)

Screenshots, recordings, and evidence

Impact and severity

Affected: Crabline-backed QA scenarios that read the active recorder file. Severity: moderate CI reliability impact. Frequency: intermittent; 24 of 25 scenarios passed in the observed run. Consequence: a valid QA scenario fails before its behavior assertion because transport evidence parsing races the recorder append.

Additional information

@openclaw/[email protected] writes each JSONL record with fs.appendFile(..., JSON.stringify(event) + "\\n"). The reader must distinguish an active non-newline-terminated tail from a completed malformed record.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions