MCPcopy
hub / github.com/openai/codex-plugin-cc / loadBrokerSession

Function loadBrokerSession

plugins/codex/scripts/lib/broker-lifecycle.mjs:76–87  ·  view source on GitHub ↗
(cwd)

Source from the content-addressed store, hash-verified

74}
75
76export function loadBrokerSession(cwd) {
77 const stateFile = resolveBrokerStateFile(cwd);
78 if (!fs.existsSync(stateFile)) {
79 return null;
80 }
81
82 try {
83 return JSON.parse(fs.readFileSync(stateFile, "utf8"));
84 } catch {
85 return null;
86 }
87}
88
89export function saveBrokerSession(cwd, session) {
90 const stateDir = resolveStateDir(cwd);

Callers 5

runtime.test.mjsFile · 0.90
handleSessionEndFunction · 0.90
getSessionRuntimeStatusFunction · 0.90
connectMethod · 0.90
ensureBrokerSessionFunction · 0.85

Calls 1

resolveBrokerStateFileFunction · 0.85

Tested by

no test coverage detected