Skip to content

Commit 69e68d2

Browse files
committed
feat: OpenAI 모델을 gpt-4.1-nano에서 gpt-5-nano로 마이그레이션
- reasoning 모델 호환: max_tokens→max_completion_tokens, temperature 제거→reasoning_effort:minimal - 사용량 비용 단가/라벨을 gpt-5-nano 기준으로 갱신(입력 $0.10→$0.05/1M) - 코드 리뷰 프롬프트에 길이(500자)·한국어 전용 제약 강화
1 parent 7b63ecc commit 69e68d2

5 files changed

Lines changed: 22 additions & 18 deletions

File tree

handlers/complexity-analysis.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,14 @@ export async function callComplexityAnalysis(fileEntries, apiKey) {
255255
"Content-Type": "application/json",
256256
},
257257
body: JSON.stringify({
258-
model: "gpt-4.1-nano",
258+
model: "gpt-5-nano",
259259
messages: [
260260
{ role: "system", content: SYSTEM_PROMPT },
261261
{ role: "user", content: userPrompt },
262262
],
263263
response_format: { type: "json_object" },
264-
max_tokens: 4000,
265-
temperature: 0.2,
264+
max_completion_tokens: 5000,
265+
reasoning_effort: "minimal",
266266
}),
267267
});
268268

tests/learningComment.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("upsertLearningStatusComment — usage history accumulation", () => {
4949
expect(post).toBeDefined();
5050

5151
const body = parseBody(post);
52-
expect(body).toContain("🔢 API 사용량 (gpt-4.1-nano)");
52+
expect(body).toContain("🔢 API 사용량 (gpt-5-nano)");
5353
expect(body).toContain("| 1 | 100 | 50 | 150 |");
5454
// single-row history => no totals row
5555
expect(body).not.toContain("**합계**");

tests/tag-patterns.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function makePrData(overrides = {}) {
6565

6666
/**
6767
* 두 OpenAI 엔드포인트(패턴 분석 N콜 + 복잡도 분석 1콜)를 분기한다.
68-
* 복잡도 호출은 system_prompt 에 "복잡도" 가 포함되거나 max_tokens >= 1000 으로 식별.
68+
* 복잡도 호출은 system_prompt 에 "시간/공간 복잡도를 분석" 이 포함되는지로 식별.
6969
*/
7070
function makeFetchMock({
7171
solutionFiles,

utils/learningComment.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const COMMENT_MARKER = "<!-- dalestudy-learning-status -->";
2020
*/
2121
const USAGE_DATA_RE = /<!-- usage-data: (\[.*?\]) -->/;
2222

23-
/** gpt-4.1-nano pricing (USD per token) */
24-
const INPUT_COST_PER_TOKEN = 0.10 / 1_000_000;
23+
/** gpt-5-nano pricing (USD per token) */
24+
const INPUT_COST_PER_TOKEN = 0.05 / 1_000_000;
2525
const OUTPUT_COST_PER_TOKEN = 0.40 / 1_000_000;
2626

2727
/**
@@ -72,7 +72,7 @@ function parseUsageFromComment(body) {
7272
function formatUsageSection(history) {
7373
const lines = [];
7474
lines.push("<details>");
75-
lines.push("<summary>🔢 API 사용량 (gpt-4.1-nano)</summary>");
75+
lines.push("<summary>🔢 API 사용량 (gpt-5-nano)</summary>");
7676
lines.push("");
7777
lines.push("| 요청 | 입력 토큰 | 출력 토큰 | 합계 | 비용 |");
7878
lines.push("|---:|---:|---:|---:|---:|");

utils/openai.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ PR의 코드 변경 사항을 참고하여 사용자의 질문에 명확하고
3737
3838
단순히 지적만 하지 말고, 격려와 학습이 되는 피드백을 함께 주세요.
3939
해당 사항없는 항목은 생략하고 자연스럽게 작성하세요.
40-
500 글자를 초과하지 말아주세요.
40+
41+
[작성 규칙 — 반드시 지킬 것]
42+
- 전체 응답은 한국어 기준 500자 이내. 절대 초과하지 마세요. 분량이 넘칠 것 같으면 가장 중요한 피드백만 남기고 나머지는 생략하세요.
43+
- 한국어로만 작성하세요. 중국어·일본어 한자나 다른 언어를 섞지 마세요(예: "一致" 금지, "일치" 사용).
44+
- 항목은 3개 이내로 압축하고, 장황한 설명 없이 핵심만 간결하게 쓰세요.
4145
`;
4246

4347
let userPrompt = `# PR Title
@@ -65,13 +69,13 @@ ${prDiff}
6569
"Content-Type": "application/json",
6670
},
6771
body: JSON.stringify({
68-
model: "gpt-4.1-nano",
72+
model: "gpt-5-nano",
6973
messages: [
7074
{ role: "system", content: systemPrompt },
7175
{ role: "user", content: userPrompt },
7276
],
73-
max_tokens: 2000,
74-
temperature: 0.7,
77+
max_completion_tokens: 3000,
78+
reasoning_effort: "minimal",
7579
}),
7680
});
7781

@@ -143,14 +147,14 @@ ${fileContent}
143147
"Content-Type": "application/json",
144148
},
145149
body: JSON.stringify({
146-
model: "gpt-4.1-nano",
150+
model: "gpt-5-nano",
147151
messages: [
148152
{ role: "system", content: systemPrompt },
149153
{ role: "user", content: userPrompt },
150154
],
151155
response_format: { type: "json_object" },
152-
max_tokens: 500,
153-
temperature: 0.3,
156+
max_completion_tokens: 2000,
157+
reasoning_effort: "minimal",
154158
}),
155159
});
156160

@@ -221,14 +225,14 @@ ${truncatedContent}
221225
"Content-Type": "application/json",
222226
},
223227
body: JSON.stringify({
224-
model: "gpt-4.1-nano",
228+
model: "gpt-5-nano",
225229
messages: [
226230
{ role: "system", content: systemPrompt },
227231
{ role: "user", content: userPrompt },
228232
],
229233
response_format: { type: "json_object" },
230-
max_tokens: 200,
231-
temperature: 0.2,
234+
max_completion_tokens: 1500,
235+
reasoning_effort: "minimal",
232236
}),
233237
});
234238

0 commit comments

Comments
 (0)