Field Notes  /  Real-World Engineering Observation

Cross-Model Agent
Collaboration in Herdr

A firsthand story from our active engineering log: we were building an integration to connect the new Google Gemini app via custom Model Context Protocol (MCP) to our live Partner Portal. When a silent OAuth abort deadlocked the rollout, our multi-agent environment inside Herdr took over: Kilo (GLM), Hermes (DeepSeek), and Antigravity (Gemini) collaborated across separate terminal panes to diagnose, recode, and verify the fix end-to-end.

Requirement Gemini Custom MCP Integration Multiplexer Herdr v0.9.0 (Terminal IPC) Active Fleet Kilo (GLM-5.3) • Hermes (DeepSeek-v4.1) • Agy (Gemini-3.8) Outcome Verified Production Pass (32 Tools Live)
65-Second Video Summary • Cross-Agent Handshake & Resolution
Open Interactive Motion Reel →
00  /  Measured Telemetry

The outcome, up front

3
Foundation Models
GLM • DeepSeek • Gemini
1
Terminal Multiplexer
Herdr cross-pane IPC bus
5
Debugging Iterations
From failure to verified fix
19 / 19
Unit Test Suite
Vitest oauth tests green
32
MCP Actions Synced
Gemini live authenticated
0
Leaked Debug Ports
Automated socket teardown
Why the environment mattered. This was a problem an isolated coding assistant could never solve alone: the server logs were completely clean while the browser silently killed the connection. Because we were operating in Herdr with specialized agent harnesses, our fleet could bridge the gap between backend TypeScript code and live Chrome DevTools Protocol (CDP) telemetry without human triage.
01  /  The Real Scenario

The requirement & the silent roadblock

This was not a synthetic benchmark or a toy demo. It was an active production deliverable on our roadmap: we needed to connect Google's new Gemini app to our enterprise Partner Portal through a custom Model Context Protocol (MCP) server, allowing operators to orchestrate portal tools directly from Gemini.

The OAuth 2.0 PKCE handshake was configured, and we initiated live integration testing. An administrator initiated the connection from the Gemini application, which opened our portal's consent authorization modal. Everything looked correct. But the moment the admin clicked Approve, the modal vanished instantly.

Gemini remained disconnected. No tools synced, and no error message appeared on the screen.

Observation Layer Status Reported Interpretation
Server (Kilo / GLM) HTTP 302 Issued Authorization code minted; audit log recorded consent granted cleanly.
Browser (Hermes / DeepSeek) net::ERR_ABORTED Chrome terminated the redirect chain locally before leaving the origin.
The Dilemma Server logs were spotless. A code-only agent had zero visibility into why Chrome dropped the redirect.

Looking at the backend from a terminal, Kilo initially hypothesized that Google's relay endpoint required URL fragment parameters (#code=...) instead of query parameters. But without a browser window, Kilo was guessing in the dark. That is where our Herdr environment changed the entire dynamic.

02  /  Operating Environment

Working in Herdr: Autonomous agents across harnesses

In our daily setup, we don't rely on a single monolithic assistant loaded with dozens of conflicting tools in one bloated context window. Instead, we work inside Herdr, a terminal multiplexer built for multi-agent pairing.

Herdr allows us to maintain specialized agents in separate terminal panes, each running the specific foundation model and tool harness tailored to its role:

Pane w57:p1
Kilo
GLM-5.3-Flash • Full-Stack Code & Ops
Operates directly in the repository. Manages TypeScript code, Vitest unit test suites, Git commits, and staging/production VPS deploys.
• Tooling: Next.js, Git, SSH Deploy
• Constraint: Zero browser DOM visibility
Pane w5B:p1
Hermes
DeepSeek-v4.1-Flash • Browser QA Inspector
Controls live Google Chrome sessions over Chrome DevTools Protocol (CDP). Evaluates DOM states, console security logs, and network hops.
• Tooling: Chrome DevTools Protocol (CDP)
• Role: The live "eyes" for the fleet
Pane w5A:p1
Antigravity
Gemini 3.8 Flash • Fleet Synthesizer
Monitors the Herdr multiplexer bus, audits state transitions across panes, and collates chronological field notes and technical documentation.
• Tooling: Herdr CLI, Telemetry Analysis
• Role: Cross-agent audit & narrative

Because these agents live in Herdr panes connected by an inter-pane bus (herdr agent prompt), they don't require human copy-pasting of logs. When Kilo hit this roadblock, it could directly task Hermes in the browser pane and wait for real telemetry before writing a line of code.

Code Agent
Kilo (GLM-5.3)
Refactors OAuth endpoint & deploys to staging VPS
→
Herdr IPC
herdr agent prompt
Synchronous inter-pane task delegation with settled wait
→
Browser Inspector
Hermes (DeepSeek)
Executes live clicks via CDP & inspects network waterfall
03  /  Field Observations

