mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix: unset all supported provider env vars in pi-test.sh --no-env (#11395)
`./pi-test.sh --no-env` is supposed to run pi without any API keys, but its hard-coded `unset` list had fallen behind `packages/ai/src/env-api-keys.ts`. Credentials such as `DEEPSEEK_API_KEY`, `MOONSHOT_API_KEY` and `ANTHROPIC_AUTH_TOKEN` were still picked up from the environment. This change adds the 26 missing variables to the list: - the Anthropic auth token and federation variables - the API keys for Ant Ling, Baseten, Cloudflare, DeepSeek, Fireworks, Google Cloud, Kimi, Meta, Moonshot, Nvidia, Qwen token plan, Radius, Together, Typesafe, Xiaomi (all plans) and ZAI coding CN The list now covers every variable name in `env-api-keys.ts`. Testing: - No automated test covers this shell script, so none was added. - A loop over every variable name in `env-api-keys.ts` confirmed each now has an `unset` in `pi-test.sh`. - Before the change, `PI_CODING_AGENT_DIR=$(mktemp -d) DEEPSEEK_API_KEY=x ./pi-test.sh --no-env --offline -ne --list-models deepseek` listed DeepSeek models. - After the change, the same command with both `DEEPSEEK_API_KEY` and `MOONSHOT_API_KEY` set prints "No models available." - `bash -n pi-test.sh` and `npm run check` pass. Fixes #11359 Requested by @badlogic Co-authored-by: triagent <triagent@localhost>
This commit is contained in:
parent
38ff99177f
commit
911fbab32f
1 changed files with 26 additions and 0 deletions
26
pi-test.sh
26
pi-test.sh
|
|
@ -51,6 +51,32 @@ if [[ "$NO_ENV" == "true" ]]; then
|
|||
unset AZURE_OPENAI_API_KEY
|
||||
unset AZURE_OPENAI_BASE_URL
|
||||
unset AZURE_OPENAI_RESOURCE_NAME
|
||||
unset ANTHROPIC_AUTH_TOKEN
|
||||
unset ANTHROPIC_FEDERATION_RULE_ID
|
||||
unset ANTHROPIC_IDENTITY_TOKEN_FILE
|
||||
unset ANTHROPIC_ORGANIZATION_ID
|
||||
unset ANTHROPIC_SERVICE_ACCOUNT_ID
|
||||
unset ANTHROPIC_WORKSPACE_ID
|
||||
unset ANT_LING_API_KEY
|
||||
unset BASETEN_API_KEY
|
||||
unset CLOUDFLARE_API_KEY
|
||||
unset DEEPSEEK_API_KEY
|
||||
unset FIREWORKS_API_KEY
|
||||
unset GOOGLE_CLOUD_API_KEY
|
||||
unset KIMI_API_KEY
|
||||
unset META_API_KEY
|
||||
unset MOONSHOT_API_KEY
|
||||
unset NVIDIA_API_KEY
|
||||
unset QWEN_TOKEN_PLAN_API_KEY
|
||||
unset QWEN_TOKEN_PLAN_CN_API_KEY
|
||||
unset RADIUS_API_KEY
|
||||
unset TOGETHER_API_KEY
|
||||
unset TYPESAFE_API_KEY
|
||||
unset XIAOMI_API_KEY
|
||||
unset XIAOMI_TOKEN_PLAN_CN_API_KEY
|
||||
unset XIAOMI_TOKEN_PLAN_AMS_API_KEY
|
||||
unset XIAOMI_TOKEN_PLAN_SGP_API_KEY
|
||||
unset ZAI_CODING_CN_API_KEY
|
||||
echo "Running without API keys..."
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue