u/Leflakk

Built my own coding agent harness and sharing some highlights
▲ 1 r/ollama

Built my own coding agent harness and sharing some highlights

Hi all,

I came into a journey of building a coding harness to learn + experiment and to see if I can adapt to my needs: as a "local AI" user familiar with ollama, llama.cpp and vllm, was thinking about the time I would stop my CC subscription and only play with open weight llms.

So, in order to start from something, I took opencode as a reference (well known for local AI coding) and started learning basics of tool loop, permissions, compaction etc.. So took it aswell as a reference in order to structure a minimum my new project.

But I fastly came into my first real design choice: typescript and TUI (as the tendancy) or python + webui? Choosen the last one because:

- I needed controllability

- I needed to add cool features (see below)

- It's not a problem for my usecase to have vs code separated

During the building, I came into others questions: How to preserve context? Do I keep plan agent? Let the user create its own and how? Which providers, only local or openai compatible or full providers compat? Are subagents really usefull?

So for these questions, I had to do a lot of tests + benchmarking (SWE-verified against opencode) in order to really feel the impact of these stuff with "small" models (Qwen3.6, gemma 4). So I ended up with these choices:

- yes subagents are usefull and I spawn them via the tool calls but they work better when parallel calls are allowed by the inference endpoint

- keep plan agent as these models have tendancy to not surface enough for complex tasks

- openai compatble: do not want to mess with others plans and still local + cloud

- try to reduce as most as possible system prompt + tool schemas footprints in context without loosing quality because instructions really have an impact on the model behaviour (at least on these models) => ended with a total footprint of 3.4k tokens

Once the harness was providing results I was expecting, I then came into the fun parts: a webui + python allows a lot of built-in features (the challenge was to keep the experience simple):

- while not a TUI, a file explorer and possibility to select lines to add them in the llm context + diff viewer files modified/created

- browser autmation: allows web navigation through DOM (accessibilitry tree) and + visual grounding (if conditions are met). The result is cool so included the browser view (periodically screenshotted) inside the UI:

https://preview.redd.it/2a3hckncdx0h1.png?width=1825&format=png&auto=webp&s=ac5376356320343b961612f6d8015088fc1827a0

​- The natural features following browser automation were obviously the skills and jobs so now I can just guide the agent to navigate on the internet only once then click on Create skill to see a form automatically prefilled by the llm so it will be able to execute "offline" at any time. Can be usefull for daily tasks and project webui tests.

https://preview.redd.it/hv11hs5edx0h1.png?width=1827&format=png&auto=webp&s=99ddf8a21390d8ef672554fe87d43177c875bc98

https://preview.redd.it/m29bc1efdx0h1.png?width=1827&format=png&auto=webp&s=93a69121dfaae4c5144ce94106be5a7ce9c02991

​Now I am quite satisfied and plan to improve it in the future. If you want to give a try, please have a look at https://github.com/leflakk/openclose, any feedback or discussion about coding agent tools are welcome!

reddit.com
u/Leflakk — 9 days ago

Built my own coding agent harness and sharing some highlights

Hi all,

I came into a journey of building a coding harness to learn + experiment and to see if I can adapt to my needs: as a "local AI" user familiar with llama.cpp and vllm, was thinking about the time I would stop my CC subscription and only play with open weight llms.

So, in order to start from something, I took opencode as a reference (well known for local AI coding) and started learning basics of tool loop, permissions, compaction etc.. So took it aswell as a reference in order to structure a minimum my new project.

But I fastly came into my first real design choice: typescript and TUI (as the tendancy) or python + webui? Choosen the last one because:

- I needed controllability

- I needed to add cool features (see below)

- It's not a problem for my usecase to have vs code separated

During the building, I came into others questions: How to preserve context? Do I keep plan agent? Let the user create its own and how? Which providers, only local or openai compatible or full providers compat? Are subagents really usefull?

