Repository navigation
Description
Pre-submission checklist | 提交前检查
- I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
- I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
- This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题
Bug Description | 问题描述
The ESM bridge entry never asks the logger to initialize, so a bridge started from dist/bridge.mjs writes no log files at all.
core/pipeline/memory-core.ts:236 gates logger construction on its caller:
if (options.initLogging) {
initLogger(config, home);
}The option is declared at memory-core.ts:193 and documented as "Embedded hosts skip this and keep their own logger." That makes setting it the entry point's job.
bridge.mts:260 calls bootstrapMemoryCoreFull({ ... hostLlmBridge ... }) and never passes initLogging. The CommonJS entry does — bridge.cts:324 sends initLogging: true — so the two hand-maintained launchers disagree, and the flag only ever landed on one of them (it arrived in the dev-v2.0.25 release merge, e8204062).
That would be harmless if .cjs were still what runs. It isn't. bridge_client.py:100 documents the resolution order as:
dist/bridge.mjs— pure ESM compiled output, the only entrydist/bridge.cjs— legacy CommonJS compiled output, kept for installations whosedist/predates the ESM entrypoint
So dist/bridge.cjs is a fallback for stale builds, and both spawn sites resolve bridge.mjs first. On any current build the logger is therefore never constructed, config.logging is inert, and no sink exists — not the console channel, not the file sinks under the home's logs/ directory.
Two things keep it silent rather than loud:
initLoggingis optional and skipped when falsy, so nothing warns.- The one file that does keep growing is a bootstrap-created
daemon-start.log, which nothing rotates — because the code that would rotate it is the code that never ran.
Expected: starting a bridge from the packaged entry produces the sinks described by config.logging.
How to Reproduce | 如何重现
cd apps/memos-local-plugin && npm run build, and confirmdist/bridge.mjsexists.- Record the contents of the home's
logs/directory, plus the current size ofdaemon-start.log. - Start a bridge from the packaged entry:
node dist/bridge.mjs --agent=hermes --home=<home> --daemon. - Re-check
logs/: no new sink appears and no app log is written, whiledaemon-start.logkeeps growing. - Add
initLogging: trueto thebootstrapMemoryCoreFull({...})call inbridge.mts, rebuild, and repeat 3-4. The sinks now appear.
Environment | 环境信息
- Node.js: 22.x
- Operating System: Linux
- Version: current
main(176d4f67), also present on the v2.0.25 line - Entry point:
dist/bridge.mjs(ESM)
Additional Context | 其他信息
Two related notes, both in the same files:
- The launchers are duplicated by hand.
bridge.ctsandbridge.mtscarry the same bootstrap call and drifted in exactly this way. Since.cjsis now only a legacy fallback, collapsing to a single entry would remove the class rather than just this instance. - The stale prose in
bridge_client.py(the module docstring namingdist/bridge.cjsas what is spawned, and the "every turn spawns new bridge.cjs" comment) is a second symptom of the same drift.
Willingness to Implement | 实现意愿
- I'm willing to implement this myself | 我愿意自己解决
- I would like someone else to implement this | 我希望其他人来解决
Activity
akushonkamen commentedon Oct 8, 2026
Hi, I'd like to claim this one. I saw the willingness flag — if you're already on it, happy to step aside; otherwise here's a ready fix + regression test I can open as a PR right away.
Root cause in one line: the ESM bridge entry (
bridge.mts) never passesinitLogging: truetobootstrapMemoryCoreFull(the legacybridge.ctsdoes), and sincebridge_client.pyprefers the ESM build, the global logger is never initialized fromconfig.logging, so no file sinks under<home>/logsare ever created.The prepared fix adds the missing flag (plus the explanatory comment already present in
bridge.cts) and an integration regression that spawnsdist/bridge.mjsand asserts the file sinks appear under the runtime home. Will post the PR number shortly.akushonkamen commentedon Oct 8, 2026
Update: PR opened — #2465.
fix(hermes): rebuild-if-stale guard must track the ESM entry (MemTens…
github-actions commentedon Nov 16, 2026
This issue has been automatically marked as stale due to inactivity.