Skip to content

Commit 51eb9b3

Browse files
committed
fix api key get bug
1 parent 0cfeb4d commit 51eb9b3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

eval_protocol/auth.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ def get_fireworks_account_id() -> Optional[str]:
177177
The Account ID is sourced in the following order:
178178
1. FIREWORKS_ACCOUNT_ID environment variable.
179179
2. 'account_id' from the [fireworks] section of ~/.fireworks/auth.ini.
180+
3. If an API key is available (env or auth.ini), resolve via verifyApiKey.
180181
181182
Returns:
182183
The Account ID if found, otherwise None.
@@ -200,11 +201,9 @@ def get_fireworks_account_id() -> Optional[str]:
200201
if account_id_from_file:
201202
return account_id_from_file
202203

203-
# 3) Fallback: if API key is present, attempt to resolve via verifyApiKey
204+
# 3) Fallback: if API key is present, attempt to resolve via verifyApiKey (env or auth.ini)
204205
try:
205-
# IMPORTANT: Only consider API key from environment here to avoid re-reading files
206-
# which can cause duplicate Path.exists/_parse_simple_auth_file calls in tests and runtime.
207-
api_key_for_verify = os.environ.get("FIREWORKS_API_KEY")
206+
api_key_for_verify = get_fireworks_api_key()
208207
if api_key_for_verify:
209208
resolved = verify_api_key_and_get_account_id(api_key=api_key_for_verify, api_base=get_fireworks_api_base())
210209
if resolved:

0 commit comments

Comments
 (0)