docs(base44-troubleshooter): say that --follow --json is NDJSON - #159
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #157 / #158, from
cli-logs-realtime's reading of the CLI source.base44 logs --follow --jsondoes not produce the "single machine-readable JSON document" the CLI's--jsonconvention promises elsewhere — a live tail can't. Verified in climain:writeFollowLine(packages/cli/src/cli/commands/project/logs.ts:127-130) writes oneJSON.stringify(entry)per line as lines arrive.writeJsonError(packages/cli/src/cli/utils/command/Base44Command.ts:42-66) appends one more object on its own line, carryingerror,code: "API_ERROR"and the two hints, becausestreamLostError()is anApiError.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.