fix: prevent Stage 4 literature search from silently falling back - #310
Open
pikaqiu2333 wants to merge 1 commit into
Open
fix: prevent Stage 4 literature search from silently falling back#310pikaqiu2333 wants to merge 1 commit into
pikaqiu2333 wants to merge 1 commit into
Conversation
pikaqiu2333
marked this pull request as ready for review
July 23, 2026 07:34
pikaqiu2333
force-pushed
the
codex/fix-stage4-os-scope
branch
from
July 23, 2026 07:44
5e125c6 to
5a53c86
Compare
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
osimport that broke environment-variable lookup in Stage 4.Root Cause
A function-local
import oscaused Python to treatosas a local variable throughout_execute_literature_collect.Stage 4 accessed
os.environbefore reaching that import, raisingUnboundLocalError. The existing broad exception handler then caught the error and silently skipped the real literature APIs.This regression was introduced by my changes in #299. I’m sorry I missed the interaction with the existing function-local import during testing. Thank you for reporting it in #309. This PR fixes the issue and adds orchestration-level regression coverage to prevent the same silent fallback from recurring.
Validation
8 passed78 passed207 passed2869 passed, 57 skippedTwo pre-existing Windows shell-related tests remain environment-specific and are unrelated to this change.
Fixes #309