@bitkyc08/opencodex
Version:
Universal provider proxy for OpenAI Codex & Claude Code — use any LLM with Codex CLI/App/SDK and Claude Code
22 lines (17 loc) • 973 B
text/typescript
import type { OcxConfig } from "../types";
import { deleteConfigTopLevelKey } from "../config/rebase-provenance";
/** Whether an account is administratively excluded from future pool selection. */
export function isCodexAccountPaused(config: OcxConfig, accountId: string): boolean {
return config.pausedCodexAccountIds?.includes(accountId) ?? false;
}
/** Persist the account's pool eligibility without changing credentials or runtime health. */
export function setCodexAccountPaused(config: OcxConfig, accountId: string, paused: boolean): void {
const pausedIds = new Set(config.pausedCodexAccountIds ?? []);
if (paused) pausedIds.add(accountId);
else pausedIds.delete(accountId);
if (pausedIds.size > 0) config.pausedCodexAccountIds = [...pausedIds];
else deleteConfigTopLevelKey(config, "pausedCodexAccountIds");
}
export function forgetCodexAccountPause(config: OcxConfig, accountId: string): void {
setCodexAccountPaused(config, accountId, false);
}