Skip to content

Commit 23173d5

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/npm-dependencies-5e687ba2ad
2 parents 3b9b445 + bc2919f commit 23173d5

6 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/checkout@v4
3535

3636
- name: Setup Node
37-
uses: actions/setup-node@v4
37+
uses: actions/setup-node@v6
3838
with:
3939
node-version: "20"
4040
cache: 'npm'

.github/workflows/deploy-to-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/checkout@v4
3939

4040
- name: Setup Node
41-
uses: actions/setup-node@v4
41+
uses: actions/setup-node@v6
4242
with:
4343
node-version: "20"
4444
cache: 'npm'
@@ -69,7 +69,7 @@ jobs:
6969
steps:
7070
- name: Deploy to GitHub Pages
7171
id: deployment
72-
uses: actions/deploy-pages@v4
72+
uses: actions/deploy-pages@v5
7373

7474
- name: Smoke Test - Check CSV Upload Button
7575
run: |

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v3
2222

2323
- name: Set up Node.js
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v6
2525
with:
2626
node-version: '22.x'
2727
registry-url: 'https://registry.npmjs.org'
@@ -34,7 +34,7 @@ jobs:
3434
token: ${{ secrets.RELEASE_GITHUB_PAT }}
3535

3636
- name: Set up Go
37-
uses: actions/setup-go@v4
37+
uses: actions/setup-go@v6
3838
with:
3939
go-version: '1.21'
4040

@@ -46,7 +46,7 @@ jobs:
4646
./build/build-release.sh
4747
4848
- name: Create Release and Upload Assets
49-
uses: softprops/action-gh-release@v1
49+
uses: softprops/action-gh-release@v2
5050
with:
5151
files: ./spark-sdk-dist.zip
5252
env:

.github/workflows/tag-rajbos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Tag rajbos on new issue or PR
22-
uses: devops-actions/issue-comment-tag@v0.1.8
22+
uses: devops-actions/issue-comment-tag@v0.1.10
2323
with:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
team: rajbos

src/lib/utils.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,12 @@ export function getModelUsageSummary(data: CopilotUsageData[]): ModelUsageSummar
251251
}
252252

253253
// Calculate excess cost
254-
groupedSummary[key].excessCost = groupedSummary[key].exceedingRequests * groupedSummary[key].multiplier * EXCESS_REQUEST_COST;
254+
// Free models (multiplier = 0) have no excess cost
255+
if (groupedSummary[key].multiplier === 0) {
256+
groupedSummary[key].excessCost = 0;
257+
} else {
258+
groupedSummary[key].excessCost = groupedSummary[key].exceedingRequests * EXCESS_REQUEST_COST;
259+
}
255260
});
256261

257262
// Convert to array and sort by total requests (descending)
@@ -396,7 +401,7 @@ export const MODEL_MULTIPLIERS: Record<string, number> = {
396401
};
397402

398403
// Default models that should be grouped
399-
export const DEFAULT_MODELS = ['GPT-4o', 'GPT-4.1', 'gpt-4o-2024-11-20', 'gpt-4.1-2025-04-14'];
404+
export const DEFAULT_MODELS = ['GPT-4o', 'GPT-4.1', 'GPT-5 mini', 'gpt-4o-2024-11-20', 'gpt-4.1-2025-04-14'];
400405

401406
function normalizeModelName(model: string): string {
402407
return model.replace(/^Auto:\s*/, '').trim();
@@ -952,13 +957,13 @@ export function getExpectedExcessCost(data: CopilotUsageData[], plan: string = C
952957

953958
const numDays = datesForAverage.length;
954959

955-
// Project extra requests per model over remaining days and apply cost multiplier
960+
// Project extra requests per model over remaining days
956961
Object.entries(modelTotals).forEach(([model, total]) => {
957962
const multiplier = getModelMultiplier(model);
958963
if (multiplier === 0) return; // Free models have no cost
959964
const dailyAvg = total / numDays;
960965
const projectedExtra = dailyAvg * remainingDays;
961-
totalExpectedCost += projectedExtra * multiplier * EXCESS_REQUEST_COST;
966+
totalExpectedCost += projectedExtra * EXCESS_REQUEST_COST;
962967
});
963968
});
964969

src/test/model-info-limits.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,15 @@ describe('Model Info and Limits Feature', () => {
9898
expect(defaultGroup).toBeDefined();
9999

100100
if (defaultGroup) {
101-
// 50 exceeding requests * 0x multiplier * $0.04 = $0.00
102-
expect(defaultGroup.excessCost).toBe(50 * 0 * EXCESS_REQUEST_COST);
101+
// Default models are free (multiplier = 0), so excess cost is always $0.00
102+
// even if there are exceeding requests
103+
expect(defaultGroup.excessCost).toBe(0);
103104
}
104-
105+
105106
const o3Model = result.find(item => item.model === 'o3-mini-2025-01-31');
106107
if (o3Model) {
107-
// 10 exceeding requests * 0.33x multiplier * $0.04 = $0.132
108-
expect(o3Model.excessCost).toBe(10 * 0.33 * EXCESS_REQUEST_COST);
108+
// 10 exceeding requests * $0.04 = $0.40
109+
expect(o3Model.excessCost).toBe(10 * EXCESS_REQUEST_COST);
109110
}
110111
});
111112

0 commit comments

Comments
 (0)