fix(selfhost): distinguish stale codex-reviewer env var, cool down its circuit breaker#7513
Closed
JSONbored wants to merge 1 commit into
Closed
fix(selfhost): distinguish stale codex-reviewer env var, cool down its circuit breaker#7513JSONbored wants to merge 1 commit into
JSONbored wants to merge 1 commit into
Conversation
…s circuit breaker (#7466) Two related gaps in the codex_credential_isolation_required path: 1. The GITTENSORY_->LOOPOVER_ env var rebrand (#5652) retired dual-read support for GITTENSORY_ENABLE_UNSAFE_CODEX_REVIEWER and hardcoded a strict LOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER check. An operator whose .env still uses the legacy name silently reverts to fully-disabled, with no signal distinguishing that from never having configured it at all. assertCodexCredentialIsolation now throws a specific, actionable message in that one case -- CODEX_HOME being the actual blocker still takes priority, since renaming the var can't fix that. 2. isStructuralProviderConfigError's regex didn't match codex_credential_isolation_required, so the per-provider circuit breaker gave it the default 60s cooldown instead of the hour-long structural one -- the exact flood pattern that cooldown was built to prevent (see its own comment citing LOOPOVER-K/8's 2094 + 544 events). Regenerated the branding-drift baseline: the fix's own detection necessarily references the retired "gittensory" env var name in src/selfhost/ai.ts, a genuine increase the drift check correctly flagged.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Owner
Author
|
Superseded by #7473, which merged first and fixes the same root cause (the codex-reviewer env var rename regression + the circuit-breaker regex gap) via an equivalent approach. Closing to avoid landing duplicate/conflicting logic. |
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codex_credential_isolation_requirederrors have been recurring since 2026-07-16 on a self-host install that was previously working (Sentry: LOOPOVER-28/2A/2C/29). The credential-isolation guard itself (assertCodexCredentialIsolation,src/selfhost/ai.ts) is correct, intentional security hardening from#1609— not a bug. The problem is upstream: theGITTENSORY_→LOOPOVER_env var rebrand (#5652) retired dual-read support and hardcoded a strictLOOPOVER_ENABLE_UNSAFE_CODEX_REVIEWER === "1"check. An operator whose.envstill uses the legacy name silently reverts to fully-disabled, with the exact same generic error as never having configured it at all.This is compounded by
isStructuralProviderConfigError's regex not matchingcodex_credential_isolation_required, so the per-provider circuit breaker gives this deterministic failure the default 60s cooldown instead of the hour-long structural one — the exact flood pattern that circuit breaker was built to prevent (its own comment citesLOOPOVER-K/8's 2094 + 544 events).Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Closes #7466
Validation
git diff --checknpm run typechecknpm run test:coveragelocally — new test cases cover both the legacy-var rename hint and the CODEX_HOME-takes-priority case (test/unit/selfhost-ai.test.ts), and both the bare + colon-suffixedcodex_credential_isolation_requiredforms of the circuit-breaker regex (test/unit/ai-review.test.ts); isolated coverage on both changed files is 100% for the new code (the two pre-existing uncovered lines the full-file report shows are unrelated defaults elsewhere in each file)npm run branding-drift:check— regenerated the baseline (npm run branding-drift:update) since the fix's own legacy-var detection necessarily references "gittensory" 3 more times insrc/selfhost/ai.ts; a real, intentional increase, not driftIf any required check was skipped, explain why:
Safety
UI Evidencesection. (N/A — no visible UI change.)apps/loopover-ui/content/docs/self-hosting-ai-providers.mdxalready documentscodex_credential_isolation_requiredcorrectly.)Notes
git log -S dualPrefixEnvFlagandgit showon the rebrand commit to confirm the env-var retirement was deliberate (not itself a bug) before designing this fix.