Skip to main content

Command Palette

Search for a command to run...

Orion - Ideation and Design

Updated
4 min read

Day #1 of Building My Cloud Coding Agent

Context

A few weeks ago, I was working on a personal project and had an idea for a new feature — on my commute home. I was on the metro, no laptop in hand, and completely unable to act on it.

That got me thinking: it would be useful to have a coding agent running in the cloud, accessible through a chat app I already use.

Fast forward a few days, Cursor launched their Cloud Agents — essentially remote access to your Cursor agent. I tried it out and it works well, though you need at least their $20/month Pro plan. The bigger limitation, though, was a narrow selection of supported LLMs, mostly paid ones.

That's when I figured — why not build my own? A custom cloud agent, tailored to how I work. At its core, the idea is simple: a VM running a coding agent with access to my repos and a communication channel. I went with Discord because the bot integration is straightforward, and honestly, I have a soft spot for it from my college days.

One thought led to another, and I realized this agent could be my 24/7 async collaborator — not a "vibe coding" experiment, but actual spec-driven development, with an agent handling the boilerplate while I focus on the decisions that matter.

Defining the Scope

For v1, I'm keeping it minimal. The agent needs to:

  1. Work on GitHub repositories — create feature branches, open PRs, and so on.

  2. Communicate with me on project-specific Discord channels — ask clarifying questions, share status updates, request approvals.

Design

I'm comfortable with AWS, so that's where the infra lives.

Compute: The agent needs a VM with a persistent file system. EC2 is the natural starting point, though it's not the cheapest option in the long run (especially once forex charges show up on your credit card). Cost optimisations — like an on-demand start/stop mechanism — can come later.

Coding Agent: Both Cursor and Claude Code are solid, but I want something I can customise over time. That points to open-source. I'm going with OpenCode — it's configurable, supports project-level context similar to Claude Code, and it's free. Big fan of OSS, always have been.

Human-in-the-Loop (HITL): This is the most important piece. I thought about it from first principles: if I had an intern reporting to me, what would I expect from them?

  1. I'd want to brief them upfront — the project context, the goals, and their role. With a human, that's a one-on-one meeting where they take notes.

  2. I'd assign tasks asynchronously. Ideally via a ticket system, but I don't want to over-engineer this early on. Task assignment via Discord will do for now.

  3. Once they're working, I'd expect them to surface blockers or questions in the chat. I'd respond, and we'd iterate until things are clear.

  4. Once the work is done and the code is committed, they'd raise a PR for my review. I'd leave feedback, they'd address it — rinse and repeat until it's ready to merge.

For the agent to behave this way, I'm building a Discord bot that acts as its interface for all communication.

Bot Backend: There's a communication bridge needed between the Discord bot and the OpenCode instance on EC2. It's two-way — I'll call bot-to-agent upstream and agent-to-bot downstream.

  • Upstream: I send a message to the bot, which listens and forwards it as a prompt to the agent. A lightweight, continuously running service on ECS handles this. Since there's no inbound HTTP traffic — just a WebSocket connection to Discord — no load balancer needed. That's one less thing to pay for.

  • Downstream: The agent doesn't need a persistent connection to send me updates. Serverless works here. The agent invokes a Lambda function, which calls the Discord API using the bot token, and the message lands in my channel.

LLM: I want to default to open-source models and only fall back to paid ones if needed. Starting with MiniMax-M2.5. I'm using OpenCode Zen so I can swap models out easily without changing anything else.

"So, to sum up ..."

Here's the final architecture diagram after pulling all of this together.

Up Next

I will be starting with setting up the EC2 instance, and launching an OpenCode terminal instance on VM startup.

Building Orion - My Personal Coding Collaborator

Part 1 of 1

In this series, I will be building my own cloud coding agent, with which I can interact via standard chat applications (starting with Discord). I will document my journey in building Orion from scratch, along with the challenges that I will face and their resolutions. The goal is to understand the system design aspects of a cloud agent, and use it as my personal collaborator for future projects. This isn't a vibe coding tool that I will be building. Instead, it is going to be a 24/7 available engine for spec-driven development. The readers might have some things to learn from my journey, and would be able to build their own cloud agents at minimal cost.