MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / estimateTokens

Method estimateTokens

src/agent/loop.ts:2659–2670  ·  view source on GitHub ↗
(messages: Message[])

Source from the content-addressed store, hash-verified

2657 if (op.operation === 'delete') continue;
2658 // Fire-and-forget: don't block the agent loop on indexing
2659 indexer.indexFile(op.path).catch(e => logger.debug('Live indexFile failed', { err: e.message }));
2660 }
2661 }
2662 // Record touched (non-deleted) files so the auto-verify gate can type-check
2663 // exactly what this run changed when the model tries to finish.
2664 for (const op of txn.operations) {
2665 if (op.operation !== 'delete') touchedSourceFiles.add(op.path);
2666 }
2667 } catch (e: any) {
2668 logger.warn('Transaction commit failed', { err: e.message });
2669 // Edits are already on disk but the journal/commit didn't finalize, so
2670 // /undo and verify-baseline won't cover this turn. Surface it the same
2671 // way we surface git-tracking issues above (don't let it pass silently).
2672 yield {
2673 type: 'tool_ui',

Callers 3

runMethod · 0.95
runCompactionMethod · 0.95
pruneMessagesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected