666db0b939
Persist goal runs in MySQL, bind agent runs to checkpoints, expose awaiting-approval UX in chat, and add admin inspection routes with local verify scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
455 B
JavaScript
15 lines
455 B
JavaScript
function envFlag(value, fallback = false) {
|
|
const raw = String(value ?? '').trim().toLowerCase();
|
|
if (!raw) return fallback;
|
|
return ['1', 'true', 'yes', 'on'].includes(raw);
|
|
}
|
|
|
|
export function shouldRequireCheckpointApproval({
|
|
env = process.env,
|
|
pendingCheckpointCount = 0,
|
|
totalCheckpointCount = 1,
|
|
} = {}) {
|
|
if (envFlag(env.GOAL_RUN_REQUIRE_APPROVAL, false)) return true;
|
|
return pendingCheckpointCount > 0 && totalCheckpointCount > 1;
|
|
}
|