Mastodon Politics, Power, and Science: Merge Agent Configs in Minutes, Not Hours: Introducing config_diff.py

Saturday, August 9, 2025

Merge Agent Configs in Minutes, Not Hours: Introducing config_diff.py

The tool can be found here

If you're like me, you live inside the Agent Workflow framework. You have a main config.json on your development machine, another on your server, and maybe a third in a feature branch you've been working on. They're all mostly the same, but you know there are subtle, critical differences between them.

The fear of manually merging these files is real. A single misplaced comma can break everything. A forgotten agent from one file can lead to a production failure. It's a slow, tedious, and error-prone process.

I was facing this exact problem today, staring at three different config.json files that needed to be unified. But instead of taking hours, it took minutes. Why? Because I built a tool for the job. As a user of the framework told me after using it:

"I just unified 3 config files into one config file in minutes not hours."

Today, I'm sharing that tool with you: config_diff.py, a smart command-line utility designed specifically to manage our agent configurations.

It's Not a Text Diff, It's an Agent Diff

A standard diff tool just shows you which lines of text have changed. That's not good enough. Our config.json isn't just text; it's a structured database of capabilities. Our tool needed to understand that structure.

The config_diff.py utility gives you a clean, three-part report that tells you exactly what you need to know.

1. Agents Only in the First File

This section lists any agents that exist in your first config.json but are completely missing from the second.

2. Agents Only in the Second File

Conversely, this section shows you which agents are in the second file but not the first. This is perfect for finding new agents in a release branch that you need to merge back into your development config.

3. Agents with Different Content

This is the most powerful part. The tool identifies agents that exist in both files but whose definitions have changed. It doesn't just tell you they're different; it shows you why they're different, breaking down the changes by the specific keys.

A Real-World Example

Here’s the actual output I got when comparing my local config with a release candidate:

--- Agents with different content (found in both files) ---

--- Agent 'append_text' differs ---

First config file has this value for 'web_services':
"web_services": [
  "public_api",
  "test_add"
],

Second config file has this value for 'web_services':
"web_services": [
  "public_api",
  "internal_tools"
],

Instantly, I can see the problem. My local append_text agent has a test_add tag that shouldn't be in the release, while the release version has the correct internal_tools tag. The tool has pinpointed the exact configuration drift.

The Magic: Copy-Paste Ready Output

The best part? The output for new and unique agents is formatted as perfect, copy-paste-ready JSON.

--- Agents found only in second config file ---

"sftp_get": {
  "type": "proc",
  "help": "The correct way to download a file...",
  "inputs": [ ... ],
  ...
},

No more manually fixing trailing commas or worrying about mismatched brackets. You can literally highlight the entire block, copy it, and paste it directly into the "agents": { ... } section of your master config file. It just works.

How To Use It

It's a simple command-line tool. Just point it at the two files you want to compare.

Bash
python config_diff.py path/to/your/config.json path/to/other/config.json

From Chaos to Control

This tool embodies the philosophy of our Agent Workflow framework: if you face a tedious problem, build a focused, reusable agent (or in this case, a tool) to solve it. It turns a chaotic, error-prone task into a simple, deterministic process.

Stop dreading the merge. Grab the config_diff.py script and take control of your scattered configs.



No comments:

Post a Comment

Progress on the campaign manager

You can see that you can build tactical maps automatically from the world map data.  You can place roads, streams, buildings. The framework ...