MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getTrackingKey

Function getTrackingKey

src/services/api/promptCacheBreakDetection.ts:149–158  ·  view source on GitHub ↗

* Returns the tracking key for a querySource, or null if untracked. * Compact shares the same server-side cache as repl_main_thread * (same cacheSafeParams), so they share tracking state. * * For subagents with a tracked querySource, uses the unique agentId to * isolate tracking state. This pre

(
  querySource: QuerySource,
  agentId?: AgentId,
)

Source from the content-addressed store, hash-verified

147 * logged via tengu_api_success for analytics.
148 */
149function getTrackingKey(
150 querySource: QuerySource,
151 agentId?: AgentId,
152): string | null {
153 if (querySource === 'compact') return 'repl_main_thread'
154 for (const prefix of TRACKED_SOURCE_PREFIXES) {
155 if (querySource.startsWith(prefix)) return agentId || querySource
156 }
157 return null
158}
159
160function stripCacheControl(
161 items: ReadonlyArray<Record<string, unknown>>,

Callers 4

recordPromptStateFunction · 0.85
notifyCacheDeletionFunction · 0.85
notifyCompactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected