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

Function log

src/index.js:427–435  ·  view source on GitHub ↗
(client, level, message, extra)

Source from the content-addressed store, hash-verified

425 }
426}
427async function readStateFile(directory, sessionID) {
428 const target = statePath(directory, sessionID);
429 const attempts = 5;
430 for (let attempt = 0;attempt < attempts; attempt++) {
431 try {
432 const parsed = JSON.parse(await fs.readFile(target, "utf8"));
433 return { version: 4, jobs: Array.isArray(parsed.jobs) ? parsed.jobs : [] };
434 } catch (error) {
435 if (error?.code === "ENOENT")
436 return { version: 4, jobs: [] };
437 const transient = error instanceof SyntaxError || isRetriableStateWriteError(error);
438 if (!transient || attempt === attempts - 1)

Callers 3

fireSdkFunction · 0.85
compactSessionFunction · 0.85
OpenCodeLoopPluginFunction · 0.85

Calls 1

sdkCallFunction · 0.85

Tested by

no test coverage detected