MCPcopy Index your code
hub / github.com/coder/mux / resetForkedSessionUsage

Function resetForkedSessionUsage

src/node/services/workspaceService.ts:789–803  ·  view source on GitHub ↗
(
  sessionUsageService: SessionUsageService | undefined,
  workspaceId: string,
  sessionDir: string
)

Source from the content-addressed store, hash-verified

787}
788
789async function resetForkedSessionUsage(
790 sessionUsageService: SessionUsageService | undefined,
791 workspaceId: string,
792 sessionDir: string
793): Promise<void> {
794 if (sessionUsageService) {
795 await sessionUsageService.resetSessionUsage(workspaceId);
796 return;
797 }
798
799 await fsPromises.writeFile(
800 path.join(sessionDir, "session-usage.json"),
801 JSON.stringify({ byModel: {}, version: 1 }, null, 2)
802 );
803}
804
805async function materializeForkedPartialSnapshot(params: {
806 historyService: HistoryService;

Callers 1

forkMethod · 0.85

Calls 2

resetSessionUsageMethod · 0.80
writeFileMethod · 0.65

Tested by

no test coverage detected