So for these questions, I had to do a lot of tests + benchmarking (SWE-verified against opencode) in order to really feel the impact of these stuff with "small" models (Qwen3.6, gemma 4). So I ended up with these choices:

- yes subagents are usefull and I spawn them via the tool calls but they work better when parallel calls are allowed by the inference endpoint

- keep plan agent as these models have tendancy to not surface enough for complex tasks

- openai compatble: do not want to mess with others plans and still local + cloud

- try to reduce as most as possible system prompt + tool schemas footprints in context without loosing quality because instructions really have an impact on the model behaviour (at least on these models) => ended with a total footprint of 3.4k tokens

Once the harness was providing results I was expecting, I then came into the fun parts: a webui + python allows a lot of built-in features (the challenge was to keep the experience simple):

- while not a TUI, a file explorer and possibility to select lines to add them in the llm context + diff viewer files modified/created

- management of sessions, possibility of forking from any agent message to test different directions

- browser autmation: allows web navigation through DOM (accessibilitry tree) and + visual grounding (if conditions are met). The result is cool so included the browser view (periodically screenshotted) inside the UI:

https://preview.redd.it/fanaufky6x0h1.png?width=1825&format=png&auto=webp&s=d2587d9cc87ced960c265093a78c7f0e7ab0491f

​- The natural features following browser automation were obviously the skills and jobs so now I can just guide the agent to navigate on the internet only once then click on Create skill to see a form automatically prefilled by the llm so it will be able to execute "offline" at any time. Can be usefull for daily tasks and project webui tests.

https://preview.redd.it/6lhl2zjz6x0h1.png?width=1827&format=png&auto=webp&s=95e69b01cd86817dcf017becdf5edac1340e7e73

https://preview.redd.it/fo0fe3f07x0h1.png?width=1827&format=png&auto=webp&s=82faa70addc59a4184f94c57a1a3ab8e0bc3f9e2

​Now I am quite satisfied and plan to improve it in the future. If you want to give a try, please have a look at https://github.com/leflakk/openclose, any feedback or discussion about coding agent tools are welcome!

reddit.com
u/Leflakk — 9 days ago

Built my own coding agent harness and sharing some highlights

Hi all,

I came into a journey of building a coding harness to learn + experiment and to see if I can adapt to my needs: as a "local AI" user familiar with llama.cpp and vllm, was thinking about the time I would stop my CC subscription and only play with open weight llms.

So, in order to start from something, I took opencode as a reference (well known for local AI coding) and started learning basics of tool loop, permissions, compaction etc.. So took it aswell as a reference in order to structure a minimum my new project.

But I fastly came into my first real design choice: typescript and TUI (as the tendancy) or python + webui? Choosen the last one because:

- I needed controllability

- I needed to add cool features (see below)

- It's not a problem for my usecase to have vs code separated

During the building, I came into others questions: How to preserve context? Do I keep plan agent? Let the user create its own and how? Which providers, only local or openai compatible or full providers compat? Are subagents really usefull?

So for these questions, I had to do a lot of tests + benchmarking (SWE-verified against opencode) in order to really feel the impact of these stuff with "small" models (Qwen3.6, gemma 4). So I ended up with these choices:

- yes subagents are usefull and I spawn them via the tool calls but they work better when parallel calls are allowed by the inference endpoint

- keep plan agent as these models have tendancy to not surface enough for complex tasks

- openai compatble: do not want to mess with others plans and still local + cloud

- try to reduce as most as possible system prompt + tool schemas footprints in context without loosing quality because instructions really have an impact on the model behaviour (at least on these models) => ended with a total footprint of 3.4k tokens

Once the harness was providing results I was expecting, I then came into the fun parts: a webui + python allows a lot of built-in features (the challenge was to keep the experience simple):

- while not a TUI, a file explorer and possibility to select lines to add them in the llm context + diff viewer files modified/created

- management of sessions, possibility of forking from any agent message to test different directions

