Render gateway.log in MCP gateway step summary and stop gateway after execution#9509
Conversation
- Updated parse_mcp_gateway_log.cjs to read both gateway.log and stderr.log files - Modified generateGatewayLogSummary to handle two log sources with separate sections - Updated tests to validate both log file rendering - Each log file gets its own collapsible details section in the step summary Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
@copilot use the PID of the gateway to stop the gateway process after the agent engine execution step, before secret redaction step. |
- Created stop_mcp_gateway.sh script to stop the gateway using its PID - Added generateStopMCPGateway() function to compiler_yaml_ai_execution.go - Inserted stop gateway step after agent execution, before secret redaction - The step runs with continue-on-error: true to prevent workflow failure if gateway is already stopped - Gateway PID is read from /tmp/gh-aw/mcp-logs/gateway/gateway.pid Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added in 41988fd. The MCP gateway is now stopped after agent execution and before secret redaction. The stop step:
|
|
@copilot you do not need a PID file, use a action step output to store the gateway PID Rename "Setup MCPs" step to "Start MCP gateway" |
- Renamed "Setup MCPs" step to "Start MCP gateway" for clarity - Added step ID "start-mcp-gateway" to capture output - Modified start_mcp_gateway.sh to output PID via GITHUB_OUTPUT instead of file - Updated stop_mcp_gateway.sh to read PID from command argument (step output) - Modified generateStopMCPGateway to pass PID from step output reference - Updated all test files and comments to use new step name Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Completed in 4994748:
The stop step now references: |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
The MCP gateway log parser only rendered
stderr.logto the step summary, missing operational logs fromgateway.log. Additionally, the gateway process was not being stopped after agent execution.Changes
parse_mcp_gateway_log.cjs: Read both log files, generate separate collapsible sections for eachparse_mcp_gateway_log.test.cjs: Updated tests to verify dual-log handling, single-log scenarios, and content preservationstop_mcp_gateway.sh(NEW): Shell script to gracefully stop the MCP gateway process using its PID from step outputstart_mcp_gateway.sh: Modified to output gateway PID via$GITHUB_OUTPUTinstead of writing to filemcp_servers.go: Renamed step from "Setup MCPs" to "Start MCP gateway" and added step IDstart-mcp-gatewaycompiler_yaml_ai_execution.go: AddedgenerateStopMCPGateway()function to generate the stop gateway stepcompiler_yaml_main_job.go: Inserted stop gateway step after agent execution, before secret redactionResult
Step summary now displays both:
gateway.log- Gateway operational logs (startup, server lifecycle)stderr.log- Debug output and errorsEach section renders only if the log file exists and has content.
Gateway cleanup:
steps.start-mcp-gateway.outputs.gateway-pid) instead of PID filecontinue-on-error: trueto prevent workflow failuresOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.