mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-04-17 19:11:33 +00:00
refactor: removed the token calculator logic
The information given was not accurate for the model providers
This commit is contained in:
@@ -129,8 +129,7 @@ function transformCodexEvent(event) {
|
||||
|
||||
case 'turn.completed':
|
||||
return {
|
||||
type: 'turn_complete',
|
||||
usage: event.usage
|
||||
type: 'turn_complete'
|
||||
};
|
||||
|
||||
case 'turn.failed':
|
||||
@@ -279,12 +278,6 @@ export async function queryCodex(command, options = {}, ws) {
|
||||
error: terminalFailure
|
||||
});
|
||||
}
|
||||
|
||||
// Extract and send token usage if available (normalized to match Claude format)
|
||||
if (event.type === 'turn.completed' && event.usage) {
|
||||
const totalTokens = (event.usage.input_tokens || 0) + (event.usage.output_tokens || 0);
|
||||
sendMessage(ws, createNormalizedMessage({ kind: 'status', text: 'token_budget', tokenBudget: { used: totalTokens, total: 200000 }, sessionId: currentSessionId, provider: 'codex' }));
|
||||
}
|
||||
}
|
||||
|
||||
// Send completion event
|
||||
|
||||
Reference in New Issue
Block a user