-
Notifications
You must be signed in to change notification settings - Fork 38
Description
β 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/safeoutputsThe 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-outputsvssafeoutputs)
Impact
- Both
githubandsafe_outputsMCP servers fail to start - Agent runs but has no MCP tools available
- All tool calls result in "Permission denied" errors
- Agent cannot create issues or report missing tools
create_issuejob 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