MCPcopy
hub / github.com/coder/mux / detachLanguageModelCleanup

Function detachLanguageModelCleanup

src/node/services/languageModelCleanup.ts:29–37  ·  view source on GitHub ↗
(model: LanguageModel)

Source from the content-addressed store, hash-verified

27// step so move/run callers can't accidentally leave a stale cleanup behind that
28// would re-fire on a later run.
29function detachLanguageModelCleanup(model: LanguageModel): LanguageModelCleanup | undefined {
30 const modelWithCleanup = model as LanguageModelWithCleanup;
31 const cleanup = modelWithCleanup[languageModelCleanupSymbol];
32 if (cleanup === undefined) {
33 return undefined;
34 }
35 delete modelWithCleanup[languageModelCleanupSymbol];
36 return cleanup;
37}
38
39export function moveLanguageModelCleanup(source: LanguageModel, target: LanguageModel): void {
40 const cleanup = detachLanguageModelCleanup(source);

Callers 2

moveLanguageModelCleanupFunction · 0.85
runLanguageModelCleanupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected