Bug fix: running evaluation script didn't load environment#346
Conversation
|
@claude pr-review |
This comment was marked as outdated.
This comment was marked as outdated.
|
@claude use ultra-review skill |
|
Claude finished @yangm2's task in 3m 26s —— View job Ultra-review
SummarySolid bug-fix PR. The root cause — A few minor things worth tightening before merge. Code quality1. Forward reference to self.THINKING_BUDGET: Final = GEMINI_THINKING_BUDGET_DYNAMIC # line 158
...
GEMINI_THINKING_BUDGET_DYNAMIC: Final = -1 # line 163This works only because 2. Stray if __name__ == "__main__":
import logging
...
3.
Tiny but worth aligning since this PR introduces both. 4. Comment-period style. Testing — gaps worth filling5.
These are exactly the kind of thing that silently breaks during refactors. Suggest one or two small tests. 6. The color path of 7. The caplog.set_level(logging.CRITICAL, logger="tenantfirstaid.constants")This raises the logger's effective level to CRITICAL, which prevents the warning from being emitted at all (not just from being captured). That's fine for "keep test output clean", but the docstring says "tests that don't want to assert on it can opt into this fixture to keep test output clean" — it actually suppresses emission, not just output. Tiny doc-precision nit. 8. Production path isn't fully exercised. The test SecurityNo issues. The fix actually improves posture slightly: loading The warning message logs the resolved PerformanceNo concerns. Logging setup is one-time at startup. Documentation
One small thing: the section says "Environment variables are loaded once, at Things done well (worth keeping)
VerdictApprove-ready after the small cleanups above. The two I'd actually do before merge: #2 (move the |
…how deployments work) when .env file is not found
…how deployments work) when .env file is not found
What type of PR is this? (check all applicable)
Description
The evaluation script imports
constants.pywhich is where all the environment variables are supposed to be loaded. Due to quirks in invocation and how the.envpath was resolved, it did not work consistently and looked like a user-specific issue when it was an invocation-specific issue.This also adds a more descriptive warning when
.envis not found.And this refactors the logger for consistent formatting across files.
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note on the devices and browsers this has been tested on, as well as any relevant images for UI changes.
Added/updated tests?
Documentation
Architecture.mdhas been updated[optional] Are there any post deployment tasks we need to perform?