(initialModel: string)
| 118 | } |
| 119 | |
| 120 | function createCodexState(initialModel: string): CodexParseState { |
| 121 | return { |
| 122 | requests: [], |
| 123 | firstTs: null, |
| 124 | lastTs: null, |
| 125 | currentUserMessage: '', |
| 126 | currentAssistantTexts: [], |
| 127 | currentToolsUsed: [], |
| 128 | currentEditedFiles: [], |
| 129 | currentReferencedFiles: [], |
| 130 | currentSkillsUsed: [], |
| 131 | turnModel: initialModel, |
| 132 | turnEffort: null, |
| 133 | turnStartTs: null, |
| 134 | turnCanceled: false, |
| 135 | prevTotalInput: 0, |
| 136 | prevTotalOutput: 0, |
| 137 | curTotalInput: 0, |
| 138 | curTotalOutput: 0, |
| 139 | curTotalCachedInput: 0, |
| 140 | hasTokenData: false, |
| 141 | }; |
| 142 | } |
| 143 | |
| 144 | function computeModelUsage(state: CodexParseState, model: string): Record<string, ModelUsage> | undefined { |
| 145 | if (!state.hasTokenData || (state.curTotalInput <= 0 && state.curTotalOutput <= 0)) return undefined; |
no outgoing calls
no test coverage detected