Skip to content

fix(cli): prevent debug log persistence in production deployments - #14

Merged
murdore merged 1 commit into
releasefrom
fix/cli-logging-debug-persistence
Jun 12, 2025
Merged

murdore merged 1 commit into
releasefrom
fix/cli-logging-debug-persistence

Conversation

@murdore

@murdore murdore commented Jun 12, 2025

Copy link
Copy Markdown
Contributor
  • Fixed CLI middleware logical gap where NEUROLINK_DEBUG wasn't explicitly set to 'false' when no debug flag provided
  • Prevents inherited environment variables from causing unwanted debug logs in production
  • Ensures deterministic logging behavior controlled by CLI flags, not external environment
  • Maintains backward compatibility - debug mode still works perfectly with --debug flag

Fixes: Debug logs appearing in deployed CLI without --debug flag
Impact: Clean production output, environment-independent logging behavior
Version: 1.5.3

- Fixed CLI middleware logical gap where NEUROLINK_DEBUG wasn't explicitly set to 'false' when no debug flag provided
- Prevents inherited environment variables from causing unwanted debug logs in production
- Ensures deterministic logging behavior controlled by CLI flags, not external environment
- Maintains backward compatibility - debug mode still works perfectly with --debug flag

Fixes: Debug logs appearing in deployed CLI without --debug flag
Impact: Clean production output, environment-independent logging behavior
Version: 1.5.3
Copilot AI review requested due to automatic review settings June 12, 2025 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a CLI middleware bug by ensuring that the environment variable controlling debug logging (NEUROLINK_DEBUG) is explicitly set to 'false' when debug mode is not enabled, preventing unwanted debug logs from persisting in production. The key changes include:

  • Simplifying the debug flag handling in the CLI to always set NEUROLINK_DEBUG to 'false' when not in debug mode.
  • Updating the package version to 1.5.3.
  • Adding a detailed changelog entry documenting the fix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/cli/index.ts Updated CLI debug flag logic to ensure NEUROLINK_DEBUG is set to 'false'.
package.json Bumped version from 1.5.2 to 1.5.3.
CHANGELOG.md Documented the debug log persistence fix and version update.
Comments suppressed due to low confidence (1)

src/cli/index.ts:183

  • The updated condition simplifies the handling of the debug flag by setting NEUROLINK_DEBUG to 'false' whenever debug mode is not active. Confirm that this behavior is intended, particularly for cases where the debug flag might be explicitly set to a falsy value.
} else {

@murdore
murdore merged commit 7310a4c into release Jun 12, 2025
@murdore
murdore deleted the fix/cli-logging-debug-persistence branch June 12, 2025 12:26
github-actions Bot pushed a commit that referenced this pull request Jun 20, 2025
# 1.0.0 (2025-06-20)

* 🎉 feat: Enhanced multi-provider support with production infrastructure ([#16](#16)) ([55eb81a](55eb81a))

### Bug Fixes

* **cli:** prevent debug log persistence in production deployments ([#14](#14)) ([7310a4c](7310a4c))
* production-ready CLI logging system and enhanced provider fallback ([#13](#13)) ([a7e8122](a7e8122))

### Features

* 🚀 MCP automatic tool discovery + dynamic models + AI function calling ([781b4e5](781b4e5))
* add Google AI Studio integration and restructure documentation ([#11](#11)) ([346fed2](346fed2))
* add Google AI Studio, fix CLI dependencies, and add LICENSE file ([#12](#12)) ([c234bcb](c234bcb))
* implement AI Development Workflow Tools and comprehensive visual documentation ([#10](#10)) ([b0ae179](b0ae179))
* implement comprehensive CLI tool with visual documentation and … ([#4](#4)) ([9991edb](9991edb))

### BREAKING CHANGES

* Enhanced provider architecture with MCP integration

- ✨ MCP automatic tool discovery - detects 82+ tools from connected servers
- 🎯 AI function calling - seamless tool execution with Vercel AI SDK
- 🔧 Dynamic model configuration via config/models.json
- 🤖 Agent-based generation with automatic tool selection
- 📡 Real-time MCP server management and monitoring

- Added MCPEnhancedProvider for automatic tool integration
- Implemented function calling for Google AI, OpenAI providers
- Created unified tool registry for MCP and built-in tools
- Enhanced CLI with `agent-generate` and MCP management commands
- Added comprehensive examples and documentation

- Automatic .mcp-config.json discovery across platforms
- Session-based context management for tool execution
- Graceful fallback when MCP servers unavailable
- Performance optimized tool discovery (<1ms per tool)

- Added 5 new comprehensive guides (MCP, troubleshooting, dynamic models)
- Created practical examples for all integration patterns
- Updated API reference with new capabilities
- Enhanced memory bank with implementation details

Resolves: Enhanced AI capabilities with real-world tool integration
* None - 100% backward compatibility maintained

Closes: Enhanced multi-provider support milestone
Ready for: Immediate production deployment
Impact: Most comprehensive AI provider ecosystem (9 providers)

Co-authored-by: sachin.sharma <sachin.sharma@juspay.in>
murdore pushed a commit that referenced this pull request Jun 20, 2025
* 🎉 feat: Enhanced multi-provider support with production infrastructure ([#16](#16)) ([55eb81a](55eb81a))

* **cli:** prevent debug log persistence in production deployments ([#14](#14)) ([7310a4c](7310a4c))
* production-ready CLI logging system and enhanced provider fallback ([#13](#13)) ([a7e8122](a7e8122))

* 🚀 MCP automatic tool discovery + dynamic models + AI function calling ([781b4e5](781b4e5))
* add Google AI Studio integration and restructure documentation ([#11](#11)) ([346fed2](346fed2))
* add Google AI Studio, fix CLI dependencies, and add LICENSE file ([#12](#12)) ([c234bcb](c234bcb))
* implement AI Development Workflow Tools and comprehensive visual documentation ([#10](#10)) ([b0ae179](b0ae179))
* implement comprehensive CLI tool with visual documentation and … ([#4](#4)) ([9991edb](9991edb))

* Enhanced provider architecture with MCP integration

- ✨ MCP automatic tool discovery - detects 82+ tools from connected servers
- 🎯 AI function calling - seamless tool execution with Vercel AI SDK
- 🔧 Dynamic model configuration via config/models.json
- 🤖 Agent-based generation with automatic tool selection
- 📡 Real-time MCP server management and monitoring

- Added MCPEnhancedProvider for automatic tool integration
- Implemented function calling for Google AI, OpenAI providers
- Created unified tool registry for MCP and built-in tools
- Enhanced CLI with `agent-generate` and MCP management commands
- Added comprehensive examples and documentation

- Automatic .mcp-config.json discovery across platforms
- Session-based context management for tool execution
- Graceful fallback when MCP servers unavailable
- Performance optimized tool discovery (<1ms per tool)

- Added 5 new comprehensive guides (MCP, troubleshooting, dynamic models)
- Created practical examples for all integration patterns
- Updated API reference with new capabilities
- Enhanced memory bank with implementation details

Resolves: Enhanced AI capabilities with real-world tool integration
* None - 100% backward compatibility maintained

Closes: Enhanced multi-provider support milestone
Ready for: Immediate production deployment
Impact: Most comprehensive AI provider ecosystem (9 providers)

Co-authored-by: sachin.sharma <sachin.sharma@juspay.in>
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.

3 participants