Skip to content

Commit 7bef36c

Browse files
allow game_config to provide frontend_url instead of port
1 parent 10545ac commit 7bef36c

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

agent/run_agent.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,19 @@ def main() -> None:
183183
)
184184
report = orchestrator.run(game_profile)
185185
port = game_config.get("port")
186-
if port is None:
187-
raise ValueError(f"Game config for '{args.game}' is missing required 'port'")
188-
game_base_url = str(game_config.get("base_url") or "").strip() or (
189-
f"http://localhost:{port}/api/agent"
190-
)
191-
frontend_url = str(
192-
game_config.get("frontend_url")
193-
or backend_spec.settings.get("frontend_url")
194-
or f"http://localhost:{port}"
186+
configured_frontend_url = str(
187+
game_config.get("frontend_url") or backend_spec.settings.get("frontend_url") or ""
195188
).strip()
189+
if port is None and not configured_frontend_url:
190+
raise ValueError(
191+
f"Game config for '{args.game}' must provide at least one of 'port' or 'frontend_url'"
192+
)
193+
game_base_url = str(game_config.get("base_url") or "").strip()
194+
if not game_base_url and port is not None:
195+
game_base_url = f"http://localhost:{port}/api/agent"
196+
frontend_url = configured_frontend_url
197+
if not frontend_url and port is not None:
198+
frontend_url = f"http://localhost:{port}"
196199
report.metadata["llm"] = {
197200
"model": model,
198201
"platform": resolved_platform,

0 commit comments

Comments
 (0)