fix(usage-log): remove redundant taskId field from TokenUsageRecord
taskId was set to params.runId, the same value already stored in the runId field, giving downstream consumers two identical fields with different names. Remove taskId from the type and the entry constructor to avoid confusion.
This commit is contained in:
parent
d03e7ae8ed
commit
cece47f490
@ -3,7 +3,6 @@ import path from "path";
|
||||
|
||||
export type TokenUsageRecord = {
|
||||
id: string;
|
||||
taskId?: string;
|
||||
label: string;
|
||||
tokensUsed: number;
|
||||
tokenLimit?: number;
|
||||
@ -77,7 +76,6 @@ export async function recordTokenUsage(params: {
|
||||
|
||||
const entry: TokenUsageRecord = {
|
||||
id: makeId(),
|
||||
taskId: params.runId,
|
||||
label: params.label,
|
||||
tokensUsed: Math.trunc(total),
|
||||
...(usage.input != null && usage.input > 0 && { inputTokens: Math.trunc(usage.input) }),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user