Skip to content

Refactor launcher connection error logging into internal/launcher#7276

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/aw-abc123def456-fix-duplicate-log-prefix
Draft

Refactor launcher connection error logging into internal/launcher#7276
Copilot wants to merge 2 commits into
mainfrom
copilot/aw-abc123def456-fix-duplicate-log-prefix

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[LAUNCHER]-prefixed connection failure logs were split across internal/mcp and internal/launcher, which blurred ownership and made launcher log behavior harder to find and evolve. This change consolidates launcher-specific error diagnostics in the launcher package and removes launcher-prefixed behavior from mcp internals.

  • Logging ownership realignment

    • Added internal/launcher/connection_error_log.go with:
      • ConnectionErrorContext
      • LogConnectionError
    • This moves all [LAUNCHER] connection-failure formatting and hint logic into the launcher subsystem.
  • Launcher call-site update

    • Updated internal/launcher/log_helpers.go:
      • logLaunchError now invokes launcher-local LogConnectionError(...)
      • Removed dependency on mcp.ConnectionErrorContext / mcp.LogConnectionError.
  • mcp package decoupling

    • Removed launcher-specific connection error logging implementation from internal/mcp/connection_logging.go.
    • Updated internal/mcp/connection.go connection-failure branch to emit mcp-scoped structured errors (including sanitized stderr) without [LAUNCHER] console conventions.
  • Test ownership alignment

    • Moved connection-error logging tests from internal/mcp/errors_test.go to internal/launcher/connection_error_log_test.go so behavior coverage lives with the owning package.
// before (launcher -> mcp)
mcp.LogConnectionError(mcp.ConnectionErrorContext{ ... }, err)

// after (launcher-local ownership)
LogConnectionError(ConnectionErrorContext{ ... }, err)

Copilot AI changed the title [WIP] Fix duplicate code pattern in launcher log prefix Refactor launcher connection error logging into internal/launcher Jun 9, 2026
Copilot finished work on behalf of lpcox June 9, 2026 15:40
Copilot AI requested a review from lpcox June 9, 2026 15:40
GitHub Advanced Security started work on behalf of lpcox June 9, 2026 15:43 View session
GitHub Advanced Security finished work on behalf of lpcox June 9, 2026 15:44
GitHub Advanced Security started work on behalf of lpcox June 9, 2026 15:50 View session
GitHub Advanced Security finished work on behalf of lpcox June 9, 2026 15:51
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.

[duplicate-code] Duplicate Code Pattern: [LAUNCHER] Log Prefix Spans Two Packages

2 participants