MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / rememberSession

Function rememberSession

src/index.js:471–475  ·  view source on GitHub ↗
(directory, client, sessionID)

Source from the content-addressed store, hash-verified

469 const temp = path.join(os.tmpdir(), `opencode-loop-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}.tmp`);
470 await fs.writeFile(temp, contents, encoding);
471 try {
472 let lastError;
473 for (let attempt = 0;attempt < attempts; attempt++) {
474 try {
475 await fs.rename(temp, target);
476 return;
477 } catch (error) {
478 lastError = error;

Callers 3

maybeRunDueJobsFunction · 0.85
handleCommandFunction · 0.85
OpenCodeLoopPluginFunction · 0.85

Calls 2

nowFunction · 0.85
startHeartbeatFunction · 0.85

Tested by

no test coverage detected