Skip to content

Commit 1064445

Browse files
committed
fix: debug + some rebase
1 parent 05b0a7a commit 1064445

4 files changed

Lines changed: 3330 additions & 630 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ classifiers = [
3333
"Programming Language :: Python :: 3.14",
3434
]
3535
dependencies = [
36-
"litellm[proxy]>=1.81.1,<1.82.0",
36+
"litellm>=1.81.1",
3737
"tenacity>=9.0.0",
3838
"pydantic[email]>=2.11.3",
3939
"rich",
@@ -46,6 +46,7 @@ dependencies = [
4646
"opentelemetry-exporter-otlp-proto-http>=1.40.0",
4747
"scrubadub>=2.0.1",
4848
"defusedxml>=0.7.1",
49+
"browser-use>=0.12.2",
4950
]
5051

5152
[project.scripts]

strix/tools/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import os
2+
3+
from strix.config import Config
4+
15
from .agents_graph import * # noqa: F403
26
from .browser import * # noqa: F403
37
from .executor import (

strix/tools/browser/browser_actions.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import base64
3+
import contextlib
34
import logging
45
import re
56
from functools import partial
@@ -101,6 +102,28 @@ async def _execute_task(session: BrowserSession, operation: Any, desc: str) -> d
101102
}
102103

103104

105+
async def _on_step_start(agent: Any) -> None:
106+
step = agent.state.n_steps + 1
107+
url = "unknown"
108+
with contextlib.suppress(Exception):
109+
url = await agent.browser_session.get_current_page_url()
110+
logger.info("Browser step %d starting — url=%s", step, url)
111+
112+
113+
async def _on_step_end(agent: Any) -> None:
114+
step = agent.state.n_steps
115+
output = agent.state.last_model_output
116+
next_goal = getattr(output, "next_goal", "") or "" if output else ""
117+
actions = getattr(output, "action", []) or [] if output else []
118+
action_names = [next(iter(a.model_dump(exclude_unset=True)), "?") for a in actions]
119+
logger.info(
120+
"Browser step %d completed — actions=%s goal=%s",
121+
step,
122+
action_names,
123+
next_goal[:120],
124+
)
125+
126+
104127
async def _run_browser_agent(
105128
session: BrowserSession,
106129
task: str,
@@ -123,7 +146,10 @@ async def _run_browser_agent(
123146
use_vision=vision,
124147
)
125148

126-
result = await agent.run()
149+
result = await agent.run(
150+
on_step_start=_on_step_start,
151+
on_step_end=_on_step_end,
152+
)
127153

128154
if hasattr(result, "is_successful") and not result.is_successful():
129155
final_result = (

0 commit comments

Comments
 (0)