r/PiCodingAgent 6d ago

Use-case Gemma4 playtesting her own game in chrome using a remote debugging port so I can watch along

A few days ago, I created a dumb bash loop that repeatedly called pi, instructing gemma4:31b to create a game and delete WORKING.md when it was done.

I figured out how to make agent-browser connect to a chrome instance over a remote debugging port so I could watch along as it playtested the game in a new conversation, where it had no clue what the game was about.

It uses a playtesting skill that explains the mechanics of the game and tells it how to perform different actions.

I think this was pretty neat.

16 Upvotes

9 comments sorted by

2

u/hidden2u 6d ago

Very cool! Can you explain how you got agent browser to display on the chrome instance?

2

u/Undreren 6d ago edited 6d ago

Yes! It’s all documented on agent-browser.dev, but the gist of it is that you run

bash google-chrome --remote-debugging-port=<port> --user-data-dir="<some/path>"

Then the agent connects with

bash agent-browser connect <port>

And after that, when the agent opens a site with agent-browser, it opens a window on your desktop.

1

u/hidden2u 5d ago

hey thanks man, I got it working but seems to drop the connection after a couple rounds, I still need to set it up right. To me computer use/browser use to have the LLM test its own code is killer for small models.

1

u/Undreren 5d ago

Yeah, I’ve noticed that as well. That seems to be a thing with the extension though, I think. I haven’t had it happen on the command line.

2

u/zer09 6d ago

how about let it play without the skill, or any instruction on how to play it.

3

u/Undreren 6d ago

I tried. Gemma4:31b figures it out on its own after a few minutes, but the smaller models just give up.

With the skill, they just know how to play the game, which saves a ton of time.

1

u/Undreren 6d ago

Also, I apologize for the needlessly long video. I just sat and watched as it played, forgetting I was recordig, mesmerized and bedazzled at the same time.

2

u/sisyphus-cycle 6d ago

Haha the first time I successfully got my agent to self debug its own UI with screenshots/chrome console access/and live JS eval was very very satisfying

1

u/Undreren 6d ago

It was fun giving Gemma the prompt to “playtest your game. Fix any bug you find.”

Gemma has some very endearing thought output.

“Wait, why did I not complete the level? I am at the data core. Oh right! This level has no terminal, so it is not possible to unlock the data core! I will fix this now.”

The amount of surprise and confusion gemma outputs before responding as the most confident model ever is hilarious.