Unofficial Hacker News companion — get notified on comment replies,
and more.
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap
Share → Add to Home Screen, then open the installed app and enable push in Settings.
I'm really trying to get my head around harnesses for embedded development.
Application code can be harnessed and tested with the right abstractions. QEMU can emulate a system architecture. But the nature of embedded seems like a complete harness isn't likely
I'm particularly interested in keeping things performant while dealing with constrained resources. Access to spiflash/i2c bus/peripherals from multiple tasks. task starvation.. timing to service interrupt signals etc
I feel like spinning a board that has two mcu's: one for the target and another 'monitor' ?
relying on debug output is largely a no-go for real final production-ready code. about 10% of bugs come from testing with debug and removing in production
Give the harness the ability to do it how you would, debugger access and connected hardware with all the usual flash tools and it will just use the real hardware and same tools you do. Fundamentally they work best when they can completely test everything.
I found that giving it full debug to a tablet allowed it to deploy and test Android apps down the USB cable.
I haven't yet done an ESP32 project using an agent when I do it will be given some tools for debug directly and maybe some skill steers about how to do some things so it prefers to use the hardware over trying to emulate something.
LLMs can already just do that though. I still don't understand the point of harnesses. The other day I gave Codex an old Apple // rom and asked it to port it. It didn't need me to specify which tools to use, it just went at it and was done in like 10 minutes.
You're right, I should have said custom or configurable. I see lots of posts about fiddling with pi or whatever, creating tools for them etc, and just have never really felt like it was something I needed to do.
I think the answer to your question lies in frontier cloud LLMs vs Local LLMs.
Yes the frontier llms have gotten to the point that you can just say do “X” and they’ll do it. But from my experience the smaller local models are not there yet. Making these tools, memories etc via these extensible harnesses helps these local llms to perform better by guiding them.
An LLM can't do anything other than Text to text through a web interface. The harness connects it to the file system and everything else. You were using a harness of some description.
pi is 100k loc in it's core? i thought it was supposed to be minimal?
> Pi is a minimal agent harness.
it lacks basic features like subagents which people have fit into harnesses which are an order of magnitude smaller, so I'm not sure what they're doing over there...
Pi's model has always been "build your own harness" without building the core agent loop, which is why it's missing features like subagents and MCP (until very recently, they just added MCP). OpenClaw is built on top of Pi's core, and became the thing it is today because the core was so small so they could just build the giant automated agent framework they built and not have to build a core agent coding system.
Here's an example, this is my own personal harness. The core part is smaller than that, but the whole project in sum is bigger than 100k -- does have full subagents with workflow graphs though.
Pi's main super power is that it gives the agent the ability to edit the harness, the harness provides skills and tools as the user adds them, which they can do manually from outside pi, within pi or ask the agent to build something and it then accesses the guides to do so. It comes with no skills but it has the ability to use existing ones and that seems absent on the image.
The harness choice can actually have a massive impact on the performance of the LLM. Not just the context burnt on the system prompt but the prompt and tools themselves can considerably change how much a task costs and the chance of success. Pi is basically never first for any individual model, but its usually top 3 because of how minimal it is.
There is pretty much no sandbox behaviour at all, so it can read and write files across the entire system. What pi does in its system prompt is tell the agent where it can find markdown files that explain skills and extensions alongside examples. If you prompt it to make a new skill or extension it will then go about doing so and inserts them into either ~/.pi/ or the current directory .pi depending on what makes most sense on what you asked.
I have made one extension called globalstats which iterates over all the sessions and costs up everything across various agents (with locals being negative price of the most common used cloud option, sort of money saved) and I have some skills about accessing dev servers and where to find the docker settings and up/down aliases so it can add things.
I use pi extensions liberally, but I also used claude config for similar extensions. For sure, pi is way more extensible and I prefer it. I just don't think it's so mind blowing as people think. It's basically the simplest harness you can get, with well defined extension mechanisms.
> There is pretty much no sandbox behaviour at all, so it can read and write files across the entire system.
It does provide hooks, so tool calls can be intercepted/gated/etc. The first thing I did with pi was have it write an extension that asks for permission for each Bash invocation. I've extended that with a simple Python script which auto-denies known-bad things (e.g. running find on /), auto-allows known-safe things (e.g. non-destructive text processing pipelines), and asks me for anything else.
Its tools can also be switched-out; e.g. I've replaced its read/write/edit tools with alternatives which invoke emacsclient. There's no reason you couldn't replace its tools with sandboxed alternatives, if you wanted.
I use pi from Emacs, via its RPC interface (I hate TUIs). I've replaced pi's reading/writing tools with alternatives which invoke emacsclient. That way:
- Emacs buffers remain up to date (rather than the on-disk content changing underneath it).
- I can use ordinary undo, etc. on changes made by pi.
- Various editor conveniences are automatically applied, e.g. auto-formatting of code; showing the contents of compressed files; etc.
- The LLM is given extra metadata, like warnings from linters/compilers/LSP/etc.
- The same tools work for buffers which aren't files (e.g. shells, Web browser, etc.)
pi allowing an LLM access to renewing itself was why i chose it for tabichat.dev (my multi-agent chat system). nearly everything i do is long-running, spanning multiple sessions. tabichat includes allowing chat members to renew themselves and keep going. mTLS MQTT broker, so everything stays local and private.
Tbf you can do this with any harness if a MCP is the thing providing the tools, and the agent can make plugins for the software that supplies the MCP. My orchestrator has worked this way for months.
Pi’s strengths is making changes beyond MCP. You can have the harness behave exactly like you’d prefer. It’s incredibly satisfying to think “I wish it would do x!” And then have it do x.
I recently noticed that claude code tui has a button at the top of the screen to go to the last user message instead of having to scroll back through all the output to find it. I just prompted pi that I wanted this feature and it wrote an extension for me and I only had to `/reload`. Not super complicated, but maybe inspiring all the same.
I have a lot of qol little things like a /quiet that only output chat output and hides all tool use/thinking so it is easier to go back and read what was outputted. Made a little pinboard so I can have it put whatever on screen and it doesn’t scroll away. Made a sub-process that runs a fast agent to search through my context files and generate instructions and inject them into the system prompt but only if I asked it to do something - this alone solved almost all my “first attempt at certain mcp or commands get an error” issues.
People like to say this about pi but it’s only really extensible in a handful of ways. If you want to go beyond that then either you’re completely rewriting core parts of it or you’re stuck with what they’re doing.
Low level TUI behavior changes (important for accessibility). E.g. disabling status line refreshes to reduce screen reader output spam when the harness is working, replace the menu component for all menus with one that uses a hardware cursor instead of Unicode and colors for highlighting, replace the rendering system with one that is character based and not line based (so that screen readers don't re-read the whole line on every single keystroke in the prompt field).
The other commenter has some examples but just off the top of my head when I was working with I had stuff like the find and grep tools being hardcoded to shell out to their own binary with no way to really intercept them, also a bunch of APIs are just kind of limited (for example you can get the first message in a session but not the last for whatever reason). You can't override the default commands, a bunch of stuff just does things exactly how pi does it and is not flexible at all (e.g. there is a MIME sniffer but it needs a file on disk, not bytes). Basically if you push it hard you will constantly run into issues where the interfaces that are provided are clearly not being tested–the core design is quite good but it's not being extended and I am sure all their feedback is just people slopping so I doubt they really listen to it much.
Yeah, I wish we had a Shadcn-style composable harness (Pi is configurable but not composable).
Give me a top-level ~1000loc harness.py that just connects the major components together, letting me replace any of them as I see fit. No settings or configurability whatsoever, configuration just means asking the LLM to edit the harness.
Also, I think at this point, it's clear what a harness architecture should be. You should have four components, the UI (TUI, GUI, web, nothing for automated workflows like CI reviews) which runs on the users' actual machine, the "brain" (the LLM itself), the "hands" (the actual tools, running on the machine that the work happens on, which could be a remote server, and the "nerves" (the part which owns the actual loop, skills, transcript store and memory), preferably running on some persistent server that can be accessed through multiple machines.
You can do this with any harness, the plugin system, and running a new/different instance. I was doing this for the last ~6months, but am now going back to my own personal harness development.
I still hold the opinion that harness engineering is an important thing to try in the age of Ai - and that there is a lot to still unlock a this layer (which merges prompt, context, tool, workflows, and more from related * engineering)
Yeah, without a proper structure set up for work in the harness you might as well burn your cash haha
For a long time I struggled to find a way to stop my agents from clobbering each others work and I feel like claude codes hooks work well but its not exactly the most token efficient harness...
I had an interesting circular journey when it comes to plugins. When I started, I went all-in on the everything-is-a-plugin mindset, so every aspect of Juggler is a plugin: the LLM loop strategies, every type of item in a context, their UIs, even helper UIs like file viewers, and loads more things are all extensions.
Everything works great, but over the last year building it, the models grew so capable that those custom plugins I thought I would write just aren't needed. The models just don't need extra tools for specific projects or tasks. I've created loads of great built-in extensions, but these could just as well have been part of the app.
However, plugins were the right choice, if for the wrong reason: harnesses are surprisingly huge beasts, and enforcing plugin APIs ("seams" as I'm sure claude would call them) is a great barrier to prevent slop-creep across the app as these new features are added. So.. I'm very happy with the architecture I built, but not for the reason I expected!
Nice guide especially the snapshot is useful. Just a thing, the most of the harnesses has a model writing its memory which could be a bit wrong in a type a model has interpreted its experience like not remembering an experience or misreading it. In my own experiments trying with an example taking a bus to office did not update to taking a metro after a later message outdating the fact. Does any of these harnesses handle outdated or conflicting memory? and can a agent simply say it has no memory instead of making new story?
LLMs in general can get anchored on a fact and not really be open to changing. If you change your mind mid way down a session it can cause a lot of confusion and thinking to happen. They don't handle changing facts well at all yet.
Yeah true and in multi session its kinda more worse since models do not update easily on newer facts and still the old fact stays in memory so they kinda give importance to that also. BTW, have you seen any harness that updates its memory correctly according to ongoing facts.
No. I just assume that if the facts change its time for a new context. I haven't played much with the long running contexts for this reason, the anchoring and tendency to bring up now out of date things just isn't worth it yet. I am sure that will change, they seem to want very long running agents to be a thing and that is going to involve contexts spanning days not hours.
Google actually updated the Antigravity terms in the last day or so. You can now run the unmodified Antigravity harness through a third-party UI, call it as a tool/subagent from another harness, or run the CLI headless. Violations now only cost you Antigravity access, not your whole Google account. However, using your subscription entitlements directly from another harness (e.g., Pi hitting the API with Antigravity creds) is still prohibited.
Separately, Logan Kilpatrick replied "December 2nd we take the first step" when asked about allowing Gemini subs in any harness. No details yet, so it'll be interesting to see what lands tomorrow.
Which harness do people prefer when they want to use subagents and selective memory? Meaning there is a memory that is periodically written do, but each subagent only gets the memory relevant to the narrow task given to them?
I might be taking your question to a super-specific spot: But we've found that a solid directory strucuture answers a lot of those questions. If you can point (sub)agent at a/b/c as the place to work... it gets a lot easier.
I simply asked google antigravity to setup an "Aleph"[1] chat system inspired by how maildirs[2] work (I'm not in fact certain that it follows all salient points of that spec, but it works well enough for me).
I use it in a monorepo setup - but I also earlier used it across seperate repos.
The main thing is "the aleph" - a shared read-write store - and a hook or skill in every project session that tells the model to use it to communicate.
I don't use it too much - but you can use it free-form:
> Make a note in aleph chat about following XYZ style guidelines.
> Tell all models to hold deploy while vm is being rebuilt. Send an all clear when it is up.
> Check aleph chat for any pending releases to our website.
Etc.
I just discovered that my "ideas" project wasn't connected, and it sounded very happy when it could correct that, lol:
>> No, was thinking of aleph chat - do you not have that skill from sibling repo?
> Found it in www/aleph/README.md!
> (...) 2. Why I didn’t have the agent-chat skill loaded
> Your global config still points to the old path before aleph was moved inside www/:
~/.gemini/config/skills.json points to (...) (doesn’t exist) instead of www/aleph/skills.
~/.gemini/config/AGENTS.md is a broken symlink to (...)
Anyway, I asked it to export it as a public gist - should probably work for Claude as well as antigravity:
[1] "A piece of bio-soft the size of a paperback book... an Aleph, a microscopic simulation of cyberspace... where the construct of the Finn lived."
— William Gibson, Mona Lisa Overdrive
So those are still single-user like harness. Not sure where the future will be: harness as a service like the SaaS today or purely personal harness, or something beyond my imagination...
Still reading the article and so far I really like it. I just wanted to mention how refreshing it feels to read something that is not AI generated prose about a technical subject I want to learn about. Somehow AI prose is still much more "senseless" or confusing to read than what a human would write.
Interesting, the harness I'm developing (https://github.com/Mirantis/prism) has like 300k lines of code, and the architecture looks like a mix between OpenCode and Hermes.
I'm wondering if ReAct is still a thing - it was mentioned in article and whole chapter is in book? From what I experience, current LLMs are able to do it out of box with tool calling or I'm missing something.
The react loop involves both the llm(opus etc.) and harness(claude code,pi etc).
Given a user query, the llm first thinks a bit and then decide to call a tool. It returns a message, something like "call tool: bash ..." This gets intercepted by the harness which actually executes the bash script. Remember that at the end of the day LLMs are text generating models. They don't have any inbuilt capabilities to run anything on their own
But when I look at intercepted Bedrock requests I see tool calls going in and out as part of API and I think things like json validation and tool calls are built quite deep into the LLM runtime, so I'm not sure if that could be called harness, because I can't change that part. I saw the pi system prompt, it does not do anything regarding ReAct, that is why I'm confused. I can do pretty much empty system prompt using just API and still get tool call behavior.
This doesn't talk about the meaty stuff - how every piece of the harness should be implemented as a plugin. That's a forcing function to make a system that's extensible with the correct design patterns.
Every primitive of the harness will evolve over time - will also get eaten up by the llm itself imo.
Shelf-life of a custom harness setup is probably 3 months
This is excellent work, and really important. In my experience, most people don't take the time (or care!) to learn about how their harness works. I've been guilty of this many times
In our research, we call these different agent configurations agent "shapes" and we take these shapes into account when building agent detection models.
Somewhat related—I am currently reading the OPs (along with Jay Alammar's) book "An Illustrated Guide to AI Agents: Concepts and Code for Building Agents with LLMs, Tools, and Memory" (https://www.amazon.com/Illustrated-Guide-AI-Agents-Concepts/...) and it is very well written. Only upto chapter 5 so far, but very illustrative, and aligns well with how I'd approach teaching agents and agent harnesses to audiences.
I use Muse as my "harness" for Claude code. I like the setup a lot. Muse is excellent at agentic work that Claude refuses while being extremely intuitive. Muse acts as a sort of COO to Claude code on my projects and they ration compute as needed between them. I run Claude code on the VM that is included with the Muse sub. It is an extremely effective setup for on the go dictation and then you can take over your Claude code whenever you want.
Application code can be harnessed and tested with the right abstractions. QEMU can emulate a system architecture. But the nature of embedded seems like a complete harness isn't likely
I'm particularly interested in keeping things performant while dealing with constrained resources. Access to spiflash/i2c bus/peripherals from multiple tasks. task starvation.. timing to service interrupt signals etc
I feel like spinning a board that has two mcu's: one for the target and another 'monitor' ?
relying on debug output is largely a no-go for real final production-ready code. about 10% of bugs come from testing with debug and removing in production
Dunno!
Replies (2)
I found that giving it full debug to a tablet allowed it to deploy and test Android apps down the USB cable.
I haven't yet done an ESP32 project using an agent when I do it will be given some tools for debug directly and maybe some skill steers about how to do some things so it prefers to use the hardware over trying to emulate something.
Replies (1)
Replies (4)
Replies (1)
Replies (1)
Yes the frontier llms have gotten to the point that you can just say do “X” and they’ll do it. But from my experience the smaller local models are not there yet. Making these tools, memories etc via these extensible harnesses helps these local llms to perform better by guiding them.
A harness is a piece of code that that pushes tokens through it, and optionally does something with it beyond just showing what came out to you.
The only thing missing is making it deterministic, in a reproducible testing workflow.
Source: buiding a harness for reverse engineering and pentesting (and counter malware development) which is focused on Go primarily
> Pi is a minimal agent harness.
it lacks basic features like subagents which people have fit into harnesses which are an order of magnitude smaller, so I'm not sure what they're doing over there...
Replies (4)
Replies (1)
https://github.com/devoidfury/hotdog
The harness choice can actually have a massive impact on the performance of the LLM. Not just the context burnt on the system prompt but the prompt and tools themselves can considerably change how much a task costs and the chance of success. Pi is basically never first for any individual model, but its usually top 3 because of how minimal it is.
Replies (6)
Replies (2)
I have made one extension called globalstats which iterates over all the sessions and costs up everything across various agents (with locals being negative price of the most common used cloud option, sort of money saved) and I have some skills about accessing dev servers and where to find the docker settings and up/down aliases so it can add things.
Replies (2)
It does provide hooks, so tool calls can be intercepted/gated/etc. The first thing I did with pi was have it write an extension that asks for permission for each Bash invocation. I've extended that with a simple Python script which auto-denies known-bad things (e.g. running find on /), auto-allows known-safe things (e.g. non-destructive text processing pipelines), and asks me for anything else.
Its tools can also be switched-out; e.g. I've replaced its read/write/edit tools with alternatives which invoke emacsclient. There's no reason you couldn't replace its tools with sandboxed alternatives, if you wanted.
Replies (1)
Replies (2)
- Emacs buffers remain up to date (rather than the on-disk content changing underneath it).
- I can use ordinary undo, etc. on changes made by pi.
- Various editor conveniences are automatically applied, e.g. auto-formatting of code; showing the contents of compressed files; etc.
- The LLM is given extra metadata, like warnings from linters/compilers/LSP/etc.
- The same tools work for buffers which aren't files (e.g. shells, Web browser, etc.)
Replies (2)
So it's pair programming with the machine in the best sense.
Though I don't understand how read/write works with emacsclient and pi. Care to share?
Continue this thread (1 replies) →
...and 20 features later I realized I just need to download omp.sh
Replies (1)
Replies (2)
Replies (2)
Replies (2)
Replies (2)
Replies (2)
Continue this thread (1 replies) →
Give me a top-level ~1000loc harness.py that just connects the major components together, letting me replace any of them as I see fit. No settings or configurability whatsoever, configuration just means asking the LLM to edit the harness.
Also, I think at this point, it's clear what a harness architecture should be. You should have four components, the UI (TUI, GUI, web, nothing for automated workflows like CI reviews) which runs on the users' actual machine, the "brain" (the LLM itself), the "hands" (the actual tools, running on the machine that the work happens on, which could be a remote server, and the "nerves" (the part which owns the actual loop, skills, transcript store and memory), preferably running on some persistent server that can be accessed through multiple machines.
Many harnesses conflate these to their detriment.
Replies (1)
I still hold the opinion that harness engineering is an important thing to try in the age of Ai - and that there is a lot to still unlock a this layer (which merges prompt, context, tool, workflows, and more from related * engineering)
Also OoenCode go is top, that can be used with pi too of course
I had an interesting circular journey when it comes to plugins. When I started, I went all-in on the everything-is-a-plugin mindset, so every aspect of Juggler is a plugin: the LLM loop strategies, every type of item in a context, their UIs, even helper UIs like file viewers, and loads more things are all extensions.
Everything works great, but over the last year building it, the models grew so capable that those custom plugins I thought I would write just aren't needed. The models just don't need extra tools for specific projects or tasks. I've created loads of great built-in extensions, but these could just as well have been part of the app.
However, plugins were the right choice, if for the wrong reason: harnesses are surprisingly huge beasts, and enforcing plugin APIs ("seams" as I'm sure claude would call them) is a great barrier to prevent slop-creep across the app as these new features are added. So.. I'm very happy with the architecture I built, but not for the reason I expected!
Replies (1)
Replies (1)
Replies (1)
Replies (2)
Replies (1)
Replies (1)
Separately, Logan Kilpatrick replied "December 2nd we take the first step" when asked about allowing Gemini subs in any harness. No details yet, so it'll be interesting to see what lands tomorrow.
Replies (2)
I use it in a monorepo setup - but I also earlier used it across seperate repos.
The main thing is "the aleph" - a shared read-write store - and a hook or skill in every project session that tells the model to use it to communicate.
I don't use it too much - but you can use it free-form:
> Make a note in aleph chat about following XYZ style guidelines.
> Tell all models to hold deploy while vm is being rebuilt. Send an all clear when it is up.
> Check aleph chat for any pending releases to our website.
Etc.
I just discovered that my "ideas" project wasn't connected, and it sounded very happy when it could correct that, lol:
>> No, was thinking of aleph chat - do you not have that skill from sibling repo?
> Found it in www/aleph/README.md!
> (...) 2. Why I didn’t have the agent-chat skill loaded
> Your global config still points to the old path before aleph was moved inside www/:
~/.gemini/config/skills.json points to (...) (doesn’t exist) instead of www/aleph/skills. ~/.gemini/config/AGENTS.md is a broken symlink to (...)
Anyway, I asked it to export it as a public gist - should probably work for Claude as well as antigravity:
https://gist.github.com/e12e/4f3abf426d55a5a2df8f8de4eb1335b...
[1] "A piece of bio-soft the size of a paperback book... an Aleph, a microscopic simulation of cyberspace... where the construct of the Finn lived." — William Gibson, Mona Lisa Overdrive
[2] https://cr.yp.to/proto/maildir.html
Replies (1)
Replies (1)
Let me know if it doesn't work, I'm sure I can extract some code.
Replies (1)
Jokes aside, yes i agree the prose (whether it is written by human or AI) is very clear and great!
Replies (2)
Given a user query, the llm first thinks a bit and then decide to call a tool. It returns a message, something like "call tool: bash ..." This gets intercepted by the harness which actually executes the bash script. Remember that at the end of the day LLMs are text generating models. They don't have any inbuilt capabilities to run anything on their own
Replies (1)
Every primitive of the harness will evolve over time - will also get eaten up by the llm itself imo.
Shelf-life of a custom harness setup is probably 3 months
Replies (1)
In our research, we call these different agent configurations agent "shapes" and we take these shapes into account when building agent detection models.