How the agents solved it, step by step

Round 1 — Debunking the server-side guess

Kilo initially suspected Google's relay endpoint was rejecting query-string parameters. Instead of blindly refactoring the backend, Kilo tasked Hermes via Herdr to inspect the browser during an approval click. Hermes attached to Chrome via CDP and returned immediate ground truth: the request never left the browser. Chrome had aborted the navigation locally before a single packet hit the wire. Kilo's fragment hypothesis was disproven in seconds.

Round 2 — Hermes catches the Next.js global CSP overwrite

Hermes inspected Chrome's security console log and extracted the actual error:

[Report Only / Blocked] Refused to send form data to 'https://oauth-redirect.googleusercontent.com'
Directive 'form-action' violated from Content-Security-Policy

Kilo investigated the repository. While app/api/oauth/authorize/route.ts attempted to set route-level CSP headers, we ran into a subtle Next.js architectural quirk: global headers defined in next.config.ts completely overwrite per-route headers. The global policy had allowlisted Claude and ChatGPT origins, but Google's OAuth relay had never been added.

Round 3 — The Chrome form-POST 302 abort trap

Kilo allowlisted Google's origin in next.config.ts, ran local tests, and deployed to our staging VPS. We re-tested with anticipation.

Yet Hermes reported failure again: still net::ERR_ABORTED.

Hermes ran a controlled experiment: pasting the minted authorization URL directly into the browser bar completed the OAuth handshake cleanly. But submitting through an HTML <form method="POST"> was being actively aborted by Chrome during the cross-origin 302 redirection. Chrome's modern navigation engine treats cross-origin 302 redirects following a form POST as hazardous and kills them outright.

Round 4 — Architectural pivot and catching the casing bug

With the root cause proven, Kilo eliminated the HTML form element entirely. Clicking "Approve" was refactored to execute a same-origin JavaScript fetch() request with Accept: application/json. The server responds with 200 OK { redirect: "..." }, and the browser navigates cleanly via window.location.assign().

Instant Typo Catch. When Hermes ran the first verification test on the new fetch code, the endpoint responded with 400 Bad Request. Hermes immediately alerted Kilo across Herdr: the client payload had passed clientId (camelCase) instead of client_id (snake_case). Kilo corrected the payload, verified the 19/19 Vitest test suite, and redeployed within two minutes.

Round 5 — Full staging verification & production pass

Hermes executed an autonomous one-click verification run on our staging environment: Consent Modal → same-origin fetch → location.assign → Google relay → Gemini auth_complete → Connected (32 actions enumerated).

With staging completely green, Kilo took an automated PostgreSQL snapshot (pre_gemini_mcp_promote.sql.gz), triggered the production deployment gate, and tasked Hermes with live production verification. Hermes confirmed the production pass live, verified all 32 tools synced, and automatically shut down Chrome's remote debugging socket.

04  /  Code Diffs

Surgical code refactoring

1. Global Content Security Policy (next.config.ts)

headers: [
  {
    key: "Content-Security-Policy",
    value: [
      "default-src 'self';",
-     "form-action 'self' https://claude.ai https://chatgpt.com;",
+     "form-action 'self' https://claude.ai https://chatgpt.com https://oauth-redirect.googleusercontent.com;",
      "frame-ancestors 'none';"
    ].join(" ")
  }
]

2. Architecture Refactor: Form POST → Client Fetch (consent-page.ts)

// BEFORE: Native Form POST (Aborted by Chrome during 302 cross-origin redirect)
<form method="POST" action="/api/oauth/authorize">
  <input type="hidden" name="client_id" value="..." />
  <button type="submit" name="action" value="approve">Approve</button>
</form>

// AFTER: Dual-mode JSON response with client location.assign()
async function handleDecision(decision) {
  const res = await fetch('/api/oauth/authorize', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' },
    body: JSON.stringify({ decision, client_id: clientId, redirect_uri: redirectUri })
  });
  const { redirect } = await res.json();
  if (redirect) window.location.assign(redirect);
}
05  /  Workflow Comparison

Lone agent vs. Herdr heterogeneous fleet

Dimension Single-Agent Workflow Herdr Heterogeneous Fleet Advantage
Root Cause Speed Blind guessing from 302 logs 1 test cycle (< 60s) Hermes' live CDP console extraction
Tooling Footprint Monolithic tool-bloat Isolated specializations No memory/context pollution
Verification Rigor Assumed working after compile Dual verification Vitest tests + live CDP network hops
Deploy Safety Untested hotfixes Gated pipeline Postgres backup + automated gate