MCPcopy Create free account
hub / github.com/SethGammon/Citadel / writeState

Function writeState

hooks_src/circuit-breaker.js:68–74  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

66 const dir = path.dirname(STATE_FILE);
67 if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
68 const tmpFile = STATE_FILE + '.tmp';
69 fs.writeFileSync(tmpFile, JSON.stringify(state, null, 2));
70 fs.renameSync(tmpFile, STATE_FILE);
71}
72
73/**
74 * Handle PostToolUseFailure: track consecutive failures, trip on threshold.
75 */
76function handleFailure(event) {
77 const toolName = event.tool_name || 'unknown';

Callers 2

handleFailureFunction · 0.70
handleBashHangCheckFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected