fix(VSearch): suppress dotenv v17 stdout banner that breaks stdio JSON protocol - #461
Merged
lioensky merged 1 commit intoAug 28, 2026
Merged
Conversation
…N protocol
dotenv ^17 prints a tips banner ("◇ injected env (n) from config.env ...")
to stdout on config(). VSearch communicates with PluginManager over stdio
where stdout must contain only JSON, so the banner lands before the JSON
response and every call fails with:
Failed to parse final stdout JSON from plugin "VSearch".
Error: Unexpected token "◇" ... is not valid JSON
VSearch.js already routes all of its own logging to stderr; this banner is
the only stdout contamination. Passing quiet: true restores the dotenv v16
behavior.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
问题 / Problem
Plugin/VSearch/package.json声明dotenv: ^17.4.2。dotenv v17 在config()时会向 stdout 打印横幅:VSearch 与 PluginManager 走 stdio 协议、stdout 必须是纯 JSON,横幅排在 JSON 响应之前,导致每次调用都失败:
VSearch.js 自身的日志已经全部走 stderr(设计意图正确),唯一污染源就是 dotenv 的横幅。主仓库
package.json用的是^16.5.0(无横幅),所以只有 VSearch 受影响。修复 / Fix
一行改动:
dotenv.config({ path: configPath, quiet: true }),恢复 v16 的静默行为。在 Linux (node v22) 实测:修复前 stdout 首行为横幅,修复后 stdout 为纯 JSON。