Trying to replicate tiny open hand CodeActAgent
It's my attempt at reproducing OpenHand's CodeActAgent or you could also say codex or claude code agent. It throws away all the complexity such as Controller, EventStream, Runtime UIs and many other thing, keeping only what's cruical to the CodeActAgent.
It uses bash terminal, terminal commands, create a new file, write to a new file, edit the file at specific lines, all autonomously based on the instruction provided by the user.
Here's a simple lightweight example video.
I prompt the agent to write me a script to simulate solar system in javascript. It first.
-
searches what exisitng files there are on folder by calling bash tool
ls -la /Users/cohlem/Projects/Experimentation/TinyOH"} -
Takes the output of the
lscommand as new input and generate the solar system code. -
Saves the code to
solar_system.htmlfile at directory/Users/cohlem/Projects/Experimentation/TinyOH -
I prompt the agent it make it look like 2.5D.
-
It reads the existing
solar_system.htmlfile. -
Generates only the necessary code to convert it from 2D to 2.5D
-
Calls tool to replace only the spcific part of the code.
Just run the following command, it will ask for your instructions, enter it and see what it does with it.
python -m TinyOH.main