Repository navigation
feat(evals): keep named login variables in claude.sh with EOR_KEEP_ENV - #350
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
claude.sh unsets every CLAUDE* and ANTHROPIC* variable, which also removes a login that lives in the environment (a config directory or gateway token). EOR_KEEP_ENV lists variable names to keep. The default is unchanged.
bompus
force-pushed
the
eval-claude-keep-env-20261017
branch
from
October 17, 2026 21:58
7330393 to
68beec7
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.
evals/end-of-reply/models/claude.shunsets everyCLAUDE*andANTHROPIC*variable. A run that authenticates through the environment (CLAUDE_CONFIG_DIRplus gateway token variables) then falls back to the default login and its weekly limit, or fails with "Not logged in".This adds an opt-in keep list.
EOR_KEEP_ENVis a space-separated list of variable names the wrapper leaves set. Names match whole, soANTHROPICdoes not keepANTHROPIC_AUTH_TOKEN. WithEOR_KEEP_ENVunset or empty, the wrapper unsets the same variables as before.Changes:
claude.sh: the unset loop skips names in the keep list (4 lines), and the header comment names the variable.evals/end-of-reply/README.md: three lines under the wrapper table saying what is unset and how to keep a login.CHANGELOG.md: an Unreleased entry marked repository only.test/eval-wrappers.test.mjs: runsclaude.shwith a stubclaudeonPATHthat prints theCLAUDE*/ANTHROPIC*names it can see. It covers the default (only the wrapper's ownCLAUDE_CODE_DISABLE_AUTO_MEMORYis visible), a keep list, and whole-name matching. Skipped on Windows.Proof I ran:
claude.sh, the keep-list test fails; the other two pass because they describe unchanged behavior. With the change, all 3 pass.node --test test/*.test.mjs: 182 pass, 0 fail, 7 skipped (exit 0).bun test test/eval-wrappers.test.mjs: 3 pass.npx --yes oxfmt@0.70.0 --check .exit 0;npx --yes oxlint@1.85.0 .exit 0 (one existing warning intest/install-ps1.test.mjs).hr-code-reviewof the final diff found no defects; it led to two prose edits in the changelog entry.Not done: this does not keep variables by prefix, and it does not change the default isolation of any other wrapper.
check:packageandbun test skills/not run, no packaged or skill file changed).CHANGELOG.mdentry underUnreleased.Summary by cubic
Adds
EOR_KEEP_ENVtoclaude.shso a run can keep namedCLAUDE*orANTHROPIC*variables, allowing logins that live in the environment. Previously the wrapper unset every such variable, so an environment-based login (config directory or gateway token) fell back to the default CLI login or failed. The default remains the same: withEOR_KEEP_ENVunset or empty, all those variables are still unset.EOR_KEEP_ENVis a space-separated list; names match whole, soANTHROPICdoes not keepANTHROPIC_AUTH_TOKEN.Written for commit 68beec7. Summary will update on new commits.