diff --git a/actions/setup/js/messages.test.cjs b/actions/setup/js/messages.test.cjs index 7bcd881c630..6697556a369 100644 --- a/actions/setup/js/messages.test.cjs +++ b/actions/setup/js/messages.test.cjs @@ -354,7 +354,7 @@ describe("messages.cjs", () => { expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123/custom_path)"); }); - it("should include effective tokens from env var when not passed in context", async () => { + it("should not include effective tokens from env var in default footer", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "12500"; const { getFooterMessage } = await import("./messages.cjs"); @@ -364,10 +364,10 @@ describe("messages.cjs", () => { runUrl: "https://github.com/test/repo/actions/runs/123", }); - expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · 12.5K"); + expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123)"); }); - it("should prepend reduced model identifier to effective tokens when engine model is set", async () => { + it("should not append model-prefixed effective tokens in default footer", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "12500"; process.env.GH_AW_ENGINE_MODEL = "claude-sonnet-4.6"; @@ -378,10 +378,10 @@ describe("messages.cjs", () => { runUrl: "https://github.com/test/repo/actions/runs/123", }); - expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · sonnet46 12.5K"); + expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123)"); }); - it("should include effective tokens from env var before history link", async () => { + it("should include history link without effective tokens in default footer", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "5000"; const historyUrl = "https://github.com/search?q=repo:test/repo+is:issue&type=issues"; @@ -393,10 +393,10 @@ describe("messages.cjs", () => { historyUrl, }); - expect(result).toBe(`> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · 5K · [◷](${historyUrl})`); + expect(result).toBe(`> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · [◷](${historyUrl})`); }); - it("should include AI Credits next to effective tokens when GH_AW_AIC is set", async () => { + it("should include AI Credits without effective tokens when GH_AW_AIC is set", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "5000"; process.env.GH_AW_AIC = "0.125"; @@ -407,7 +407,7 @@ describe("messages.cjs", () => { runUrl: "https://github.com/test/repo/actions/runs/123", }); - expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · 5K · 0.125 AIC"); + expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · 0.125 AIC"); }); it("should not include effective tokens when GH_AW_EFFECTIVE_TOKENS is not set and not passed in context", async () => { @@ -424,7 +424,7 @@ describe("messages.cjs", () => { expect(result).not.toContain("●"); }); - it("should prefer effectiveTokens from context over env var", async () => { + it("should ignore context and env effectiveTokens for default footer", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "99000"; const { getFooterMessage } = await import("./messages.cjs"); @@ -435,7 +435,7 @@ describe("messages.cjs", () => { effectiveTokens: 5000, }); - expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · 5K"); + expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123)"); expect(result).not.toContain("99K"); }); @@ -522,7 +522,7 @@ describe("messages.cjs", () => { expect(result).toBe("> Custom: [Test Workflow](https://github.com/test/repo/actions/runs/123) · gpt55 5K"); }); - it("should preserve mini-tier gpt identifiers in footer suffixes", async () => { + it("should not include mini-tier model identifiers in default footer suffixes", async () => { const { getFooterMessage } = await import("./messages.cjs"); const result = getFooterMessage({ @@ -532,7 +532,7 @@ describe("messages.cjs", () => { effectiveTokens: 5000, }); - expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · gpt54mini 5K"); + expect(result).toBe("> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123)"); }); it("should append slash command hint when slashCommand is provided", async () => { @@ -559,7 +559,7 @@ describe("messages.cjs", () => { expect(result).not.toContain(""); }); - it("should include slash command hint after tokens and history link", async () => { + it("should include slash command hint after history link", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "5000"; const historyUrl = "https://github.com/search?q=repo:test"; @@ -572,7 +572,7 @@ describe("messages.cjs", () => { slashCommand: "deploy", }); - expect(result).toBe(`> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · 5K · [◷](${historyUrl})\n> Comment /deploy to run again`); + expect(result).toBe(`> Generated by [Test Workflow](https://github.com/test/repo/actions/runs/123) · [◷](${historyUrl})\n> Comment /deploy to run again`); }); it("should NOT include slash command hint in custom footer templates", async () => { @@ -1018,7 +1018,7 @@ describe("messages.cjs", () => { expect(result).not.toContain("●"); }); - it("should include effective tokens in default footer when env var is set", async () => { + it("should not include effective tokens in default footer when env var is set", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "12500"; const { getFooterAgentFailureIssueMessage } = await import("./messages.cjs"); @@ -1028,10 +1028,10 @@ describe("messages.cjs", () => { runUrl: "https://github.com/test/repo/actions/runs/123", }); - expect(result).toBe("> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123) · 12.5K"); + expect(result).toBe("> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123)"); }); - it("should include effective tokens before history link in default footer", async () => { + it("should include history link without effective tokens in default footer", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "5000"; const historyUrl = "https://github.com/search?q=repo:test/repo+is:issue&type=issues"; @@ -1043,7 +1043,7 @@ describe("messages.cjs", () => { historyUrl, }); - expect(result).toBe(`> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123) · 5K · [◷](${historyUrl})`); + expect(result).toBe(`> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123) · [◷](${historyUrl})`); }); it("should not include effective tokens in custom footer unless placeholder is used", async () => { @@ -1093,7 +1093,7 @@ describe("messages.cjs", () => { expect(result).not.toContain("●"); }); - it("should include effective tokens in default footer when env var is set", async () => { + it("should not include effective tokens in default footer when env var is set", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "12500"; const { getFooterAgentFailureCommentMessage } = await import("./messages.cjs"); @@ -1103,10 +1103,10 @@ describe("messages.cjs", () => { runUrl: "https://github.com/test/repo/actions/runs/123", }); - expect(result).toBe("> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123) · 12.5K"); + expect(result).toBe("> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123)"); }); - it("should include effective tokens before history link in default footer", async () => { + it("should include history link without effective tokens in default footer", async () => { process.env.GH_AW_EFFECTIVE_TOKENS = "5000"; const historyUrl = "https://github.com/search?q=repo:test/repo+is:issue&type=issues"; @@ -1118,7 +1118,7 @@ describe("messages.cjs", () => { historyUrl, }); - expect(result).toBe(`> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123) · 5K · [◷](${historyUrl})`); + expect(result).toBe(`> Generated from [Test Workflow](https://github.com/test/repo/actions/runs/123) · [◷](${historyUrl})`); }); it("should not include effective tokens in custom footer unless placeholder is used", async () => { diff --git a/actions/setup/js/messages_footer.cjs b/actions/setup/js/messages_footer.cjs index ea5c74916d2..f0a6820d107 100644 --- a/actions/setup/js/messages_footer.cjs +++ b/actions/setup/js/messages_footer.cjs @@ -185,10 +185,6 @@ function getFooterMessage(ctx) { if (ctx.triggeringNumber) { defaultFooter += " for issue #{triggering_number}"; } - // Append effective tokens when available (compact format, no "ET" label) - if (effectiveTokens) { - defaultFooter += effectiveTokensSuffix; - } if (aiCredits) { defaultFooter += aiCreditsSuffix; } @@ -328,10 +324,6 @@ function getFooterAgentFailureIssueMessage(ctx) { } else { // Default footer template with link to workflow run let defaultFooter = "> Generated from [{workflow_name}]({run_url})"; - // Append effective tokens when available (compact format, no "ET" label) - if (effectiveTokens) { - defaultFooter += `{effective_tokens_suffix}`; - } // Append history link when available if (ctx.historyUrl) { defaultFooter += " · [◷]({history_url})"; @@ -370,10 +362,6 @@ function getFooterAgentFailureCommentMessage(ctx) { } else { // Default footer template with link to workflow run let defaultFooter = "> Generated from [{workflow_name}]({run_url})"; - // Append effective tokens when available (compact format, no "ET" label) - if (effectiveTokens) { - defaultFooter += `{effective_tokens_suffix}`; - } // Append history link when available if (ctx.historyUrl) { defaultFooter += " · [◷]({history_url})";