- browser autmation: allows web navigation through DOM (accessibilitry tree) and + visual grounding (if conditions are met). The result is cool so included the browser view (periodically screenshotted) inside the UI:

https://preview.redd.it/6u2ep0yk6x0h1.png?width=1825&format=png&auto=webp&s=88797eea5468731d720ef83a5d23f3a50dc8430d

​- The natural features following browser automation were obviously the skills and jobs so now I can just guide the agent to navigate on the internet only once then click on Create skill to see a form automatically prefilled by the llm so it will be able to execute "offline" at any time. Can be usefull for daily tasks and project webui tests.

https://preview.redd.it/re42ckgm6x0h1.png?width=1827&format=png&auto=webp&s=fdf513cf3416a5dd60e04214cc97c049fbfe01cb

https://preview.redd.it/aqnnvprn6x0h1.png?width=1827&format=png&auto=webp&s=2f89d929954901f22884e894b3b921c24a2942c7

​Now I am quite satisfied and plan to improve it in the future. If you want to give a try, please have a look at https://github.com/leflakk/openclose, any feedback or discussion about coding agent tools are welcome!

reddit.com
u/Leflakk — 9 days ago

Built my own coding agent harness and sharing some highlights

Hi all,

I came into a journey of building a coding harness to learn + experiment and to see if I can adapt to my needs: as a "local AI" user familiar with llama.cpp and vllm, was thinking about the time I would stop my CC subscription and only play with open weight llms.

So, in order to start from something, I took opencode as a reference (well known for local AI coding) and started learning basics of tool loop, permissions, compaction etc.. So took it aswell as a reference in order to structure a minimum my new project.

But I fastly came into my first real design choice: typescript and TUI (as the tendancy) or python + webui? Choosen the last one because:

- I needed controllability

- I needed to add cool features (see below)

- It's not a problem for my usecase to have vs code separated

During the building, I came into others questions: How to preserve context? Do I keep plan agent? Let the user create its own and how? Which providers, only local or openai compatible or full providers compat? Are subagents really usefull?

So for these questions, I had to do a lot of tests + benchmarking (SWE-verified against opencode) in order to really feel the impact of these stuff with "small" models (Qwen3.6, gemma 4). So I ended up with these choices:

- yes subagents are usefull and I spawn them via the tool calls but they work better when parallel calls are allowed by the inference endpoint

- keep plan agent as these models have tendancy to not surface enough for complex tasks

- openai compatble: do not want to mess with others plans and still local + cloud

- try to reduce as most as possible system prompt + tool schemas footprints in context without loosing quality because instructions really have an impact on the model behaviour (at least on these models) => ended with a total footprint of 3.4k tokens

Once the harness was providing results I was expecting, I then came into the fun parts: a webui + python allows a lot of built-in features (the challenge was to keep the experience simple):

- while not a TUI, a file explorer and possibility to select lines to add them in the llm context + diff viewer files modified/created

- browser autmation: first as a fun experiment with chrome CDP cause I remembered few months ago the https://huggingface.co/microsoft/Fara-7B realease. As first the tests were not really good but when looking at their examples and their Magentic-One then I followed and implemented a "planner" model on top of the grounding models and got much better results. After that I added the same philosophy but with DOM (accessibilitry tree) and now the tool allows to use dom (by default) + visual grounding if conditions are met. The result is fun so included the browser view (periodically screenshotted) inside the UI:

browser automation expanded view

​- The natural features following browser automation were obviously the skills and jobs so now I can just guide the agent to navigate on the internet only once then click on Create skill to see a form automatically prefilled by the llm so it will be able to execute "offline" at any time. Can be usefull for daily tasks and project webui tests.

skill form automatically prefilled

job form

​Now I am quite satisfied and plan to improve it in the future. If you want to give a try, please have a look at https://github.com/leflakk/openclose, any feedback or discussion about coding agent tools are welcome!

reddit.com
u/Leflakk — 10 days ago