Skip to content

fix: persist review gate config outside transient state - #731

Open
fscfede-beep wants to merge 2 commits into
openai:mainfrom
fscfede-beep:fix/durable-review-gate-config-684
Open

fix: persist review gate config outside transient state#731
fscfede-beep wants to merge 2 commits into
openai:mainfrom
fscfede-beep:fix/durable-review-gate-config-684

Conversation

@fscfede-beep

Copy link
Copy Markdown

Summary

Fixes #684.

  • move durable workspace config to CODEX_HOME/plugin-cc/config/<workspace>.json
  • keep job state under the existing CLAUDE_PLUGIN_DATA / temp roots
  • make getConfig() prefer the durable config while retaining the existing state config as a legacy fallback
  • mirror setConfig() into the current legacy state for compatibility
  • use the same workspace slug/hash for durable config and transient state

This removes CLAUDE_PLUGIN_DATA from the authority boundary for stopReviewGate, so Setup and Stop can run with different plugin-data environments without silently disagreeing about whether the gate is enabled.

Validation

Windows 11 / Node 26.3.1:

  • test-first reproduction on main: enable under plugin-data root A, read under root B -> false (fail-open)
  • after the patch the same A→B read stays true, and disabling under B is observed under A
  • end-to-end integration: Setup enables the gate under root A; Stop runs under root B with the same CODEX_HOME and correctly returns a blocking review decision
  • targeted Stop/setup integration: 3 passed, 0 failed
  • state regression: 4 passed, 0 failed
  • node --check plugins/codex/scripts/lib/state.mjs
  • git diff --check

@fscfede-beep
fscfede-beep requested a review from a team September 4, 2026 18:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e123511d2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/codex/scripts/lib/state.mjs

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving stopReviewGate out of transient plugin state fixes the authority boundary: Setup and Stop may legitimately run with different CLAUDE_PLUGIN_DATA, but the workspace policy must remain the same. Reusing one canonical workspace key for both paths avoids a second identity scheme, and preferring durable config while mirroring legacy state gives a reasonable compatibility transition. The cross-root integration test pins the actual fail-open bug rather than only the storage helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/codex:setup --enable-review-gate reports success but writes the flag to a state root the Stop hook never reads — the gate silently fails open

2 participants