I wouldn’t say harnesses is simple. They do a lot of things that we aren’t thinking of. I learned that a good harnesses is as valuable as the model. But obviously the model is what carries the whole thing.
I tried to build my own harness once. The amount of work that is required is incredible. From how external memory is managed per session to the techniques to save on the context window, for example, you do not want the llm to read in whole files, instead you give it the capability to read chunks from offsets, but then what should stay in context and what should be pruned.
After that you have to start designing the think - plan - generate - evaluation pipeline. A learning moment for me here was to split up when the llm is evaluating the work, because same lllm who did the work should not evaluate itself, it introduces a bias. Then you realize you need subagents too and statt wondering how their context will be handled (maybe return a summarized version to the main llm?).
And then you have to start thinking about integration with mcp servers and how the llm should invoke things like tools, prompts and resources from each mcp. I learned llms, especially the smaller ones tend to hiccup and return malformed json format.
At some point I started wondering about just throwing everything and just look at PydanticAi or Langchain or Langgraph or Microsoft Autogen to operate everything between the llm and mcps. Its quite difficult to make something like this work well, especially for long horizontal tasks.
I've been running a custom harness in production for months (code gen on cloud boxes), it's quite simple (<500 LOC). The model can use sed or other nice bash tricks to efficiently read. U really don't need any tool besides bash plus a good system prompt. Subagents are the same as the main agent (end with a summary). U can just remove tool results (oldest first) to save context, the model can read again if it needs to. High quality memory is the only difficult part. But that can also be solved with high quality documentation