feat: dedicated MCP logs artifact upload to close telemetry observability gap#48700
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds dedicated MCP telemetry artifact uploads to improve observability when unified agent artifacts are incomplete.
Changes:
- Adds MCP log permission repair and dedicated upload steps.
- Extends
--artifacts mcpand introduces shared artifact/path constants. - Recompiles workflow lockfiles and adds compiler tests.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_yaml_artifacts.go |
Generates dedicated MCP artifact steps. |
pkg/workflow/compiler_yaml_post_agent.go |
Wires MCP upload into post-agent processing. |
pkg/workflow/mcp_logs_upload_test.go |
Tests generated MCP upload steps. |
pkg/constants/job_constants.go |
Defines the MCP artifact base name. |
pkg/constants/constants.go |
Defines the ARC/DinD MCP path. |
pkg/cli/logs_artifact_set.go |
Extends the MCP artifact filter. |
.github/workflows/*.lock.yml |
Recompiles generated workflows with MCP upload steps. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 270/270 changed files
- Comments generated: 5
- Review effort level: Medium
| // independent of the unified agent artifact, closing the observability gap reported in | ||
| // gh-aw#48674. A chmod step runs first to handle edge-case permission differences | ||
| // (e.g. tool sub-containers writing files with a different UID in AWF isolation mode). | ||
| c.generateMCPLogsArtifactUpload(yaml, data.Name, data, artifactPrefixExprForDownstreamJob(data)) |
| yaml.WriteString(" - name: Fix MCP logs permissions\n") | ||
| yaml.WriteString(" if: always()\n") | ||
| yaml.WriteString(" continue-on-error: true\n") | ||
| yaml.WriteString(" run: chmod -R a+rX /tmp/gh-aw/mcp-logs/ 2>/dev/null || true\n") |
| mcpLogsPath := constants.TmpMcpLogsDir | ||
| if isArcDindTopology(data) { | ||
| mcpLogsPath = constants.TmpMcpLogsDirExpr | ||
| } |
| ArtifactSetActivation: {constants.ActivationArtifactName}, | ||
| ArtifactSetAgent: {constants.AgentArtifactName}, | ||
| ArtifactSetMCP: {constants.AgentArtifactName}, | ||
| ArtifactSetMCP: {constants.AgentArtifactName, constants.MCPLogsArtifactBaseName}, |
| sanitizedName := strings.ToLower(SanitizeWorkflowName(workflowName)) | ||
| artifactName := prefix + constants.MCPLogsArtifactBaseName + "-" + sanitizedName |
PR Triage
Adds dedicated MCP logs artifact upload; touches 270 files (mostly regenerated
|
|
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
❌ Design Decision Gate 🏗️ failed during design decision gate check. |
|
✅ Test Quality Sentinel completed test quality analysis. |
There was a problem hiding this comment.
Review Summary
The PR addresses a real observability gap (missing MCP logs), but has four blocking issues already detailed in inline comments:
-
artifactMatchesFiltermismatch —ArtifactSetMCPincludes"mcp-logs"as a filter, but generated artifacts are named"mcp-logs-{workflow}". The match logic checksHasSuffix("-mcp-logs")— this never matches a name prefixed withmcp-logs-.--artifacts mcpsilently downloads nothing new. Fix: addstrings.HasPrefix(name, f+"-")toartifactMatchesFilter. -
chmodcan't fix cross-UID files —chmod -R a+rXfails when files are owned by a different UID (the exact AWF isolation case claimed in the comment). The|| truesuppresses the error, so unreadable files stay unreadable and the upload silently captures nothing. -
ARC/DinD path inconsistency — The
chmodstep hardcodes/tmp/gh-aw/mcp-logs/(line 92) while the upload step uses the dynamic${{ runner.temp }}/gh-aw/mcp-logs/for ARC/DinD. The chmod runs on the wrong path on ARC runners; both steps must use the same resolvedmcpLogsPathvariable. -
Step ordering — chmod emitted after redactor —
Fix MCP logs permissionsis inserted after secret redaction. The redactor skips unreadable files (EACCES), so for files that are unreadable at redaction time, the chmod comes too late to help. Move chmod before the redaction step.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 30.9 AIC · ⌖ 5.31 AIC · ⊞ 5K
🧪 Test Quality Sentinel Report✅ Test Quality Score: 85/100 — Excellent
📊 Metrics (2 tests)
🔍 Test Analysis
Build tag: Verdict
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design and /diagnosing-bugs — requesting changes on correctness issues that would prevent the fix from working end-to-end.
📋 Key Themes
Bugs (5 existing inline comments cover these)
chmodhardcodes/tmp/gh-aw/mcp-logs/— on ARC/DinD the computedmcpLogsPathis${{ runner.temp }}/gh-aw/mcp-logs/, but the chmod still targets the hardcoded literal, leaving permissions unfixed before the dedicated upload.artifactMatchesFilterwon't matchmcp-logs-{name}— the filter entry"mcp-logs"only matches artifacts whose name equals"mcp-logs"or ends in"-mcp-logs". The generated artifact is namedmcp-logs-{workflow}(prefix, not suffix), so--artifacts mcpsilently skips it.- ARC/DinD path mismatch for dedicated upload — the chmod hardcoding compounds with the ARC path expression used for upload, meaning files on ARC remain unreadable before upload.
- Download directory structure —
actions/upload-artifactcreatesmcp-logs-{name}/gateway.jsonl; the download path is not flattened for the new artifact, requiring consumers to account for the extra directory level. - chmod can't repair cross-UID files — the stated different-UID scenario (AWF isolation) cannot be fixed by
chmodas a non-root user; failures are silently suppressed, which can mask the root cause.
Positive Highlights
- ✅ Step order (Stop MCP Gateway → chmod → Upload MCP logs → Upload agent artifacts) is correct and well-tested.
- ✅
if: always(),continue-on-error: true, andif-no-files-found: ignoremake this gracefully safe for workflows without an MCP gateway. - ✅ Good unit tests covering Playwright and non-Playwright paths.
- ✅ The concept of a dedicated MCP logs artifact is sound and closes the right gap.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 42.7 AIC · ⌖ 4.71 AIC · ⊞ 6.7K
Comment /matt to run again
Documents the architectural decision to add a dedicated mcp-logs-{name}
artifact upload step to every agentic workflow, independent of the unified
agent artifact, to close the MCP telemetry observability gap (gh-aw#48674).
|
@copilot run pr-finisher skill |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot refactor code as part of the stop MCp gateway sh script |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove added step, not needed anymore, recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
gateway.jsonlandrpc-messages.jsonlwere missing from ~5/8 sampled workflow runs because/tmp/gh-aw/mcp-logs/had nochmodbefore upload (unlike firewall logs) and relied solely on the fragile unified agent artifact.Changes
Fix MCP logs permissions— runschmod -R a+rX /tmp/gh-aw/mcp-logs/ 2>/dev/null || truebefore upload, mirroring the firewall chmod patternUpload MCP logs— dedicatedactions/upload-artifactstep producing amcp-logs-{workflow-name}artifact, independent of the unified upload;if: always(),continue-on-error: true,if-no-files-found: ignoreArtifactSetMCPupdated —--artifacts mcpnow downloads bothagentandmcp-logsartifactsMCPLogsArtifactBaseName = "mcp-logs",TmpMcpLogsDirExpr(ARC/DinD path expression)mcp_logs_upload_test.goupdated to assert the new steps and artifact name for both Playwright and non-Playwright workflows.lock.ymlfiles recompiled from updated compilerStep order in every agentic job post-fix: