MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / resetProject

Function resetProject

graph-ui/src/browser-ai/BrowserChatDock.tsx:502–521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

500 }
501 };
502 const resetProject = (): void => {
503 if (!runtime.current || phase === 'preparing' || phase === 'removing') { release(); return; }
504 const retainedRuntime = runtime.current;
505 const settled = operationSettled.current;
506 if (autoRun.current) autoRun.current.cancelled = true;
507 if (manualRequest.current) manualRequest.current.cancelled = true;
508 autoRun.current = undefined; manualRequest.current = undefined;
509 lastAttempt.current = undefined; activeTurn.current = undefined;
510 setQuestionQueued(false); setExplanation(undefined); setError(undefined);
511 const ticket = ++epoch.current;
512 pending.current = !!settled; stopRequested.current = !!settled; setStopping(!!settled);
513 if (!settled) { setPhase('ready'); return; }
514 // Retain downloaded weights across projects, but drain the old worker request
515 // before making the new project's context eligible for inference.
516 setPhase('counting'); retainedRuntime.stop();
517 void settled.then(() => {
518 if (epoch.current !== ticket || runtime.current !== retainedRuntime) return;
519 pending.current = false; stopRequested.current = false; setStopping(false); setPhase('ready');
520 });
521 };
522 const handoverOf = (current: BrowserChatRuntime, modelId: string): AgentHandover => ({ runtime: current, modelId,
523 ...operationSettled.current ? { settled: operationSettled.current } : {}, ...loading.current ? { ready: loading.current.ready, progress: loading.current.progress } : {} });
524 /** Gives the model to the dock of the next project (K24). What this dock was doing stops,

Callers 1

BrowserChatDockFunction · 0.85

Calls 2

releaseFunction · 0.70
stopMethod · 0.65

Tested by

no test coverage detected