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

Function sanitizeSurfaceKey

src/utils/commitAttribution.ts:135–147  ·  view source on GitHub ↗
(surfaceKey: string)

Source from the content-addressed store, hash-verified

133 * Converts internal model variants to their public equivalents.
134 */
135export function sanitizeSurfaceKey(surfaceKey: string): string {
136 // Split surface key into surface and model parts (e.g., "cli/opus-4-5-fast" -> ["cli", "opus-4-5-fast"])
137 const slashIndex = surfaceKey.lastIndexOf('/')
138 if (slashIndex === -1) {
139 return surfaceKey
140 }
141
142 const surface = surfaceKey.slice(0, slashIndex)
143 const model = surfaceKey.slice(slashIndex + 1)
144 const sanitizedModel = sanitizeModelName(model)
145
146 return `${surface}/${sanitizedModel}`
147}
148
149// @[MODEL LAUNCH]: Add a mapping for the new model ID so git commit trailers show the public name.
150/**

Callers

nothing calls this directly

Calls 1

sanitizeModelNameFunction · 0.85

Tested by

no test coverage detected