You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(selfhost): distinguish a stale codex-reviewer flag name from unconfigured and cool down its breaker (#7473)
The GITTENSORY_→LOOPOVER_ env rebrand (#5652) retired dual-read of
GITTENSORY_ENABLE_UNSAFE_CODEX_REVIEWER and hardcoded a strict
LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER === "1" check. An operator whose .env
still uses the legacy name silently reverts to fully-disabled and gets the
exact same generic codex_credential_isolation_required error as someone who
never opted in at all — no signal telling them to rename the var.
Recognize the retired flag name in assertCodexCredentialIsolation (without
honoring it) and throw an actionable "rename it to
LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER" message, but only when the current flag
isn't already correctly set so a mounted CODEX_HOME isn't mislabeled a rename
problem. The message keeps the codex_credential_isolation_required prefix so
the structural circuit breaker still recognizes it. Read via a constant rather
than env.GITTENSORY_... so the retired name stays out of the generated
self-host env reference.
Also widen isStructuralProviderConfigError's regex to match
codex_credential_isolation_required (bare or with a ": rename …" suffix). It's
a deterministic config failure, so it now earns the hour-long structural
cooldown instead of retrying every 60s — the flood pattern that breaker exists
to prevent.
Closes#7466
Co-authored-by: bitfathers94 <237535319+bitfathers94@users.noreply.github.com>
`codex_credential_isolation_required: ${LEGACY_UNSAFE_CODEX_REVIEWER_FLAG} is set but was retired in #5652; rename it to LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER`,
it("isStructuralProviderConfigError matches only codex's own structural-config error messages, not other Errors or non-Error throws (GITTENSORY-K/8)",()=>{
3078
3078
expect(isStructuralProviderConfigError(newError("codex_auth_not_configured: ~/.codex/auth.json not found"))).toBe(true);
3079
3079
expect(isStructuralProviderConfigError(newError("codex_no_auth: auth.json missing or expired"))).toBe(true);
3080
+
// The fail-closed credential-isolation guard is equally deterministic, thrown either bare (never opted in) or
3081
+
// with a `: rename …` detail suffix (legacy flag name still set) -- both must earn the structural cooldown (#7466).
"codex_credential_isolation_required: GITTENSORY_ENABLE_UNSAFE_CODEX_REVIEWER is set but was retired in #5652; rename it to LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER",
3087
+
),
3088
+
),
3089
+
).toBe(true);
3090
+
// Prefix-anchored, but must not match a longer look-alike token that merely starts with the same characters.
it("credential isolation: an operator still on the retired GITTENSORY_ flag name gets an actionable rename error, not the generic one (#7466)",async()=>{
1949
+
constshouldNotSpawn: StubSpawn=async()=>{
1950
+
thrownewError("spawned");
1951
+
};
1952
+
// Legacy flag set (and the current LOOPOVER_ one absent) — the operator opted in under the pre-rebrand name and
1953
+
// silently reverted to disabled. The error must name both the retired var and its replacement so it is fixable
1954
+
// without reading the source, and must still carry the codex_credential_isolation_required prefix.
it("credential isolation: a set CODEX_HOME with a valid opt-in is not mislabeled a legacy-rename problem even when the legacy flag is also present (#7466)",async()=>{
1977
+
constshouldNotSpawn: StubSpawn=async()=>{
1978
+
thrownewError("spawned");
1979
+
};
1980
+
// CODEX_HOME is mounted (a distinct failure) while the current opt-in is correctly "1" — the rename branch must
1981
+
// not fire; the operator sees the generic isolation error, not a spurious "rename your flag" instruction.
0 commit comments