fix: suppress plugin registration logs in CLI mode (#380)#387
fix: suppress plugin registration logs in CLI mode (#380)#387buzhihuowu2019 wants to merge 2 commits intoCortexReach:masterfrom
Conversation
|
The |
AliceLJY
left a comment
There was a problem hiding this comment.
Code LGTM — clean, minimal change, no side effects.
The 4 test failures in reflection-bypass-hook.test.mjs are pre-existing (fixed on master by 8bbca98 but not yet in your branch). Please rebase onto latest master to pick up the seed date fix, then tests should pass.
@rwmjhb ready for merge after rebase.
In CLI mode (OPENCLAW_CLI=1), registration and lifecycle logs are downgraded from info to debug to avoid flooding stderr with ~11 lines of noise before command output. Affected logs: - smart extraction enabled - plugin registered (db, model, smartExtraction) - diagnostic build tag loaded - session-strategy: using none - session-memory: typed before_reset hook registered Gateway runtime behavior is unchanged (logs remain at info level).
72a897f to
a9232ef
Compare
|
Rebased onto latest master (picked up the seed date fix from 8bbca98). Ready for merge. |
|
Nice improvement overall. One thing I noticed: CLI-mode log suppression still seems incomplete. On the current PR head, If the intended scope of #380 is “suppress registration/lifecycle noise in CLI mode,” I think those remaining registration logs should be gated the same way as the other startup logs. |
Summary
Fixes #380
Problem
Every
openclaw memory-proCLI command (stats, list, search, etc.) outputs ~11 lines of plugin registration logs to stderr before the actual command output, making CLI output very hard to read.Solution
Detect CLI mode via
OPENCLAW_CLIenvironment variable (set by OpenClaw when running CLI subcommands). In CLI mode, downgrade registration and lifecycle logs frominfotodebuglevel.Changes
isCliMode()helper that checksprocess.env.OPENCLAW_CLI === "1"Behavior
Testing
Tested with
openclaw memory-pro stats— registration logs no longer appear in stderr. Gateway startup logs remain unchanged.