fix(config): preserve preloaded rxconfig classes - #7144
FarhanAliRaza wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe952bca61
ℹ️ 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".
Merging this PR will degrade performance by 4.78%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_collect_imports[_complicated_page] |
3.6 ms | 3.8 ms | -4.78% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing FarhanAliRaza:codex/config-reload-boundary (dec1771) with main (d1a6d2e)
Footnotes
-
8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 6 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/units/utils/test_exec.py">
<violation number="1" location="tests/units/utils/test_exec.py:78">
P2: This test loads rxconfig.py whose `rx.Config(...)` sets the module global `reflex_base.config._state_auto_setters`, but the finally block only restores `_config_module_deps`/`_config_module_deps_root`. The leaked value stays cached for later tests, overriding the env-var fallback in `get_state_auto_setters()` and any State created without a fresh config load. Save `_state_auto_setters` before the load and restore it in `finally`, mirroring tests/units/test_app.py:136-154.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| sys.modules.pop(config_module_name, None) | ||
| sys.modules.pop("config_first_app", None) | ||
| sys.modules.pop("config_first_app.config_first_app", None) | ||
| reflex_base.config._config_module_deps.clear() |
There was a problem hiding this comment.
P2: This test loads rxconfig.py whose rx.Config(...) sets the module global reflex_base.config._state_auto_setters, but the finally block only restores _config_module_deps/_config_module_deps_root. The leaked value stays cached for later tests, overriding the env-var fallback in get_state_auto_setters() and any State created without a fresh config load. Save _state_auto_setters before the load and restore it in finally, mirroring tests/units/test_app.py:136-154.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/units/utils/test_exec.py, line 78:
<comment>This test loads rxconfig.py whose `rx.Config(...)` sets the module global `reflex_base.config._state_auto_setters`, but the finally block only restores `_config_module_deps`/`_config_module_deps_root`. The leaked value stays cached for later tests, overriding the env-var fallback in `get_state_auto_setters()` and any State created without a fresh config load. Save `_state_auto_setters` before the load and restore it in `finally`, mirroring tests/units/test_app.py:136-154.</comment>
<file context>
@@ -3,18 +3,82 @@
+ sys.modules.pop(config_module_name, None)
+ sys.modules.pop("config_first_app", None)
+ sys.modules.pop("config_first_app.config_first_app", None)
+ reflex_base.config._config_module_deps.clear()
+ reflex_base.config._config_module_deps_root = None
+
</file context>
Summary
Validation