From 7ef45a3f50a52071322158756b8b1e396182622f Mon Sep 17 00:00:00 2001 From: soobing Date: Mon, 27 Apr 2026 22:03:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20API=20=EC=82=AC=EC=9A=A9=EB=9F=89=20?= =?UTF-8?q?=ED=91=9C=20=EC=9A=94=EC=B2=AD=20=EB=B2=88=ED=98=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20#=20=EC=A0=9C=EA=B1=B0=20(PR=20=EC=9E=90=EB=8F=99?= =?UTF-8?q?=20=EB=A7=81=ED=81=AC=20=ED=9A=8C=ED=94=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `#1`, `#2` 형태가 GitHub의 PR/issue 자동 링크 대상이 되어 실제 PR #1, #2 로 잘못 연결되던 문제. 헤더가 이미 "요청"이라 의미가 분명하므로 숫자만 표기한다. Co-Authored-By: Claude Opus 4.7 Co-Authored-By: sounmind <37020415+sounmind@users.noreply.github.com> --- tests/learningComment.test.js | 10 +++++----- utils/learningComment.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/learningComment.test.js b/tests/learningComment.test.js index eb74a3d..20f1fd3 100644 --- a/tests/learningComment.test.js +++ b/tests/learningComment.test.js @@ -50,7 +50,7 @@ describe("upsertLearningStatusComment — usage history accumulation", () => { const body = parseBody(post); expect(body).toContain("🔢 API 사용량 (gpt-4.1-nano)"); - expect(body).toContain("| #1 | 100 | 50 | 150 |"); + expect(body).toContain("| 1 | 100 | 50 | 150 |"); // single-row history => no totals row expect(body).not.toContain("**합계**"); // hidden marker stores an array @@ -99,9 +99,9 @@ describe("upsertLearningStatusComment — usage history accumulation", () => { const body = parseBody(patch); // all three calls present, in order - expect(body).toContain("| #1 | 100 | 50 | 150 |"); - expect(body).toContain("| #2 | 200 | 80 | 280 |"); - expect(body).toContain("| #3 | 300 | 120 | 420 |"); + expect(body).toContain("| 1 | 100 | 50 | 150 |"); + expect(body).toContain("| 2 | 200 | 80 | 280 |"); + expect(body).toContain("| 3 | 300 | 120 | 420 |"); // totals row appears once history.length > 1 expect(body).toContain("| **합계** | **600** | **250** | **850** |"); // marker is rewritten with the full array @@ -146,7 +146,7 @@ describe("upsertLearningStatusComment — usage history accumulation", () => { const patch = calls.find((c) => c.init.method === "PATCH"); const body = parseBody(patch); - expect(body).toContain("| #1 | 999 | 111 | 1,110 |"); + expect(body).toContain("| 1 | 999 | 111 | 1,110 |"); expect(body).not.toContain("**합계**"); globalThis.fetch = originalFetch; diff --git a/utils/learningComment.js b/utils/learningComment.js index 4dfad34..ed7ac0d 100644 --- a/utils/learningComment.js +++ b/utils/learningComment.js @@ -84,7 +84,7 @@ function formatUsageSection(history) { const { prompt, completion } = history[i]; const total = prompt + completion; const cost = calcCost(prompt, completion); - lines.push(`| #${i + 1} | ${fmt(prompt)} | ${fmt(completion)} | ${fmt(total)} | $${cost.toFixed(6)} |`); + lines.push(`| ${i + 1} | ${fmt(prompt)} | ${fmt(completion)} | ${fmt(total)} | $${cost.toFixed(6)} |`); totalPrompt += prompt; totalCompletion += completion; }