fix: scope codex-pool sentinel image to enabled targets

This commit is contained in:
Codex
2026-06-26 04:04:42 +00:00
parent d60813381d
commit 203b3e208a
5 changed files with 48 additions and 14 deletions
@@ -67,6 +67,7 @@ EXPECTED_ACCOUNT_TEMP_UNSCHEDULABLE = json.loads(${JSON.stringify(JSON.stringify
MANUAL_ACCOUNT_PROTECTIONS = json.loads(${JSON.stringify(JSON.stringify(resolvedManualAccountProtections(pool, target)))})
SENTINEL_CONFIG = json.loads(${JSON.stringify(JSON.stringify(pool.sentinel))})
TARGET_EGRESS_PROXY = json.loads(${JSON.stringify(JSON.stringify(target.egressProxy))})
TARGET_SENTINEL_ENABLED = ${JSON.stringify(target.sentinelEnabled)}
MODE = "${mode}"
PAYLOAD_B64 = "${encodedPayload}"
@@ -166,7 +167,7 @@ def empty_to_none(value):
return value if isinstance(value, str) and value else None
def sentinel_quality_gate_enabled():
return (SENTINEL_CONFIG.get("monitor") or {}).get("enabled") is True and (SENTINEL_CONFIG.get("actions") or {}).get("enabled") is True
return TARGET_SENTINEL_ENABLED and (SENTINEL_CONFIG.get("monitor") or {}).get("enabled") is True and (SENTINEL_CONFIG.get("actions") or {}).get("enabled") is True
def account_notes_fingerprint(account):
notes = account.get("notes") if isinstance(account, dict) else None
@@ -981,6 +982,12 @@ def ensure_api_key_secret(group_id):
return api_key, secret_action, text(proc.stdout, 1000)
def apply_sentinel_manifest(manifest):
if not TARGET_SENTINEL_ENABLED:
return {
"ok": True,
"action": "skipped-target-disabled",
"valuesPrinted": False,
}
if not isinstance(manifest, str) or not manifest.strip():
return {
"ok": False,
@@ -1433,6 +1440,8 @@ def sentinel_state_summary():
}
def reassert_sentinel_freezes_after_sync(token):
if not TARGET_SENTINEL_ENABLED:
return {"ok": True, "skipped": True, "reason": "target-disabled", "items": [], "valuesPrinted": False}
if (SENTINEL_CONFIG.get("actions") or {}).get("enabled") is not True:
return {"ok": True, "skipped": True, "reason": "actions-disabled", "items": [], "valuesPrinted": False}
_, state = sentinel_state_object()