Open-source UH harness: provider-agnostic tool calling, free-first routing, fail-closed permissions

omaths · reddit · 2026-11-30

The author shares architecture lessons from building UH, a local-first, provider-agnostic agent harness (GitHub: Antoine-Thomas/UH-Universal-Harness) that orchestrates any LLM (DeepSeek, free-tier models, local Ollama) with strict fail-closed permissions. Key patterns: a normalization layer translating tool calls across OpenAI-style/Anthropic-style schemas without losing context; a capability-based router implementing a "free-first" policy with tiered candidate chains, 429/timeout fallback, and a MAXCANDIDATES hard cap so paid models can't be silently reached; guards on every write path (file edits, shell, memory) that raise before any bytes are written unless the current mode (chat/dev/review/observe) explicitly allows it, enforced by filesystem snapshot tests; and a "second brain" integration with hybrid dense+BM25 RAG, SiYuan markdown knowledge base, and a bridge service with read/write separation so a downed service doesn't crash the loop. Spec is MIT, implementation FSL-1.1-MIT.

Original post →

More from coding & agent

coding & agent channel →