Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions actions/setup/js/log_parser_bootstrap.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ async function runLogParser(options) {
logEntries: [],
};

// Write to step summary directly
// Write to step summary, wrapped in details/summary section
if (result.markdown) {
core.summary.addRaw(result.markdown);
const wrappedMarkdown = wrapAgentLogInSection(result.markdown, {
parserName,
open: true,
});
core.summary.addRaw(wrappedMarkdown);
await core.summary.write();
core.info(`Wrote conversation markdown to step summary (${Buffer.byteLength(result.markdown, "utf8")} bytes)`);
}
Expand Down
13 changes: 8 additions & 5 deletions actions/setup/js/log_parser_bootstrap.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("log_parser_bootstrap.cjs", () => {
(runLogParser({ parseLog: mockParseLog, parserName: "TestParser" }),
expect(mockParseLog).toHaveBeenCalledWith("Test log content"),
expect(mockCore.info).toHaveBeenCalledWith("TestParser log parsed successfully"),
expect(mockCore.summary.addRaw).toHaveBeenCalledWith("<details open>\n<summary>🤖 TestParser CLI Session</summary>\n\n## Parsed Log\n\nSuccess!\n</details>"),
expect(mockCore.summary.addRaw).toHaveBeenCalledWith("<details open>\n<summary>Agentic Conversation</summary>\n\n## Parsed Log\n\nSuccess!\n</details>"),
expect(mockCore.summary.write).toHaveBeenCalled(),
fs.unlinkSync(logFile),
fs.rmdirSync(tmpDir));
Expand All @@ -57,7 +57,7 @@ describe("log_parser_bootstrap.cjs", () => {
const mockParseLog = vi.fn().mockReturnValue({ markdown: "## Result\n", mcpFailures: [], maxTurnsHit: !1 });
(runLogParser({ parseLog: mockParseLog, parserName: "TestParser" }),
expect(mockCore.info).toHaveBeenCalledWith("TestParser log parsed successfully"),
expect(mockCore.summary.addRaw).toHaveBeenCalledWith("<details open>\n<summary>🤖 TestParser CLI Session</summary>\n\n## Result\n\n</details>"),
expect(mockCore.summary.addRaw).toHaveBeenCalledWith("<details open>\n<summary>Agentic Conversation</summary>\n\n## Result\n\n</details>"),
expect(mockCore.setFailed).not.toHaveBeenCalled(),
fs.unlinkSync(logFile),
fs.rmdirSync(tmpDir));
Expand Down Expand Up @@ -223,14 +223,17 @@ More content.`;
const mockParseLog = vi.fn();
runLogParser({ parseLog: mockParseLog, parserName: "Copilot", supportsDirectories: true });

// Should transform headers (# to ##, ## to ###, etc.)
// Should transform headers (# to ##, ## to ###, etc.) and wrap in details/summary
const summaryCall = mockCore.summary.addRaw.mock.calls[0];
expect(summaryCall).toBeDefined();
// Content should be wrapped in details/summary with "Agentic Conversation" title
expect(summaryCall[0]).toContain("<details open>");
expect(summaryCall[0]).toContain("<summary>Agentic Conversation</summary>");
expect(summaryCall[0]).toContain("</details>");
// Should transform headers (# to ##, ## to ###, etc.)
expect(summaryCall[0]).toContain("## Main Title");
expect(summaryCall[0]).toContain("### Section 1");
expect(summaryCall[0]).toContain("#### Subsection");
// Verify the original header level was transformed (check start of line)
expect(summaryCall[0].split("\n")[0]).toBe("## Main Title");

// Parser should not be called since conversation.md is used directly
expect(mockParseLog).not.toHaveBeenCalled();
Expand Down
3 changes: 1 addition & 2 deletions actions/setup/js/log_parser_shared.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1430,8 +1430,7 @@ function wrapAgentLogInSection(markdown, options = {}) {
}

const openAttr = open ? " open" : "";
const emoji = "🤖";
const title = `${emoji} ${parserName} CLI Session`;
const title = "Agentic Conversation";

return `<details${openAttr}>\n<summary>${title}</summary>\n\n${markdown}\n</details>`;
Comment on lines 1432 to 1435
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapAgentLogInSection now hard-codes the summary title, so parserName (and its JSDoc describing it) no longer affects output. To avoid confusion for future maintainers, please update the function contract to reflect this (e.g., note parserName is accepted only for backward compatibility and ignored, or rename the destructured variable to _parserName / remove it from destructuring while still accepting it in options).

Copilot uses AI. Check for mistakes.
}
Expand Down
6 changes: 3 additions & 3 deletions actions/setup/js/log_parser_shared.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ describe("log_parser_shared.cjs", () => {
const result = wrapAgentLogInSection(markdown, { parserName: "Copilot" });

expect(result).toContain("<details open>");
expect(result).toContain("<summary>🤖 Copilot CLI Session</summary>");
expect(result).toContain("<summary>Agentic Conversation</summary>");
expect(result).toContain(markdown);
expect(result).toContain("</details>");
});
Expand All @@ -2106,7 +2106,7 @@ describe("log_parser_shared.cjs", () => {
const markdown = "Test content";
const result = wrapAgentLogInSection(markdown, { parserName: "Claude" });

expect(result).toContain("🤖 Claude CLI Session");
expect(result).toContain("Agentic Conversation");
Comment on lines 2106 to +2109
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test name/intent is now inconsistent with the behavior being asserted: it says "should support custom parser names", but the title is intentionally static. Rename the test (and optionally stop passing parserName here) to reflect that parserName is ignored for the summary title and is retained only for backward compatibility.

Copilot uses AI. Check for mistakes.
});

it("should allow closed state when open is false", async () => {
Expand All @@ -2125,7 +2125,7 @@ describe("log_parser_shared.cjs", () => {
const markdown = "Test content";
const result = wrapAgentLogInSection(markdown);

expect(result).toContain("🤖 Agent CLI Session");
expect(result).toContain("Agentic Conversation");
});

it("should return empty string for empty or undefined markdown", async () => {
Expand Down
Loading