MCPcopy Create free account
hub / github.com/Noumena-Network/code / logModeDecision

Function logModeDecision

src/utils/toolSearch.ts:397–418  ·  view source on GitHub ↗
(
    enabled: boolean,
    mode: ToolSearchMode,
    reason: string,
    extraProps?: Record<string, number>,
  )

Source from the content-addressed store, hash-verified

395
396 // Helper to log the mode decision event
397 function logModeDecision(
398 enabled: boolean,
399 mode: ToolSearchMode,
400 reason: string,
401 extraProps?: Record<string, number>,
402 ): void {
403 logEvent('ncode_tool_search_mode_decision', {
404 enabled,
405 mode: mode as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
406 reason:
407 reason as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
408 // Log the actual model being checked, not the session's main model.
409 // This is important for debugging subagent tool search decisions where
410 // the subagent model (e.g., haiku) differs from the session model (e.g., opus).
411 checkedModel:
412 model as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
413 mcpToolCount,
414 userType: (process.env.USER_TYPE ??
415 'external') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
416 ...extraProps,
417 })
418 }
419
420 // Check if model supports tool_reference
421 if (!modelSupportsToolReference(model)) {

Callers 1

isToolSearchEnabledFunction · 0.85

Calls 1

logEventFunction · 0.50

Tested by

no test coverage detected