Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions actions/setup/js/log_parser_shared.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,18 @@ function formatMcpParameters(input) {
return paramStrs.join(", ");
}

/**
* Formats a tool name with its input parameters for display in summaries.
* If the input has parameters, appends them in parentheses; otherwise returns the name unchanged.
* @param {string} name - The display name of the tool (e.g., "github-list_issues")
* @param {Object} input - The tool input parameters object
* @returns {string} Tool name with optional parameters (e.g., "github-list_issues(owner: github, repo: gh-aw)")
*/
function formatToolDisplayName(name, input) {
const params = formatMcpParameters(input);
return params ? `${name}(${params})` : name;
}
Comment on lines +536 to +539

/**
* Formats initialization information from system init entry
* @param {any} initEntry - The system init entry containing tools, mcp_servers, etc.
Expand Down Expand Up @@ -1104,7 +1116,7 @@ function generatePlainTextSummary(logEntries, options = {}) {
} else if (toolName.startsWith("mcp__")) {
// Format MCP tool names like github-list_pull_requests
const formattedName = formatMcpName(toolName).replace("::", "-");
displayName = formattedName;
displayName = formatToolDisplayName(formattedName, input);

Comment on lines 1116 to 1120
// Show result preview if available
if (toolResult && toolResult.content) {
Expand All @@ -1113,7 +1125,7 @@ function generatePlainTextSummary(logEntries, options = {}) {
resultPreview = ` └ ${truncated}`;
}
} else {
displayName = toolName;
displayName = formatToolDisplayName(toolName, input);

// Show result preview if available
if (toolResult && toolResult.content) {
Expand Down Expand Up @@ -1318,7 +1330,7 @@ function generateCopilotCliStyleSummary(logEntries, options = {}) {
} else if (toolName.startsWith("mcp__")) {
// Format MCP tool names like github-list_pull_requests
const formattedName = formatMcpName(toolName).replace("::", "-");
displayName = formattedName;
displayName = formatToolDisplayName(formattedName, input);

// Show result preview if available
if (toolResult && toolResult.content) {
Expand All @@ -1327,7 +1339,7 @@ function generateCopilotCliStyleSummary(logEntries, options = {}) {
resultPreview = ` └ ${truncated}`;
}
} else {
displayName = toolName;
displayName = formatToolDisplayName(toolName, input);

// Show result preview if available
if (toolResult && toolResult.content) {
Expand Down Expand Up @@ -1611,6 +1623,7 @@ module.exports = {
generateConversationMarkdown,
generateInformationSection,
formatMcpParameters,
formatToolDisplayName,
formatInitializationSummary,
formatToolUse,
parseLogEntries,
Expand Down
Loading