@capagents/forgeqe 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capagents/forgeqe",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "ForgeQE: a browser agent CLI that runs goals and test cases in local Chrome or Chromium, or BrowserStack and TestMu AI/LambdaTest when configured, and turns passing runs into tests in your repo",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -1002,6 +1002,8 @@ async def run_browser_task(req: RunRequest, emit: Emit, cancel_event: asyncio.Ev
1002
1002
  llm = _build_llm(req.llm)
1003
1003
  except Exception as e:
1004
1004
  return {"success": False, "error": str(e), "summary": ""}
1005
+ _llm_cfg = req.llm if isinstance(req.llm, dict) else {}
1006
+ model_label = str(_llm_cfg.get("deployment") or _llm_cfg.get("model") or "the model")
1005
1007
  llm_calls: List[Tuple[float, float]] = []
1006
1008
  _time_llm_calls(llm, llm_calls, lambda c: emit({"type": "call", **c}))
1007
1009
  use_prompts(req.prompts)
@@ -1027,6 +1029,7 @@ async def run_browser_task(req: RunRequest, emit: Emit, cancel_event: asyncio.Ev
1027
1029
  {
1028
1030
  "type": "log",
1029
1031
  "level": "info",
1032
+ "progress": True,
1030
1033
  "text": f"ForgeQE engine · {browser_connection_label(browser_provider, browser_kw, browser_remote)} · {'headless' if headless else 'visible'}"
1031
1034
  + (f" · opening {normalized_initial}" if normalized_initial else " · agent picks the site"),
1032
1035
  }
@@ -1514,7 +1517,13 @@ async def run_browser_task(req: RunRequest, emit: Emit, cancel_event: asyncio.Ev
1514
1517
  # Remote grids stop taking input on a tab after a password form is submitted: see FreshTabAfterPassword.
1515
1518
  fresh_tab = FreshTabAfterPassword() if browser_provider != "local" else None
1516
1519
 
1520
+ browser_open: List[bool] = []
1521
+
1517
1522
  async def _on_step_start(agent_ref: Any) -> None:
1523
+ if not browser_open:
1524
+ # Once: a wait after this line is the model's; one before it is the browser's.
1525
+ browser_open.append(True)
1526
+ emit({"type": "log", "level": "info", "progress": True, "text": f"The browser is open; {model_label} is working out the first step…"})
1518
1527
  if not collected_steps:
1519
1528
  await diag.start(browser)
1520
1529
  if overlay is not None and not collected_steps:
@@ -1529,6 +1538,7 @@ async def run_browser_task(req: RunRequest, emit: Emit, cancel_event: asyncio.Ev
1529
1538
  return await agent.run(max_steps=step_cap, on_step_start=_on_step_start, on_step_end=_on_step_end)
1530
1539
  return await agent.run(on_step_start=_on_step_start, on_step_end=_on_step_end)
1531
1540
 
1541
+ emit({"type": "log", "level": "info", "progress": True, "text": "Opening the browser…"})
1532
1542
  run_task = asyncio.create_task(_run_agent())
1533
1543
  cancel_wait = asyncio.create_task(cancel_event.wait())
1534
1544
  done, _pending = await asyncio.wait({run_task, cancel_wait}, return_when=asyncio.FIRST_COMPLETED, timeout=timeout_sec)