fix(runtime): derive unattributed cost from usage status
This commit is contained in:
1 parent
f107415f4f
commit
ebcc15c68d
8 files changed
+61
-7
No files matched your search
@@ -3,6 +3,7 @@ import {
|
||||
classifyRunUsage,
|
||||
deriveLegacyRunUsageStatus,
|
||||
hasAttributableAssistantUsage,
|
||||
isUsageStatusUnattributed,
|
||||
} from "../../src/main/run-usage-status";
|
||||
|
||||
describe("run usage status", () => {
|
||||
@@ -81,4 +82,11 @@ describe("run usage status", () => {
|
||||
);
|
||||
expect(deriveLegacyRunUsageStatus({ runStatus: "failed", unattributedCost: true })).toBe("pre_first_message");
|
||||
});
|
||||
|
||||
it("derives the legacy unattributed-cost flag from usage status", () => {
|
||||
expect(isUsageStatusUnattributed("ok")).toBe(false);
|
||||
expect(isUsageStatusUnattributed("pre_first_message")).toBe(true);
|
||||
expect(isUsageStatusUnattributed("error_stop")).toBe(true);
|
||||
expect(isUsageStatusUnattributed("aborted_before_usage")).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user