feat: render AWF/MCP RPC message types in gateway step summary#30489
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0f9716a4-6a7a-48e5-ad29-5ed816d2c6ed Co-authored-by: pelikhan <[email protected]>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0f9716a4-6a7a-48e5-ad29-5ed816d2c6ed Co-authored-by: pelikhan <[email protected]>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0f9716a4-6a7a-48e5-ad29-5ed816d2c6ed Co-authored-by: pelikhan <[email protected]>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0f9716a4-6a7a-48e5-ad29-5ed816d2c6ed Co-authored-by: pelikhan <[email protected]>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0f9716a4-6a7a-48e5-ad29-5ed816d2c6ed Co-authored-by: pelikhan <[email protected]>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0f9716a4-6a7a-48e5-ad29-5ed816d2c6ed Co-authored-by: pelikhan <[email protected]>
There was a problem hiding this comment.
Pull request overview
Updates the MCP gateway step-summary renderer to provide clearer, per-message-type rendering for rpc-messages.jsonl (REQUEST/RESPONSE/other types) while keeping DIFC-filtered event rendering intact, and expands tests to cover the new output format.
Changes:
- Render dedicated
#### REQUESTand#### RESPONSEsections (plus one section per non-request/response message type) under a single “MCP Gateway Activity …”<details>block. - Add sanitization/truncation helpers for table cell content and response details.
- Extend
generateRpcMessagesSummarytest coverage for response rows and “other message types” rendering.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/parse_mcp_gateway_log.cjs | Adds new helpers and updates RPC message step-summary rendering to split by message type with richer tables. |
| actions/setup/js/parse_mcp_gateway_log.test.cjs | Updates/extends tests to match new summary header counts and validate RESPONSE/other-type sections. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
| test("generates details/summary with request count", () => { | ||
| const summary = generateRpcMessagesSummary({ requests: sampleRequests, responses: sampleResponses, other: [] }, []); | ||
| expect(summary).toContain("<details>"); | ||
| expect(summary).toContain("MCP Gateway Activity (2 requests)"); | ||
| expect(summary).toContain("MCP Gateway Activity (2 requests, 1 response)"); | ||
| expect(summary).toContain("</details>"); |
| const time = formatRpcMessageTime(req.timestamp); | ||
| const server = escapeMarkdownTableCell(req.server_id || "-"); | ||
| const label = escapeMarkdownTableCell(getRpcRequestLabel(req)); | ||
| callLines.push(`| ${time} | ${server} | \`${label}\` |`); | ||
| } |
| for (const type of renderedOtherTypes) { | ||
| callLines.push(`#### ${type}`); | ||
| callLines.push(""); |
| function summarizeGenericRpcEntry(entry) { | ||
| const parts = []; | ||
| const topLevelIgnoredKeys = new Set(["timestamp", "direction", "type", "server_id", "payload"]); | ||
| const pushPart = (key, value) => { |
|
@copilot review all comments |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/6f5d85f2-9e80-432c-9e77-7c379f3982fa Co-authored-by: pelikhan <[email protected]>
Addressed the actionable review comments in 8c2c3ae: renamed the stale test description, escaped and bounded request labels, sanitized message-type headings/summary text, and hoisted the ignored-key set. Validation passed with targeted Vitest checks, Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Validation
npm run typecheck && npx vitest run parse_mcp_gateway_log.test.cjs awf_reflect_summary.test.cjs --no-file-parallelismmake agent-report-progressparallel_validationNotes