NanduKondreddy commited on
Commit
d255d10
·
1 Parent(s): 02c2ba4

Fix: use HF_TOKEN or API_KEY for autonomous solver credentials

Browse files
Files changed (1) hide show
  1. server/config_debug_environment.py +10 -6
server/config_debug_environment.py CHANGED
@@ -58,12 +58,16 @@ async def generate_fix_async(observation: ConfigDebugObservation, step: int = 1)
58
  Call LLM agent to generate a fix for the current task.
59
  Returns the fixed configuration string.
60
  """
61
- # Read API credentials (strict env reads like inference.py)
62
- try:
63
- api_key = os.environ["API_KEY"]
64
- api_base_url = os.environ["API_BASE_URL"]
65
- except KeyError as e:
66
- print(f"[LLM AGENT] Missing env var: {e}", flush=True)
 
 
 
 
67
  return ""
68
 
69
  # Get model name
 
58
  Call LLM agent to generate a fix for the current task.
59
  Returns the fixed configuration string.
60
  """
61
+ # Read API credentials - try multiple env var names for compatibility
62
+ api_key = os.getenv("API_KEY") or os.getenv("HF_TOKEN")
63
+ api_base_url = os.getenv("API_BASE_URL")
64
+
65
+ if not api_key:
66
+ print(f"[LLM AGENT] Missing API_KEY or HF_TOKEN", flush=True)
67
+ return ""
68
+
69
+ if not api_base_url:
70
+ print(f"[LLM AGENT] Missing API_BASE_URL", flush=True)
71
  return ""
72
 
73
  # Get model name