Skip to content

[smoke-detector] Comment on #2346Β #2357

@github-actions

Description

@github-actions

βœ… Original Issue FIXED, but NEW Bug Introduced - Run #41

Good News πŸŽ‰

The JSON escaping issue from #2323, #2341, and #2346 appears to be RESOLVED!

Run #41 shows NO MORE "Invalid JSON at position 557/558" errors. The commit de169a9 successfully fixed the JSON escaping problem.

Bad News 😞

However, the fix introduced a NEW bug: File path mismatch for safe-outputs MCP server.

New Failure Details - Run #41

  • Run: 18795986273
  • Commit: de169a9
  • Message: "Inline safe output config directly in MCP config for Copilot"
  • Status: ❌ NEW BUG - Path Mismatch
  • Duration: 1.9 minutes

The New Error

Error: Cannot find module '/tmp/gh-aw/safe-outputs/mcp-server.cjs'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1420:15)
    ...
    code: 'MODULE_NOT_FOUND'

Followed by:

Failed to start MCP client for safe_outputs: McpError: MCP error -32000: Connection closed
Failed to start MCP client for github: McpError: MCP error -32000: Connection closed

Root Cause

Path Inconsistency

Component Path Used
MCP Config (what CLI expects) /tmp/gh-aw/safe-outputs/mcp-server.cjs (WITH DASH)
Workflow (where file is created) /tmp/gh-aw/safeoutputs/mcp-server.cjs (WITHOUT DASH)

Evidence

From the agent session log (line 8):

Starting MCP client for safe_outputs with command: node and args: /tmp/gh-aw/safe-outputs/mcp-server.cjs

From the workflow lock file (line 144):

cat > /tmp/gh-aw/safeoutputs/mcp-server.cjs << 'EOF'

And directory creation (line 140):

mkdir -p /tmp/gh-aw/safeoutputs

The paths don't match!

What Commit de169a9 Did

The commit successfully:

  • βœ… Inlined safe outputs config directly into MCP config JSON
  • βœ… Avoided GitHub Actions expression evaluation issues
  • βœ… Fixed JSON escaping with proper json.Marshal() handling
  • βœ… Resolved the doubled-quotes problem

But it also:

  • ❌ Introduced inconsistent path naming (safe-outputs vs safeoutputs)

Impact

  1. Both github and safe_outputs MCP servers fail to start
  2. Agent runs but has no MCP tools available
  3. All tool calls result in "Permission denied" errors
  4. Agent cannot create issues or report missing tools
  5. create_issue job fails

Fix Needed

Option 1: Change MCP config to use safeoutputs (without dash)

// In pkg/workflow/copilot_engine.go (or similar):
// Change from:
"/tmp/gh-aw/safe-outputs/mcp-server.cjs"
// To:
"/tmp/gh-aw/safeoutputs/mcp-server.cjs"

Option 2: Change workflow to create at safe-outputs (with dash)

# In workflow template:
# Change from:
mkdir -p /tmp/gh-aw/safeoutputs
cat > /tmp/gh-aw/safeoutputs/mcp-server.cjs << 'EOF'
# To:
mkdir -p /tmp/gh-aw/safe-outputs
cat > /tmp/gh-aw/safe-outputs/mcp-server.cjs << 'EOF'

Recommendation: Use Option 1 (change MCP config path) to match existing workflow convention.

Timeline

Run # Date Time Error Type Status
36-39 Oct 24-25 21:10-00:04 JSON escaping (pos 557/558) ❌ Original issue
- Oct 25 00:24 - Commit de169a9 (fix attempt)
41 Oct 25 01:12 Path mismatch ❌ NEW bug

Verification Test

To verify the fix works, after applying the path correction:

# Ensure these match:
grep -r "mcp-server.cjs" pkg/workflow/*.go
grep -r "mcp-server.cjs" .github/workflows/*.lock.yml

# All paths should be consistent (either all safeoutputs or all safe-outputs)

Conclusion

Original Problem: βœ… SOLVED - JSON escaping issue fixed
New Problem: ❌ INTRODUCED - Path mismatch needs fixing

The fix for #2323/#2341/#2346 worked for its intended purpose, but the refactoring introduced a new file path inconsistency that needs a simple correction.


Investigation saved: /tmp/gh-aw/cache-memory/investigations/2025-10-25-18795986273.json
Pattern ID: COPILOT_SAFE_OUTPUTS_PATH_MISMATCH
Severity: Critical (blocks workflow)
Complexity: Low (simple path fix)

AI generated by Smoke Detector - Smoke Test Failure Investigator

AI generated by Smoke Detector - Smoke Test Failure Investigator

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions