r/PiCodingAgent • u/startassets • 25d ago
Plugin pi-agent-computer-use: give your access to computer (browser+desktop)
Hi! Currently computer-use is a must for my agents, so I decided to build an extension with a custom CUA Driver fork and Playwright. It’s purposefully designed to be run in YOLO mode (although Safe is included) within the environment where you trust your agents. It works in hybrid mode: supports both raw image followed by input (agent sees a screenshot and then clicks on something) and structural way (playwright for browser and UIA for normal desktop applications). Agents can use their own browser profiles, or your own, work in sandboxes and remote desktops, work together (to some extent, there are limitations on the OS side).
I would say it was definitely worth working on that, my agents can now work in 3D, browse some stuff I need and can test my applications, acting like real users.
I’ve mostly benched it via GIMP drawing, which doesn’t support UIA so all the interactions are purely from picture based mode. But also Terra 6.1 High has gone to 42th level of https://neal.fun/not-a-robot/ until it got banned by Cloudflare, and we couldn’t pass further. It’s windows only (windows from WSL as well), but if anybody can contribute into linux/macos branch of it, it would be great, I’m just lacking such devices and can’t really test them to the full extent as I can with Windows.
https://github.com/alexshpunt/pi-agent-computer-use
https://pi.dev/packages/pi-agent-computer-use
To install: `pi install npm:pi-agent-computer-use`
Demo of deepseek-flash, haiku, opus, terra and sol drawing the same image with that: https://youtu.be/69doTus760U
View all comments
Show parent comment
2
u/startassets 18d ago
Hi! Yes that's one is quite tricky, but the solution was relative simple. There is no llm right now with such reaction speed, so that's why you have to have something that can react instant. So your computer use tool should support wait and react conditional blocks and ideally a codemode to connect everything together. The most naive and a bit cheaty way is to simply for the model to figure out that there are two different panels in html appearing on the page: mole and grass. Once the waiter detects the mole it should instantly emit click even over this block. Another a bit more fair way is to use classifiers, either a local or cloud ones (jev, decision api, clef). Then the algorithm is the same, cut the region into grid and for each grid pass the check until it detects the mole.
So it's more like think long during the observation (the agent should be able to capture the page for a while to see the dynamics of the scene) and then react super fast (with classifiers or html checking).
Although I've passed the test with classifiers as well, the actual run when Terra passed to 42th was done without them simply by observing the state of the page, so it was slightly cheating.
I hope that it answers your question, but feel free to ask more, it's an exciting topic to me and I've spent quite a time trying to figure out how to make it efficient and fast.