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:
2026-06-03 03:06:41 +01:00
parent bf42a76cf9
commit f01036c646
23 changed files with 933 additions and 2546 deletions
+44 -85
View File
@@ -1,67 +1,54 @@
---
title: "Building a Cloud Agent Harness with DeepSeek V4 and Pi"
title: "Agents That Code Overnight: Our $0.80 Cloud Harness with DeepSeek V4 and Pi"
slug: cloud-harness
date: "2026-05-26"
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."
og_description: "Pi fork, merged agent dashboard, and a Go orchestrator inside Tinqs Studio."
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."
og_description: "Pi fork + Go orchestrator + browser dashboard. Agents code overnight for $0.80."
og_image: "https://www.tinqs.com/blog/img/cloud-harness-architecture.png"
excerpt: "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 the browser."
excerpt: "Every coding agent today runs in your terminal. Close the laptop, it stops. We built a cloud harness where agents code overnight for about $0.80 — and you can watch from a browser dashboard."
author: "Ozan Bozkurt"
author_initials: "OB"
author_role: "CTO & Developer, Tinqs"
---
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 [Pi fork](https://tinqs.com/tinqs/pi) for the brain, a Go orchestrator inside our [Gitea fork](https://tinqs.com/tinqs/studio) for overnight work, and a browser dashboard merged into Pi for the daytime. Here is how it fits together.
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.
## The Problem
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.
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.
## The problem with terminal-only agents
We wanted exactly that. Not a coding assistant. An autonomous workforce — with a UI when a human needs to be in the loop.
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.
## Why Not Just Use Claude Code or Codex?
DeepSeek V4 Flash costs $0.28/MTok output. Eight overnight tasks: **about $0.80**. The cost differential changes what's possible — from "I'll use this sparingly" to "run it on everything."
**Cost.** Claude Code runs on Opus at $15/MTok output. Codex uses GPT 5.5. Running eight agents overnight on either would cost $50200. DeepSeek V4 Flash costs $0.28/MTok output. Eight overnight tasks: **about $0.80**.
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.
**Control.** Cloud tools are black boxes. We cannot add a Gitea API tool, a fal.ai image generator, or a guardrail that blocks `aws ec2 terminate-instances`. With our own harness, we add an extension and it is live.
## Pi — the agent brain
**Platform.** We are building [Tinqs Studio](https://tinqs.com) — a Gitea-based game development platform. Agents are not a feature we want to outsource. They are the product.
[Pi](https://pi.dev) 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:
## Pi — The Agent Brain
- **tinqs-provider** — routes DeepSeek V4 Flash/Pro through our inference proxy
- **tinqs-tools** — Gitea REST API, fal.ai image generation, vision model access
- **tinqs-ci** — reads CI pipeline status, logs, polls for completion
- **tinqs-guardrail** — 29 safety patterns blocking dangerous commands
[Pi](https://pi.dev) 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.
Each extension is a single TypeScript file. No npm dependencies. The core Pi code is untouched — we only add files.
We [forked it](https://tinqs.com/tinqs/pi). Not to rewrite the core — to add first-party extensions:
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.
- **tinqs-provider** — routes DeepSeek V4 Flash and Pro through our inference proxy
- **tinqs-tools** — Gitea REST API, fal.ai image generation, Amazon Nova Lite vision
- **tinqs-ci** — reads CI pipeline status, logs, and polls for completion
- **tinqs-guardrail** — 29 safety patterns that block dangerous operations
Each extension is a single TypeScript file. No extra npm dependencies on the extension side.
Pi has four output modes. The one that matters for automation is **RPC** — a headless process that accepts JSON on stdin/stdout. That is how the orchestrator drives it.
## DeepSeek V4 — The LLM
## DeepSeek V4 — the LLM
DeepSeek V4 Flash through our own inference proxy. OpenAI-compatible API, so Pi treats it like any other provider. The proxy adds:
- Redis job queue (10 concurrent workers)
- Per-user usage tracking
- System prompt injection for cache hit optimization
- Gitea PAT authentication (same token as git push)
- System prompt injection for cache-hit optimization
- Gitea PAT authentication same token as git push
Cost per task: **$0.020.10** depending on complexity.
Cost per task: $0.02-0.10 depending on complexity.
## Go Orchestrator — Overnight Batch Work
## Go orchestrator — overnight batch work
Inside `tinqs/studio` we added `modules/agents/` — a Go worker pool that:
- Spawns Pi with `--mode rpc --no-session`
- Tracks task lifecycle (pending → running → done)
- Streams events over **SSE** to any connected UI
- Enforces guardrails at the platform layer (worker limits, timeouts)
Six HTTP endpoints, same auth as git push:
Inside our Gitea fork we added `modules/agents/` — 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:
```
POST /api/v1/agents/tasks — submit a task
@@ -72,9 +59,7 @@ GET /api/v1/agents/stream — SSE live events
GET /api/v1/agents/health — orchestrator status
```
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.
The intended loop:
The orchestrator lives in the same binary as git — same auth, no extra service to deploy. The intended loop:
```
Orchestrator reads task brief
@@ -82,75 +67,49 @@ Orchestrator reads task brief
→ 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
```
Git worktree integration and full push/PR automation are still being wired; the API and worker pool already run locally.
## Browser dashboard — daytime UI
## Pi Dashboard — Browser UI (Shipped)
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.
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.
We merged [pi-agent-dashboard](https://github.com/BlackBeltTechnology/pi-agent-dashboard) into the Pi monorepo — not as a second repo to install. One checkout, one command:
We merged [pi-agent-dashboard](https://github.com/BlackBeltTechnology/pi-agent-dashboard) into the Pi monorepo. One command:
```bash
npm run dashboard:dev
```
Open **http://localhost:33634**. You get:
- **Live session streaming** — watch tool calls and model output in real time
- **Interactive chat** — send prompts, answer `ask_user` dialogs from the browser
- **Session spawning** — start Pi in any pinned project folder
- **Cost tracking** — per-session token usage when using Tinqs inference
- **Plugins** — flows, subagents, workspace helpers
The dashboard talks to Pi sessions over a WebSocket bridge on port **9999**. Inference uses the same Tinqs proxy as the CLI — register a custom provider in `~/.pi/agent/providers.json` and authenticate with your existing `tstudio` token. No separate LLM API keys.
Open `localhost:33634` 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.
```
Dashboard (localhost:33634)
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
```
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.
## The guardrail
One browser tab for daytime work; the orchestrator queue for overnight runs.
The biggest fear with autonomous agents: hallucination. An agent claiming it read a file without calling `read`. Three consecutive turns with no tool calls. Running `aws ec2 terminate-instances` at 3am.
## The Guardrail
The guardrail extension monitors every turn:
Our biggest fear: an agent hallucinating instead of using tools, or running `aws ec2 terminate-instances` at 3 AM.
- **Hallucination detection** — claims without tool calls get corrected
- **No-tool drift** — three turns with zero tool calls triggers a warning
- **Command blocking** — 29 patterns covering destructive git, AWS teardown, process killing, production API abuse
The guardrail extension monitors every agent turn:
Guardrails at the platform layer, not the prompt layer. Prompts can be ignored. Platform gates cannot.
**Hallucination detection** — if the agent claims file contents without calling `read`, it gets corrected.
## What it cost to build
**No-tool drift** — three consecutive turns without a tool call triggers a warning.
**Command blocking** — 29 patterns covering destructive git, AWS teardown, process killing, and production API abuse.
## What It Cost to Build
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.
## What Is Next
| Piece | Status |
|-------|--------|
| Pi fork + tinqs extensions | Shipped |
| Dashboard merged into Pi monorepo | Shipped |
| Go orchestrator + REST/SSE API | MVP, running locally |
| Git worktree + push + PR loop | In progress |
| Domain routing (game / sim / platform tasks) | Designed |
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.
The harness — inference proxy, guardrails, dashboard, orchestrator API — is in place. The work now is feeding it real tasks and hardening the git loop.
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.
---
*Tinqs Studio is an open platform for game development — git hosting, AI inference, asset generation, and autonomous agents. We are building [Ariki](https://arikigame.com), a survival colony sim, using the same tools we ship.*
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.
*Tinqs Studio is an open platform for game development — git hosting, AI inference, asset generation, and autonomous agents. We're building [Ariki](https://arikigame.com) using the same tools.*