Repository navigation
ci-flake: load real models.goal in goals/wrapped/firmware test fixture - #23608
Merged
Merged
Conversation
#22220 added 'from models.goal import sanitize_suggestion_dict' to utils/llm/goals.py, but the fixture in test_goals_wrapped_firmware_hardening.py stubs 'models' as an empty package whose hand-listed fakes omitted 'models.goal'. In CI's per-file pytest processes (BACKEND_PYTEST_FILE_ISOLATION) nothing pre-imports the real module, so the fresh goals.py exec hit ModuleNotFoundError and all 7 tests errored on every run since 3486e8a (deterministic main-red; shared local sessions hid it because a sibling test file imports models.goal at module scope). Load the real models.goal via load_module_fresh before the stub block and register it in the fakes mapping: the fixture becomes self-contained (no import ordering / shared sys.modules state) and the tests keep asserting the real sanitize_suggestion_dict null-coercion behavior instead of a mock.
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. |
Git-on-my-level
deleted the
agent/m1-studio-zcode-glm-5-3/1978de6b1eac
branch
October 25, 2026 16:24
This was referenced Oct 25, 2026
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.
What
tests/unit/test_goals_wrapped_firmware_hardening.pyerrored on every Backend Unit Tests run since #22220 merged (3486e8a2d6, 2026-10-25 14:42 UTC): all 7 tests fail at fixture setup withThis is not a product regression —
backend/models/goal.pyexists and the production import works. It is a stale test fixture: #22220 addedfrom models.goal import sanitize_suggestion_dicttoutils/llm/goals.py, but this fixture stubsmodelsas an empty package (__path__ = []) with a hand-listed fake set that does not includemodels.goal. Under CI's per-file pytest processes (BACKEND_PYTEST_FILE_ISOLATION) nothing pre-imports the real module, the empty-path stub blocks the on-disk import, and the freshload_module_fresh("utils.llm.goals", ...)exec fails. In a shared local session the siblingtest_goal_progress_history_atomic.py(module-scopefrom models.goal import ...) happens to populatesys.modulesfirst, which is why the breakage was invisible locally — classic import-ordering/shared-state dependence, the drift mode documented asFC-hand-listed-test-isolation-membershipinbackend/testing/import_isolation.py.Failing runs with the identical signature (first failure = #22220's merge): main push run 40203471575 (14:42Z), PR run 40204841086 (15:00Z), main push run 40205564034 (15:09Z), PR #23604 run 40206177742 job 121207480456 (15:16Z).
Change
One test file. The fixture now loads the real
models.goalviaload_module_freshbefore thestub_modulesblock and registers it in the fakes mapping, next to the existingmodels.conversationentry:sanitize_suggestion_dictnull-coercion behavior (null → 10.0/0.0/10.0), which anAutoMockModulestub would silently break.No
.github/changes and no new workflows — the fix is entirely in the test fixture. (CI-flake fixes and CI dependency caching were approved by David on 10-22; this PR needs neither.)Verification (run on this branch)
Reproduction on
origin/mainbefore the fix (per-file process): 7 errors with the exact CI signature; withtest_goal_progress_history_atomic.pyin the same process: 15 passed — confirming the ordering dependence.