The harness wars are starting — here's the architecture that wins
Every serious AI shop is building the same thing right now: a harness. The abstraction layer between "AI agent that works in demos" and "AI agent that ships code to production."
OpenClaw gave us the primitives. Hermes gave us the protocols. Now everyone's racing to build the orchestration layer that makes agents actually reliable.
I've been running production coding agents for six months. Here's the architecture pattern that survived contact with real codebases:
The Three-Layer Stack: Session persistence, task validation, and completion hooks. Everything else is nice-to-have.
Layer 1: Session Persistence
Your agent needs to survive restarts, network drops, and SSH timeouts. Most harnesses try to solve this with complex state management. The winning pattern is simpler: tmux.
# Agent session wrapper tmux new-session -d -s "agent-work" -c "/path/to/project" tmux send-keys -t "agent-work" "source .env && python agent.py" Enter # Recovery is one line tmux attach-session -t "agent-work"
Your agent runs in a persistent shell. You can disconnect, reconnect, even reboot your laptop. The work continues.
Layer 2: Task Validation
Agents lie. They say they completed tasks when they hit errors, started tasks when they got distracted, finished tasks when they only did half the work.
The harnesses that work don't trust agent reports. They validate completion:
def validate_task_completion(task, expected_outputs):
"""Validate task completion with concrete checks"""
checks = {
'files_created': check_files_exist(expected_outputs['files']),
'tests_passing': run_test_suite(),
'git_status': check_clean_working_tree(),
'build_status': check_build_passes()
}
return all(checks.values()), checksDon't ask your agent if it's done. Check if it's done.
Layer 3: Completion Hooks
This is where most harnesses get fancy and break. The pattern that works: simple completion hooks that trigger next actions.
# completion_hooks.py
HOOKS = {
'feature_complete': [
'run_tests',
'create_pull_request',
'notify_slack'
],
'tests_passing': [
'update_documentation',
'tag_release_candidate'
]
}When task validation confirms completion, hooks fire automatically. No complex workflow engines. No state machines. Just "when X is done, do Y."
The Ralph Loop Pattern
The best harnesses I've seen all implement some version of what I call the "Ralph loop" — after the Simpsons character who just keeps going:
while not task_completed:
agent_action = agent.next_action()
result = execute_action(agent_action)
if validate_completion(task, result):
trigger_completion_hooks(task)
break
if should_escalate(attempts, errors):
escalate_to_human(task, context)
break
continue # Ralph keeps goingSimple persistence. Simple validation. Simple escalation. The harnesses trying to be clever are losing to the harnesses that just work.
Why This Matters Now
We're six months into the harness wars. The patterns are converging. The teams that figure out reliable orchestration first will have agents that actually ship while everyone else is still debugging state management.
Your coding agent doesn't need a PhD in distributed systems. It needs a harness that keeps it focused, validates its work, and escalates when things go wrong.