Dispatch 101
Week ↗

Centralizing the brain

Wednesday started with a structural shift in how the application talks to intelligence. For a while, every agent in the Unicorn-Brigade repo was reaching out to OpenAI directly. It was a simple setup, sure,…

Commits
1
Systems
1
Read
3min
Product capture

Unicorn Commander — settings.

Wednesday started with a structural shift in how the application talks to intelligence. For a while, every agent in the Unicorn-Brigade repo was reaching out to OpenAI directly. It was a simple setup, sure, but it meant every single module had its own connection logic, its own error handling, and its own secret keys floating around in the codebase. It worked, but it was messy. Today, I decided it was time to fix that.

The goal was straightforward: route all LLM inference through the Ops-Center. This creates a single, controlled entry point for all language model calls. It makes tracking, rate limiting, and swapping models much easier down the road. The immediate cost was rewriting a lot of code. I spent the day refactoring the entire application to use the new Ops-Center client instead of direct OpenAI calls.

The commit log shows a massive churn. I touched 137 files. The diff is huge: 35,648 lines added and 363 removed. That number looks scary, but it is mostly boilerplate and structural changes rather than new business logic. The core agents, analysis, code, and research, still do the same work. They just ask for it differently now. I updated the base agent class to handle the new interface, then went through each specific agent to swap out the client calls.

I spent the day refactoring the entire application to use the new Ops-Center client instead of direct OpenAI calls.

It wasn't just the Python files. The infrastructure had to change too. I updated the Dockerfile to ensure the Ops-Center dependencies were installed. The Makefile got tweaks to support the new build steps. Even the .env.example and .gitignore files needed updates to reflect the new configuration variables required for the Ops-Center connection. The README.md was rewritten to explain how to configure the new system. It is one of those days where you realize that "just changing a library" actually means touching almost every part of the project.

The hardest part was ensuring backward compatibility during the transition. Since this was a refactor inside a single repo, I didn't have to worry about external consumers, but I did have to make sure the agent interfaces remained consistent. The analysis agent needs to output specific JSON structures, and the code agent needs to handle streaming responses correctly. I spent a good chunk of time verifying that the new Ops-Center client handled these nuances without breaking the existing contracts.

There were a few moments of confusion with the environment variables. The Ops-Center expects a different set of keys than the direct OpenAI client. I had to update the .env.example to show the new required fields and make sure the application failed gracefully if they were missing. It is easy to miss a variable in a refactor this large, so I ran through the startup sequence multiple times to catch any missing configuration errors.

The result is a cleaner architecture. The application is no longer tightly coupled to a specific vendor's client library. If we need to switch models or add a new provider later, it will be much easier. The code is more uniform, and the dependency management is centralized. It feels less like a collection of scripts and more like a proper application.

Also today: I cleaned up the unused imports and consolidated some of the repetitive error handling logic that was scattered across the agent files.

The day added up to a stronger foundation. We traded a day of heavy typing for a codebase that is easier to maintain and more flexible. That is a trade I am happy to make.

Also in the frame

Real product captures — click any to enlarge.

uc cloud
uc cloud
uc cloud