Skip to content

fix(worker): gate mcp discovery collector diagnostics#21

Merged
zebbern merged 1 commit into
mainfrom
codex/quiet-mcp-discovery-log-collector
Jun 20, 2026
Merged

fix(worker): gate mcp discovery collector diagnostics#21
zebbern merged 1 commit into
mainfrom
codex/quiet-mcp-discovery-log-collector

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • route MCP discovery Docker info/debug collector logs through workflowDiagnosticLog
  • keep warning and error collector logs visible
  • add a focused regression test for successful collector info/debug logs staying quiet by default

Verification

  • bun test worker/src/temporal/activities/tests/mcp-discovery.activity.test.ts
  • bun test worker/src/temporal/activities
  • bun test worker
  • bun run typecheck
  • bun run lint
  • bun run test

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 20:50

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 reduces noise from MCP discovery Docker/stdio-proxy diagnostics by routing info/debug-level collector logs through the workflow diagnostics gate, while keeping warn/error logs visible, and adds a regression test to ensure successful collector logs stay quiet by default.

Changes:

  • Centralized MCP discovery log routing in logMcpDiscoveryEntry() and gated info/debug logs via workflowDiagnosticLog.
  • Updated discovery container execution contexts to use the new log routing helper.
  • Added a regression test asserting that docker info/debug collector logs do not hit the console by default.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
worker/src/temporal/activities/mcp-discovery.activity.ts Routes MCP discovery collector info/debug logs through workflowDiagnosticLog while preserving warn/error visibility.
worker/src/temporal/activities/tests/mcp-discovery.activity.test.ts Adds a focused regression test ensuring docker collector info/debug logs don’t mirror to console under default settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +203 to +222
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
const consoleDebugSpy = vi.spyOn(console, 'debug').mockImplementation(() => {});

try {
await discoverMcpGroupToolsActivity({
servers: [
{
name: 'storage',
transport: 'stdio',
command: 'storage-mcp',
},
],
});

expect(consoleLogSpy).not.toHaveBeenCalled();
expect(consoleDebugSpy).not.toHaveBeenCalled();
} finally {
consoleLogSpy.mockRestore();
consoleDebugSpy.mockRestore();
}
@zebbern zebbern merged commit dde5bd4 into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/quiet-mcp-discovery-log-collector branch June 20, 2026 20:53
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.

2 participants