Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/hai_agents_local/workstation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def create_driver(self) -> ManagedCodeSandboxInterface:
str(self.workspace),
environment_variables={
"COORDINATE_SYSTEM": "0-1000",
"CUA_CURSOR": os.environ.get("CUA_CURSOR", "off"),
"CUA_SESSION": self.session_id,
"PATH": os.pathsep.join([os.path.dirname(desk), path]),
},
Expand Down
6 changes: 4 additions & 2 deletions tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,16 +685,18 @@ def test_args_decode_by_the_interface_types(self):
def test_workstation_serves_a_shell_in_its_session_folder_with_the_cli_commands(self, tmp_path, monkeypatch):
pytest.importorskip("hai_drivers.code_sandbox.local.driver")
monkeypatch.setenv("HOME", str(tmp_path))
monkeypatch.delenv("CUA_CURSOR", raising=False)
bridge = WorkstationBridge(api_key="k")
bridge._driver = bridge.create_driver()
try:
result, error = bridge._dispatch(
"execute", {"command": "pwd -P; echo $COORDINATE_SYSTEM $CUA_SESSION; command -v desk web cua click"}
"execute",
{"command": "pwd -P; echo $COORDINATE_SYSTEM $CUA_SESSION $CUA_CURSOR; command -v desk web cua click"},
)
assert error is None and result["exit_code"] == 0
out = result["stdout"].split()
assert out[0] == str((tmp_path / "hai" / bridge.session_id).resolve())
assert out[1:3] == ["0-1000", bridge.session_id] and len(out) == 7
assert out[1:4] == ["0-1000", bridge.session_id, "off"] and len(out) == 8
finally:
bridge._driver.close()

Expand Down
Loading