Add environment parameter to preserve env vars in eval-retry (#3312)#3344
Open
evcyen wants to merge 2 commits intoUKGovernmentBEIS:mainfrom
Open
Add environment parameter to preserve env vars in eval-retry (#3312)#3344evcyen wants to merge 2 commits intoUKGovernmentBEIS:mainfrom
evcyen wants to merge 2 commits intoUKGovernmentBEIS:mainfrom
Conversation
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.
This PR contains:
What is the current behavior?
Fixes #3312. Environment variables set during an eval run are not recorded in the eval log. When
inspect eval-retryreplays a failed eval, it reconstructs the task, model config, sandbox settings, and other parameters fromEvalSpec, but environment variables are lost because they were never serialized.This causes
eval-retryto behave differently from the original run when the eval depends on environment variables. For example, if an eval usesos.environ.get("MY_CUSTOM_SETTING")to configure sandbox behavior, the retry will fail or behave incorrectly when that variable is not present in the environment.There is currently no way to pass environment variables through
eval()oreval_set()such that they are persisted in the log and recovered on retry.What is the new behavior?
Adds an explicit
environmentparameter to theeval()function that allows users to specify which environment variables should be preserved for retry.Usage:
Does this PR introduce a breaking change?
No. The environment parameter is optional and defaults to None.