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

Method resetSessionUsage

src/node/services/sessionUsageService.ts:375–379  ·  view source on GitHub ↗

* Reset a workspace's persisted cost ledger while keeping copied chat history intact. * * Forked workspaces need an explicit empty session-usage.json so later reads do not * rebuild historical costs from the copied messages.

(workspaceId: string)

Source from the content-addressed store, hash-verified

373 * rebuild historical costs from the copied messages.
374 */
375 async resetSessionUsage(workspaceId: string): Promise<void> {
376 return this.fileLocks.withLock(workspaceId, async () => {
377 await this.writeFile(workspaceId, this.createEmptyUsageFile());
378 });
379 }
380
381 /**
382 * Batch fetch session usage for multiple workspaces.

Callers 2

resetForkedSessionUsageFunction · 0.80

Calls 3

writeFileMethod · 0.95
createEmptyUsageFileMethod · 0.95
withLockMethod · 0.80

Tested by

no test coverage detected