rewrite: refresh all blog posts for public audience
Merged overlapping posts: - forking-gitea + fork-dont-build → one post about the fork philosophy - fal-image-generation + image-generation-fal → one post about AI art pipeline Rewrote all posts with external/public voice: - Stronger hooks, concrete examples, punchier language - agentic-workflow: restructured around soul files + skills + numbers - agent-harness: clearer framing of 'what an agent harness is' - cloud-harness: tighter narrative about overnight agents - godot-optimisation: same depth, sharper opening - pre-commit-agent: clearer architecture, cost breakdown - studio-cli: reframed around identity/cold-start problem - blog-visual-upgrade: tightened the restyle story 10 posts total (9 markdown + 1 hand-authored HTML)
This commit is contained in:
+50
-78
@@ -4,27 +4,27 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Building a Cloud Agent Harness with DeepSeek V4 and Pi — Tinqs Blog</title>
|
||||
<meta name="description" content="We forked Pi, merged a browser dashboard into the monorepo, and built a Go orchestrator inside our Gitea fork. Agents code overnight for about $0.80 — and you can watch them from localhost:33634.">
|
||||
<title>Agents That Code Overnight: Our $0.80 Cloud Harness with DeepSeek V4 and Pi — Tinqs Blog</title>
|
||||
<meta name="description" content="A Pi fork for the brain, a Go orchestrator inside Gitea for overnight batch work, and a browser dashboard for daytime. Agents code while you sleep for about $0.80.">
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="canonical" href="https://www.tinqs.com/blog/cloud-harness">
|
||||
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://www.tinqs.com/blog/cloud-harness">
|
||||
<meta property="og:title" content="Building a Cloud Agent Harness with DeepSeek V4 and Pi">
|
||||
<meta property="og:description" content="Pi fork, merged agent dashboard, and a Go orchestrator inside Tinqs Studio.">
|
||||
<meta property="og:title" content="Agents That Code Overnight: Our $0.80 Cloud Harness with DeepSeek V4 and Pi">
|
||||
<meta property="og:description" content="Pi fork + Go orchestrator + browser dashboard. Agents code overnight for $0.80.">
|
||||
<meta property="og:image" content="https://www.tinqs.com/blog/img/cloud-harness-architecture.png">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Building a Cloud Agent Harness with DeepSeek V4 and Pi">
|
||||
<meta name="twitter:description" content="Pi fork, merged agent dashboard, and a Go orchestrator inside Tinqs Studio.">
|
||||
<meta name="twitter:title" content="Agents That Code Overnight: Our $0.80 Cloud Harness with DeepSeek V4 and Pi">
|
||||
<meta name="twitter:description" content="Pi fork + Go orchestrator + browser dashboard. Agents code overnight for $0.80.">
|
||||
<meta name="twitter:image" content="https://www.tinqs.com/blog/img/cloud-harness-architecture.png">
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"headline": "Building a Cloud Agent Harness with DeepSeek V4 and Pi",
|
||||
"headline": "Agents That Code Overnight: Our $0.80 Cloud Harness with DeepSeek V4 and Pi",
|
||||
"datePublished": "2026-05-26",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
@@ -35,7 +35,7 @@
|
||||
"name": "Tinqs Limited",
|
||||
"url": "https://www.tinqs.com"
|
||||
},
|
||||
"description": "We forked Pi, merged a browser dashboard into the monorepo, and built a Go orchestrator inside our Gitea fork. Agents code overnight for about $0.80 — and you can watch them from localhost:33634."
|
||||
"description": "A Pi fork for the brain, a Go orchestrator inside Gitea for overnight batch work, and a browser dashboard for daytime. Agents code while you sleep for about $0.80."
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -218,103 +218,75 @@
|
||||
<article class="post">
|
||||
<a href="/blog/" class="post__back">← All Posts</a>
|
||||
<span class="post__date">26 May 2026</span>
|
||||
<h1 class="post__title">Building a Cloud Agent Harness with DeepSeek V4 and Pi</h1>
|
||||
<p class="post__lead">We spent a few sessions building something that still barely exists elsewhere: a cloud agent harness where AI coding agents are first-class citizens of the platform, not bolt-on tools. The stack is a <a href="https://tinqs.com/tinqs/pi" style="color: var(–c-accent-l);">Pi fork</a> for the brain, a Go orchestrator inside our <a href="https://tinqs.com/tinqs/studio" style="color: var(–c-accent-l);">Gitea fork</a> for overnight work, and a browser dashboard merged into Pi for the daytime. Here is how it fits together.</p>
|
||||
<h1 class="post__title">Agents That Code Overnight: Our $0.80 Cloud Harness with DeepSeek V4 and Pi</h1>
|
||||
<p class="post__lead">Every coding agent today — Claude Code, Codex, Cursor, Pi — has the same limitation: it runs in your terminal. You watch it work. You close the laptop, it stops. There's no way to say "build these eight features overnight" and wake up to pull requests.</p>
|
||||
|
||||
<div class="post__body">
|
||||
<h2>The Problem</h2>
|
||||
<p>Every coding agent today — Claude Code, Codex, Pi, Aider — runs in your terminal. You watch it work. You close the laptop, it stops. There is no way to say "build these eight features overnight" and wake up to pull requests.</p>
|
||||
<p>We wanted exactly that. Not a coding assistant. An autonomous workforce — with a UI when a human needs to be in the loop.</p>
|
||||
<h2>Why Not Just Use Claude Code or Codex?</h2>
|
||||
<p><strong>Cost.</strong> Claude Code runs on Opus at $15/MTok output. Codex uses GPT 5.5. Running eight agents overnight on either would cost $50–200. DeepSeek V4 Flash costs $0.28/MTok output. Eight overnight tasks: <strong>about $0.80</strong>.</p>
|
||||
<p><strong>Control.</strong> Cloud tools are black boxes. We cannot add a Gitea API tool, a fal.ai image generator, or a guardrail that blocks <code>aws ec2 terminate-instances</code>. With our own harness, we add an extension and it is live.</p>
|
||||
<p><strong>Platform.</strong> We are building <a href="https://tinqs.com" style="color: var(–c-accent-l);">Tinqs Studio</a> — a Gitea-based game development platform. Agents are not a feature we want to outsource. They are the product.</p>
|
||||
<h2>Pi — The Agent Brain</h2>
|
||||
<p><a href="https://pi.dev" style="color: var(–c-accent-l);">Pi</a> is an open-source coding agent by Mario Zechner. MIT license, TypeScript, minimal by design — four core tools (read, write, edit, bash) and an extension system.</p>
|
||||
<p>We <a href="https://tinqs.com/tinqs/pi" style="color: var(–c-accent-l);">forked it</a>. Not to rewrite the core — to add first-party extensions:</p>
|
||||
<p>We built exactly that. A Pi fork for the brain, a Go orchestrator inside our Gitea platform for overnight batch work, and a browser dashboard for daytime. Here's the stack.</p>
|
||||
<h2>The problem with terminal-only agents</h2>
|
||||
<p>Claude Code runs on Opus at $15/MTok output. Codex uses GPT-5.5. Running eight agents overnight on either would cost $50-200. That's not sustainable for a four-person studio.</p>
|
||||
<p>DeepSeek V4 Flash costs $0.28/MTok output. Eight overnight tasks: <strong>about $0.80</strong>. The cost differential changes what's possible — from "I'll use this sparingly" to "run it on everything."</p>
|
||||
<p>But cost isn't the only issue. Cloud tools are black boxes. You can't add a Gitea API tool, a fal.ai image generator, or a guardrail that blocks destructive commands. With our own harness, you add an extension and it's live. Agents are not a feature to outsource — they're the product.</p>
|
||||
<h2>Pi — the agent brain</h2>
|
||||
<p><a href="https://pi.dev" style="color: var(–c-accent-l);">Pi</a> is an open-source coding agent. MIT license, TypeScript, 51k stars. Four core tools (read, write, edit, bash) and an extension system. We forked it and added four extensions:</p>
|
||||
<ul>
|
||||
<li><strong>tinqs-provider</strong> — routes DeepSeek V4 Flash and Pro through our inference proxy</li>
|
||||
<li><strong>tinqs-tools</strong> — Gitea REST API, fal.ai image generation, Amazon Nova Lite vision</li>
|
||||
<li><strong>tinqs-ci</strong> — reads CI pipeline status, logs, and polls for completion</li>
|
||||
<li><strong>tinqs-guardrail</strong> — 29 safety patterns that block dangerous operations</li>
|
||||
<li><strong>tinqs-provider</strong> — routes DeepSeek V4 Flash/Pro through our inference proxy</li>
|
||||
<li><strong>tinqs-tools</strong> — Gitea REST API, fal.ai image generation, vision model access</li>
|
||||
<li><strong>tinqs-ci</strong> — reads CI pipeline status, logs, polls for completion</li>
|
||||
<li><strong>tinqs-guardrail</strong> — 29 safety patterns blocking dangerous commands</li>
|
||||
</ul>
|
||||
<p>Each extension is a single TypeScript file. No extra npm dependencies on the extension side.</p>
|
||||
<p>Pi has four output modes. The one that matters for automation is <strong>RPC</strong> — a headless process that accepts JSON on stdin/stdout. That is how the orchestrator drives it.</p>
|
||||
<h2>DeepSeek V4 — The LLM</h2>
|
||||
<p>Each extension is a single TypeScript file. No npm dependencies. The core Pi code is untouched — we only add files.</p>
|
||||
<p>Pi's RPC mode is what makes overnight automation possible. It runs headless, accepting JSON on stdin/stdout. The orchestrator spawns it as a subprocess, sends tasks, receives results. No terminal, no editor UI.</p>
|
||||
<h2>DeepSeek V4 — the LLM</h2>
|
||||
<p>DeepSeek V4 Flash through our own inference proxy. OpenAI-compatible API, so Pi treats it like any other provider. The proxy adds:</p>
|
||||
<ul>
|
||||
<li>Redis job queue (10 concurrent workers)</li>
|
||||
<li>Per-user usage tracking</li>
|
||||
<li>System prompt injection for cache hit optimization</li>
|
||||
<li>Gitea PAT authentication (same token as git push)</li>
|
||||
<li>System prompt injection for cache-hit optimization</li>
|
||||
<li>Gitea PAT authentication — same token as git push</li>
|
||||
</ul>
|
||||
<p>Cost per task: <strong>$0.02–0.10</strong> depending on complexity.</p>
|
||||
<h2>Go Orchestrator — Overnight Batch Work</h2>
|
||||
<p>Inside <code>tinqs/studio</code> we added <code>modules/agents/</code> — a Go worker pool that:</p>
|
||||
<ul>
|
||||
<li>Spawns Pi with <code>–mode rpc –no-session</code></li>
|
||||
<li>Tracks task lifecycle (pending → running → done)</li>
|
||||
<li>Streams events over <strong>SSE</strong> to any connected UI</li>
|
||||
<li>Enforces guardrails at the platform layer (worker limits, timeouts)</li>
|
||||
</ul>
|
||||
<p>Six HTTP endpoints, same auth as git push:</p>
|
||||
<p>Cost per task: $0.02-0.10 depending on complexity.</p>
|
||||
<h2>Go orchestrator — overnight batch work</h2>
|
||||
<p>Inside our Gitea fork we added <code>modules/agents/</code> — a Go worker pool that spawns Pi processes, tracks task lifecycle, and streams events over SSE to any connected UI. Six endpoints, same auth as git push:</p>
|
||||
<pre><code>POST /api/v1/agents/tasks — submit a task
|
||||
GET /api/v1/agents/tasks — list all tasks
|
||||
GET /api/v1/agents/tasks/{id} — get task details
|
||||
DELETE /api/v1/agents/tasks/{id} — stop a task
|
||||
GET /api/v1/agents/stream — SSE live events
|
||||
GET /api/v1/agents/health — orchestrator status</code></pre>
|
||||
<p>We considered bolting on a separate orchestration SaaS and rejected it. The orchestrator lives in the same binary as git — same auth, no extra service to deploy.</p>
|
||||
<p>The intended loop:</p>
|
||||
<p>The orchestrator lives in the same binary as git — same auth, no extra service to deploy. The intended loop:</p>
|
||||
<pre><code>Orchestrator reads task brief
|
||||
→ spawns pi --mode rpc
|
||||
→ Pi writes code using DeepSeek V4
|
||||
→ Pi pushes branch, calls ci_wait
|
||||
→ CI green → Pi opens PR via gitea_api
|
||||
→ CI red → Pi reads ci_logs, fixes, retries
|
||||
→ CI red → Pi reads ci_logs, fixes, retries (≤3)
|
||||
→ Human reviews PR, merges</code></pre>
|
||||
<p>Git worktree integration and full push/PR automation are still being wired; the API and worker pool already run locally.</p>
|
||||
<h2>Pi Dashboard — Browser UI (Shipped)</h2>
|
||||
<p>The cloud orchestrator is for batch work while you sleep. During the day you want to see agents, chat with them, and spawn sessions without living in a terminal.</p>
|
||||
<p>We merged <a href="https://github.com/BlackBeltTechnology/pi-agent-dashboard" style="color: var(–c-accent-l);">pi-agent-dashboard</a> into the Pi monorepo — not as a second repo to install. One checkout, one command:</p>
|
||||
<h2>Browser dashboard — daytime UI</h2>
|
||||
<p>The orchestrator is for overnight batch work. During the day, you want to see agents, chat with them, and spawn sessions — without living in a terminal.</p>
|
||||
<p>We merged <a href="https://github.com/BlackBeltTechnology/pi-agent-dashboard" style="color: var(–c-accent-l);">pi-agent-dashboard</a> into the Pi monorepo. One command:</p>
|
||||
<pre><code class="language-bash">npm run dashboard:dev</code></pre>
|
||||
<p>Open <strong>http://localhost:33634</strong>. You get:</p>
|
||||
<ul>
|
||||
<li><strong>Live session streaming</strong> — watch tool calls and model output in real time</li>
|
||||
<li><strong>Interactive chat</strong> — send prompts, answer <code>ask_user</code> dialogs from the browser</li>
|
||||
<li><strong>Session spawning</strong> — start Pi in any pinned project folder</li>
|
||||
<li><strong>Cost tracking</strong> — per-session token usage when using Tinqs inference</li>
|
||||
<li><strong>Plugins</strong> — flows, subagents, workspace helpers</li>
|
||||
</ul>
|
||||
<p>The dashboard talks to Pi sessions over a WebSocket bridge on port <strong>9999</strong>. Inference uses the same Tinqs proxy as the CLI — register a custom provider in <code>~/.pi/agent/providers.json</code> and authenticate with your existing <code>tstudio</code> token. No separate LLM API keys.</p>
|
||||
<pre><code>Dashboard (localhost:33634)
|
||||
<p>Open <code>localhost:33634</code> and you get live session streaming (watch tool calls and model output in real time), interactive chat, session spawning in any project folder, and per-session cost tracking. The dashboard talks to Pi sessions over WebSocket on port 9999. Inference uses the same Tinqs proxy as the CLI — one API key, one billing account.</p>
|
||||
<pre><code>Browser (localhost:33634)
|
||||
↕ WebSocket (port 9999)
|
||||
Pi sessions (interactive or headless)
|
||||
↕ OpenAI-compatible API
|
||||
Tinqs Studio proxy (tinqs.com/api/v1/ai)
|
||||
Tinqs proxy (tinqs.com/api/v1/ai)
|
||||
↕ DeepSeek V4 Flash / Pro</code></pre>
|
||||
<p>When Studio runs locally with agents enabled, the dashboard can also talk to the orchestrator API on port 3000 — submit tasks and watch SSE events in the same UI.</p>
|
||||
<p>One browser tab for daytime work; the orchestrator queue for overnight runs.</p>
|
||||
<h2>The Guardrail</h2>
|
||||
<p>Our biggest fear: an agent hallucinating instead of using tools, or running <code>aws ec2 terminate-instances</code> at 3 AM.</p>
|
||||
<p>The guardrail extension monitors every agent turn:</p>
|
||||
<p><strong>Hallucination detection</strong> — if the agent claims file contents without calling <code>read</code>, it gets corrected.</p>
|
||||
<p><strong>No-tool drift</strong> — three consecutive turns without a tool call triggers a warning.</p>
|
||||
<p><strong>Command blocking</strong> — 29 patterns covering destructive git, AWS teardown, process killing, and production API abuse.</p>
|
||||
<h2>What It Cost to Build</h2>
|
||||
<p>A few focused sessions: about 2,000 lines of Go, 900 lines of TypeScript extensions, 52 tests, plus merging the dashboard packages into the Pi monorepo. No new servers — Pi is a Node subprocess; the dashboard is another Node process on your machine.</p>
|
||||
<h2>What Is Next</h2>
|
||||
<p>| Piece | Status |</p>
|
||||
<p>|——-|——–|</p>
|
||||
<p>| Pi fork + tinqs extensions | Shipped |</p>
|
||||
<p>| Dashboard merged into Pi monorepo | Shipped |</p>
|
||||
<p>| Go orchestrator + REST/SSE API | MVP, running locally |</p>
|
||||
<p>| Git worktree + push + PR loop | In progress |</p>
|
||||
<p>| Domain routing (game / sim / platform tasks) | Designed |</p>
|
||||
<p>Next we are promoting studio skills from IDE playbooks into orchestrator prompt packs — so the same Pi worker behaves like a game builder, sim maintainer, or platform engineer depending on the task. Specialized agents (planner, reviewer, asset pipeline) sit on top of this foundation.</p>
|
||||
<p>The harness — inference proxy, guardrails, dashboard, orchestrator API — is in place. The work now is feeding it real tasks and hardening the git loop.</p>
|
||||
<h2>The guardrail</h2>
|
||||
<p>The biggest fear with autonomous agents: hallucination. An agent claiming it read a file without calling <code>read</code>. Three consecutive turns with no tool calls. Running <code>aws ec2 terminate-instances</code> at 3am.</p>
|
||||
<p>The guardrail extension monitors every turn:</p>
|
||||
<ul>
|
||||
<li><strong>Hallucination detection</strong> — claims without tool calls get corrected</li>
|
||||
<li><strong>No-tool drift</strong> — three turns with zero tool calls triggers a warning</li>
|
||||
<li><strong>Command blocking</strong> — 29 patterns covering destructive git, AWS teardown, process killing, production API abuse</li>
|
||||
</ul>
|
||||
<p>Guardrails at the platform layer, not the prompt layer. Prompts can be ignored. Platform gates cannot.</p>
|
||||
<h2>What it cost to build</h2>
|
||||
<p>About 2,000 lines of Go, 900 lines of TypeScript extensions, 52 tests, plus merging the dashboard into the Pi monorepo. No new servers — Pi is a Node subprocess; the dashboard is another Node process on your machine. The orchestrator is a Go module inside our existing Gitea binary — zero additional infrastructure.</p>
|
||||
<hr>
|
||||
<p><em>Tinqs Studio is an open platform for game development — git hosting, AI inference, asset generation, and autonomous agents. We are building <a href="https://arikigame.com" style="color: var(–c-accent-l);">Ariki</a>, a survival colony sim, using the same tools we ship.</em></p>
|
||||
<p>The harness — inference proxy, guardrails, dashboard, orchestrator API — is in place. Agents code while you sleep for pocket change. And because everything runs on your own infrastructure, you control the models, the tools, and the safety rails.</p>
|
||||
<p><em>Tinqs Studio is an open platform for game development — git hosting, AI inference, asset generation, and autonomous agents. We're building <a href="https://arikigame.com" style="color: var(–c-accent-l);">Ariki</a> using the same tools.</em></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
Before
After
|
Reference in New Issue
Block a user