跪拜 Guibai
← All articles
Open Source

Carbon-Neon Orchestrator: A Plugin That Makes Antigravity Assign Grunt Work to the Fast Model

By Yeautumn ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

This plugin fills a gap in Antigravity's built-in orchestration: you can now run Carbon as the architect and delegate repetitive edits to fast Neon workers, cutting token spend without losing architectural control. Its two-strike circuit breaker and context-inheritance tricks are the kind of practical guardrails that make multi-model orchestration usable in daily development.

Summary

Google's Antigravity 2.0 ships orchestrator presets that lock a session to a single model family — Carbon, Neon, or Argon. That forces a tradeoff: run everything on Carbon for reliability but burn tokens on trivial edits, or run everything on Neon for speed but lose architectural judgment on tough bugs. A new open-source plugin, carbon-neon-orchestrator, fills the gap with a Carbon-to-Neon hybrid: the top-tier Gemini 4 Carbon model plays tech lead, decomposing architecture and reviewing code, while multiple Neon workers handle the grunt work in parallel.

The plugin hooks into Antigravity's PreInvocation lifecycle. Before each model call it reads the session's modelName from stdin. Only when the main session is Gemini 4 Carbon does it inject orchestration rules once (keyed by session ID to avoid re-injection and token waste). If the user switches to Flash, Claude, or Neon, the hook issues a pause and reverts to direct output. If the current context carries a `<swarm_worker>` tag, meaning it's already a spawned child, the hook lets it pass silently, preventing the recursive delegation loops that global rules cause.

Getting the delegation right required fixing four rough edges. First, a strict four-condition rule decides what Carbon can do instantly by itself: known file path, a single file with at most 20 lines changed, no build/test cycle, and change ends there. Anything else goes to Neon workers. Second, to stop information loss between coordinator and workers, the plugin passes original image paths into the briefs and uses `fork: "coordinator"` to inherit hot context. Third, a two-strike circuit breaker means if a Neon worker fails twice on a bug, Carbon takes over itself. Finally, edge fixes include strict `@file` detection, auto-reinjection after `/compact` context compression, and forced physical isolation with `workspace: "share"` when two or more Neon nodes write code, with cherry-pick merging and Carbon diff review before cleanup.

Takeaways
— Official Antigravity orchestrator presets are locked to a single model family (Carbon, Neon, or Argon) and lack a Carbon-to-Neon hybrid mode.
— The plugin uses a PreInvocation hook to read the session's modelName from stdin and inject orchestration rules only when the main model is Gemini 4 Carbon, deduplicating by session ID to avoid token waste.
— It detects the `<swarm_worker>` tag to let spawned child nodes pass through without re-injecting orchestration, preventing recursive delegation loops.
— `invoke_subagent` and `run_workflow` only accept coarse-grained enums like "pro" or "flash"; only the native swarm tool accepts exact model IDs such as `gemini-4-neon-high`, so the plugin reuses swarm.
— A strict four-condition rule lets Carbon handle trivial edits directly: known file path, single file with ≤20 lines total change, no build or test cycle, and the change ends there.
— To preserve context, the plugin passes absolute image paths into worker briefs and uses `fork: "coordinator"` for warm starts from the coordinator's memory.
— A two-strike circuit breaker stops Neon after two failed attempts on a bug and hands it to Carbon to fix directly.
— Edge cases covered: strict `<swarm_worker>` matching instead of `@` prefix, auto-reinjection after `/compact` context compression by comparing `initialNumSteps`, and forced `workspace: "share"` isolation when ≥2 Neon nodes write code, with cherry-pick and Carbon diff review before cleanup.
— Installation is a single git clone into `~/.gemini/config/plugins/carbon-neon-orchestrator`; it takes effect immediately, works with the built-in swarm, and can be toggled off in the Skills & Customizations panel.
Conclusions

Antigravity's built-in orchestrator presets are all-or-nothing per model family; this plugin exposes that as a design gap, suggesting the product team hasn't yet tuned for mixed workloads where cost and accuracy matter differently.

The two-strike rule is a pragmatic cost-control heuristic: it caps how many rounds a cheaper worker can burn on a hard bug before escalating to the more expensive architect. That same tradeoff applies to any setup that pays per token for different model tiers.

Reusing the native swarm tool instead of `invoke_subagent` reveals an API inconsistency in Antigravity: only swarm accepts exact model IDs, which pushes plugin builders toward a less documented path.

Concepts & terms
PreInvocation hook
A lifecycle hook in Antigravity plugins that runs before each model invocation, letting the plugin read the selected model and modify the prompt or inject instructions.
Swarm
Antigravity's native tool for spawning multiple subagent workers to run tasks in parallel, with a visual dashboard for monitoring.
Fork (coordinator)
A swarm option that starts a worker with the coordinator's existing conversation context instead of a cold start, letting the worker inherit prior discussion.
Two-strike circuit breaker
A rule in this plugin where a Neon worker gets two attempts to fix a bug; after two failures, Carbon takes over to avoid wasting more iterations and tokens.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