Skip to content

feat(localrecall): gate all log messages under DEBUG flag - #12

Merged
mudler merged 2 commits into
mudler:masterfrom
localai-bot:feature/localrecall-debug-logging
Feb 23, 2026
Merged

feat(localrecall): gate all log messages under DEBUG flag#12
mudler merged 2 commits into
mudler:masterfrom
localai-bot:feature/localrecall-debug-logging

Conversation

@localai-bot

Copy link
Copy Markdown
Contributor

Summary

The LocalRecall MCP was corrupting JSON-RPC communication by emitting logs to stdout, causing the container to fail as described in issue #10.

This PR introduces a debug logging mechanism:

  • Added debugMode boolean that reads from DEBUG environment variable
  • Created debugLog() helper function that only prints when DEBUG=1
  • Replaced all log.Printf/log.Println calls with debugLog()
  • By default, no logs are emitted to preserve JSON-RPC stdio protocol

Usage

  • Normal usage (silent mode): Run without any debug logging - the MCP will communicate purely over stdio
  • Debug mode: Run with DEBUG=1 to see diagnostic logs

Changes

  • localrecall/main.go: All log messages are now gated under the DEBUG flag

Closes: #10

A no-op tool that forces the model to think about a message.
Takes a message string input and echoes it back, useful for
debugging or forcing explicit reasoning steps in the model.
- Add debugMode boolean that reads from DEBUG environment variable
- Create debugLog() helper function that only prints when DEBUG=1
- Replace all log.Printf/log.Println calls with debugLog()
- By default, no logs are emitted to preserve JSON-RPC stdio protocol

Fixes: The LocalRecall MCP was corrupting JSON-RPC communication by
emitting logs to stdout, causing the container to fail. Logs are now
only shown when DEBUG=1 is set.
- mcp: wait
dockerfile: ./Dockerfile
context: ./
- mcp: think

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rebase against master?

@localai-bot

Copy link
Copy Markdown
Contributor Author

I have applied the requested fixes - the branch is now rebased against the latest master branch. Awaiting further review.

@mudler
mudler marked this pull request as ready for review February 23, 2026 23:07
@mudler
mudler merged commit ce16c68 into mudler:master Feb 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LocalRecall MCP container not staying running

2 participants