fix: redirect LCM diagnostic log output to stderr#283
Merged
jalehman merged 2 commits intoMartian-Engineering:mainfrom Apr 6, 2026
Merged
fix: redirect LCM diagnostic log output to stderr#283jalehman merged 2 commits intoMartian-Engineering:mainfrom
jalehman merged 2 commits intoMartian-Engineering:mainfrom
Conversation
Contributor
|
bummer, won't get contrib credit. at least its done. |
Route all deps.log calls through console.error() instead of api.logger.* so that [lcm] diagnostic lines never contaminate stdout JSON output. Fixes Martian-Engineering#165 Co-authored-by: RJ Johnston <293686+rjdjohnston@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
816101f to
fe701bc
Compare
Contributor
Author
|
Hey @rjdjohnston, totally fair. Your issue report nailed the root cause and your PR #166 paved the way for this fix. I've added a Co-authored-by trailer to the commit to make sure you get credit. Thanks for the thorough diagnosis. |
Contributor
|
Thanks to both of you! |
pull bot
pushed a commit
to gerrampard/lossless-claw
that referenced
this pull request
Apr 6, 2026
…g#283) * fix: redirect LCM diagnostic log output to stderr Route all deps.log calls through console.error() instead of api.logger.* so that [lcm] diagnostic lines never contaminate stdout JSON output. Fixes Martian-Engineering#165 Co-authored-by: RJ Johnston <293686+rjdjohnston@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: keep LCM diagnostics on stderr --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: RJ Johnston <293686+rjdjohnston@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Josh Lehman <josh@martian.engineering>
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.
Summary
Route all
deps.logcalls throughconsole.error()instead ofapi.logger.info/warn/error. The host application writesapi.logger.info()to stdout, so when the host runs with--json, LCM's[lcm]diagnostic lines contaminate the JSON output and breakJSON.parse()in downstream consumers like ClawKitchen's agents page.Changes
src/plugin/index.ts: Changed log wiring increateLcmDependencies()fromapi.logger.*toconsole.error()for all log levels (info, warn, error, debug)test/plugin-config-registration.test.ts: Updated test assertions to spy onconsole.errorfor[lcm]messages that now route through stderrconsole.error()writes to fd 2 (stderr) regardless of what the host logger does, so LCM diagnostic output can never contaminate stdout JSON.Testing
All 17 tests in
plugin-config-registration.test.tspass. The migration log messages now correctly appear in stderr (visible asstderr |prefix in vitest output).Fixes #165
This contribution was developed with AI assistance (Codex).