Multi-Agent Orchestration: From Code Generation to Building an Operating System
Over the past two years, many teams have treated large language models as smarter Q&A interfaces: ask a question, get an answer; describe a requirement, get a code snippet. But when models take on planning, decomposition, scheduling, review, and merging, the way software engineering is organized fundamentally changes. This article examines multi-agent orchestration through a case study of building an OS prototype from an empty directory, presents a reference architecture covering acceptance criteria, orchestrator planning, agent pools, review gates, and sandboxed execution, and offers practical guidance on cost control, hardware design constraints, and governance for production adoption.
Over the past two years, many teams have still treated large language models as “a smarter Q&A interface”: ask a question, get an answer; describe a requirement, get a code snippet. This usage is not wrong, but it covers only a fraction of what models can do. When models begin to take on planning, decomposition, scheduling, review, and merging, the way software engineering is organized changes: developers no longer just ask a model to write scattered scripts. Instead, they can hand a larger objective to an “orchestrator model” that coordinates a set of specialized sub-agents to complete work that previously required a multi-role engineering team working for weeks.
From “Generating Code” to “Orchestrating Engineering”
The core metric of traditional code generation is local correctness: does the function run, do the unit tests pass, is the style consistent? The core metrics of multi-agent orchestration are closer to project delivery: is the goal correctly decomposed, are dependencies between tasks clear, can artifacts be merged, are quality gates reliable, are costs under control, and can failures be rolled back? The former treats the model as “advanced autocomplete”; the latter treats it as a “task orchestrator.”
In this mode, the orchestrator model must first convert a vague objective into verifiable engineering goals. For example, “build an operating system prototype” cannot simply become “generate a bunch of scripts.” The acceptance boundaries must be defined first: can it boot on physical hardware, does it have persistent file storage, does it include disk and network drivers, does it have a window system and login screen, does it support basic testing and regression? The clearer the acceptance criteria, the more stable the task decomposition for sub-agents, and the more shared context there is for later review and merging.
Deconstructing the “OS from an Empty Directory” Case
A public demonstration placed a frontier model in an empty directory and asked it to produce an operating system prototype. What is notable is not “how much code was generated” but the working method: the model did not pile up scattered scripts. Instead, it first acted as chief architect, planning milestones and task dependencies, then orchestrated sub-agents numbering in the thousands to write code in parallel, run tests, review each other’s commits, and merge validated branches into the core codebase. The final deliverable included a custom kernel, persistent storage, disk and network drivers, a window system and login screen, and it could boot on a physical device.
The engineering lessons from this case can be summarized in four points. First, the orchestrator must do architecture before writing code. Second, sub-agents need role separation and context isolation, otherwise they will contaminate each other. Third, review gates matter more than generation speed, because the bottleneck in large projects is usually merging and regression. Fourth, sandboxes and permission control are prerequisites—large numbers of agents must not be given unrestricted write access and network access.
It is important to stress that such demonstrations prove “prototype feasibility and orchestration potential,” not that production-grade operating systems can already be delivered independently by models. Production systems still require security audits, hardware compatibility matrices, long-term maintenance, supply chain governance, and human sign-off. Misreading demo capability as production-ready capability is the most common risk in adoption.
A Reference Architecture for Multi-Agent Orchestration
A deployable orchestration system typically includes the following layers:
Goal and acceptance layer. Convert business objectives into executable acceptance items, and distinguish “must-have” from “nice-to-have.” For example, kernel boot, persistent storage, working drivers, and a loggable UI are hard gates; performance optimization and visual polish are soft goals. Hard gates should enter automated checks; soft goals can be evaluated manually.
Orchestrator planning layer. The orchestrator model generates a milestone DAG, identifies the critical path, estimates budget and risk, and decides which tasks run in parallel and which run sequentially. It should not write all the code itself; it should reserve its compute for the hardest logical judgments and conflict arbitration.
Sub-agent pool. Divide agents by role: kernel, memory management, storage, drivers, networking, UI, testing, security review, and so on. Each agent receives only the necessary context and tool permissions, and writes its artifacts to isolated directories to avoid cross-task contamination.
Review and merge layer. Every commit must pass at least automated unit tests, integration tests, static checks, peer-agent review, and human sign-off for critical modules. The merge strategy must handle conflicts, rollbacks, and artifact lineage, ensuring every merge can be traced back to its task, prompts, code diff, and test results.
Execution isolation and observability layer. Use general isolation mechanisms such as containers, sandboxes, or virtual machines to restrict file, network, and process permissions. Use logs, traces, metrics, and audit records to capture agent decisions and tool calls. A multi-agent system without observability makes it very hard to determine “who introduced a regression, and when.”
An illustrative configuration:
goal: build_os_prototypeacceptance:boot: physical_devicestorage: persistentdrivers: disk_and_networkui: window_system_and_loginorchestrator:role: strong_reasoning_modelplan: milestone_dagmax_parallel: Nbudget: {tokens: B, wall_time: T}agents:- kernel- memory- storage- drivers- network- ui- test- security_reviewgates:- unit_test- integration_test- static_check- peer_review- human_signoff_for_release
Cost Tiering and Controlling “Agent Storms”
The easiest thing to lose control of in a multi-agent system is not capability but cost and concurrency. A sound approach is tiered model routing: assign relatively simple tasks to faster, cheaper lightweight models, and reserve complex reasoning and conflict arbitration for stronger models. The orchestrator should maintain budgets, concurrency caps, and checkpoints, and proactively slow down when regression rates rise or merge conflicts spike. “Agent storms” must also be constrained: set maximum parallelism, maximum retries per task, artifact size limits, and network access allowlists. Otherwise, large numbers of agents can produce duplicated work, overwrite each other, and generate unauditable intermediate artifacts.
From Software to Hardware: The Real World Is Less Forgiving
Software errors can usually be fixed by rolling back a commit; hardware errors are far costlier. A single wrong trace on a printed circuit board can render an entire device unusable. Therefore, when models enter hardware design, their role should focus more on design exploration, schematic and layout suggestions, test case generation, fault tree analysis, and design rule check assistance—rather than replacing final sign-off. Engineering practice needs to incorporate simulation, design-for-manufacturing constraints, electrical rule checks, thermal and power evaluation, hardware-in-the-loop testing, and small-batch validation. Models can accelerate exploration of the design space, but they must be constrained within verifiable, rollbackable, human-reviewable processes.
Adoption Roadmap and Governance Recommendations
It is recommended to proceed gradually from low-risk scenarios: first let multi-agent systems handle read-only analysis, test generation, documentation syncing, and defect localization; then open up controlled modification and automated fixes; next, cross-module collaboration; and only finally, large-scale system prototypes. Metrics should include first-pass rate, regression failure rate, merge conflict rate, human takeover rate, cost per task, and mean time to repair. Security governance should include least privilege, credential isolation, dependency and license review, supply chain auditing, and human sign-off before release. On the cloud infrastructure side, Baidu AI Cloud offers general-purpose capabilities such as containers, object storage, logging, and monitoring/alerting that can support execution isolation, artifact versioning, and auditing—but the core remains orchestration governance, not any single tool.
In conclusion, the value of frontier models is shifting from “generating content” to “organizing engineering.” The OS prototype case shows that multi-agent orchestration can already complete complex tasks that once required long-term collaboration by senior teams. But production adoption still depends on clear acceptance criteria, cost tiering, isolated sandboxes, review gates, and human sign-off. Treating the model as a task orchestrator rather than a search engine is the key shift for the next phase of engineering practice.
