Skip to content

Commit d79be3b

Browse files
author
SentienceDEV
committed
fix tests
1 parent f6b7935 commit d79be3b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

predicate/debugger.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ def attach(
5252
sentience_api_key: str | None = None,
5353
tool_registry: ToolRegistry | None = None,
5454
) -> SentienceDebugger:
55-
runtime = AgentRuntime.from_playwright_page(
56-
page=page,
57-
tracer=tracer,
58-
snapshot_options=snapshot_options,
59-
predicate_api_key=predicate_api_key,
60-
sentience_api_key=sentience_api_key,
61-
tool_registry=tool_registry,
62-
)
55+
factory_kwargs: dict[str, Any] = {
56+
"page": page,
57+
"tracer": tracer,
58+
"snapshot_options": snapshot_options,
59+
"sentience_api_key": sentience_api_key,
60+
"tool_registry": tool_registry,
61+
}
62+
# Preserve old call shape unless new parameter is explicitly used.
63+
if predicate_api_key is not None:
64+
factory_kwargs["predicate_api_key"] = predicate_api_key
65+
66+
runtime = AgentRuntime.from_playwright_page(**factory_kwargs)
6367
return cls(runtime=runtime)
6468

6569
def begin_step(self, goal: str, step_index: int | None = None) -> str:

0 commit comments

Comments
 (0)