Skip to content

docs(base44-troubleshooter): say that --follow --json is NDJSON - #159

Merged
davidsu merged 1 commit into
mainfrom
docs/troubleshooter-follow-json-ndjson
Aug 31, 2026
Merged

docs(base44-troubleshooter): say that --follow --json is NDJSON#159
davidsu merged 1 commit into
mainfrom
docs/troubleshooter-follow-json-ndjson

Conversation

@davidsu

@davidsu davidsu commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #157 / #158, from cli-logs-realtime's reading of the CLI source.

base44 logs --follow --json does not produce the "single machine-readable JSON document" the CLI's --json convention promises elsewhere — a live tail can't. Verified in cli main:

  • writeFollowLine (packages/cli/src/cli/commands/project/logs.ts:127-130) writes one JSON.stringify(entry) per line as lines arrive.
  • On a lost stream, writeJsonError (packages/cli/src/cli/utils/command/Base44Command.ts:42-66) appends one more object on its own line, carrying error, code: "API_ERROR" and the two hints, because streamLostError() is an ApiError.

So a consumer waiting for a closing bracket waits forever, and one that parses per line sees the failure as data. This page is read mainly by agents driving the CLI from a loop, which is exactly who that bites.

Adds the NDJSON rule and shows the error envelope.

Note: this commit was originally pushed to #158's branch a moment after that PR merged, so it never appeared in it. Re-homed here off current main — no content change.

A live tail cannot be the "single machine-readable JSON document" the
CLI's --json rule promises elsewhere: writeFollowLine emits one object
per line as lines arrive (logs.ts:127-130), and on a lost stream the
error is appended as one more object by writeJsonError
(Base44Command.ts:42-66). A consumer waiting for a closing bracket
waits forever.

Says so, and shows the error envelope, so an agent parsing --follow
--json treats the failure as data rather than as truncated output.
@davidsu
davidsu merged commit 5ba40be into main Aug 31, 2026
@davidsu
davidsu deleted the docs/troubleshooter-follow-json-ndjson branch August 31, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant