Fix load_dotenv timing bug, remove global RNG seed, improve error handling#4
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/bigturtle679/Contract-Negotiation-Environment/sessions/8a71a610-0371-4d52-92e9-3a3562765013 Co-authored-by: AbeerChaturvedi <171315954+AbeerChaturvedi@users.noreply.github.com>
…dling - inference.py: Call load_dotenv() at module level before os.getenv() reads, fixing a bug where .env-only config was silently ignored - environment.py: Remove module-level random.seed(42) that unnecessarily polluted the global RNG (class already uses its own Random instance) - server/app.py: Catch RuntimeError from step-before-reset separately and return 400 instead of 500 (it's a client error, not a server error) - hf_create.py: Add timeout=30 to urlopen to prevent indefinite hangs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: AbeerChaturvedi <171315954+AbeerChaturvedi@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
AbeerChaturvedi
April 11, 2026 11:55
View session
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.
load_dotenv()timing bug in inference.py (was called too late, after env vars read)RuntimeErrorin/stependpoint (was falling through to 500)timeout=30tourlopen()in hf_create.py (prevent indefinite hang)random.seed(42)at module level in environment.py (class uses own RNG)