MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / createCodexState

Function createCodexState

src/core/parser-codex.ts:120–142  ·  view source on GitHub ↗
(initialModel: string)

Source from the content-addressed store, hash-verified

118}
119
120function 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
144function computeModelUsage(state: CodexParseState, model: string): Record<string, ModelUsage> | undefined {
145 if (!state.hasTokenData || (state.curTotalInput <= 0 && state.curTotalOutput <= 0)) return undefined;

Callers 1

parseCodexSessionFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected