Multi-Agent Long-Horizon Engineering: What Building an OS Reveals About the Evolution of AI Coding

    This article examines how a new generation of flagship reasoning models shifts AI-assisted programming from single-file completion toward long-horizon, multi-agent software engineering. It reviews benchmark results, reasoning-cost tiers, and two long-task case studies: 1,000+ sub-agents building a bootable operating system over eight days, and a production Python-to-Rust migration that cut cold-start time to roughly 1/26. It also covers multimodal work in mathematical proof and hardware design, the two-model safety strategy built on one shared base, and practical guidance on task decomposition, orchestration boundaries, cloud-native infrastructure, and cost routing.

    Multi-Agent Long-Horizon Engineering: What Building an OS Reveals About the Evolution of AI Coding

    1. Introduction: The Iteration Logic of Flagship Models Has Changed

    In late 2025, a leading international AI research organization released two flagship reasoning models aimed at complex technical work. They share the same underlying architecture and training foundation; the only difference is how tightly safety alignment is applied. One targets general development and enterprise use, emphasizing controllability and compliance. The other targets internal frontier research, relaxing some restrictions under a risk-assessment mechanism.

    Unlike earlier releases where topping a leaderboard was the finish line, what genuinely shook the engineering community about this generation was not a ranking on any single benchmark, but a qualitative leap on long-horizon, multi-agent, highly self-consistent software engineering tasks. Rather than repeating the launch-day talking points, this article breaks the changes down along four dimensions: benchmark placement, long-task orchestration, research and hardware adaptation, and safety trade-offs versus cost.


    2. Benchmarks: Leading on Both Coding and General Intelligence

    2.1 Key Metrics at a Glance

    Across several widely recognized hard benchmarks, this generation performs as follows:

    Benchmark This Generation Previous Generation (Same Line) Leading Competitor A Leading Competitor B
    Agentic coding (code generation + multi-step execution) 49.1% 45.5% 42.8% 41.1%
    Comprehensive software engineering benchmark v2 69.9% 56.3% — —
    General intelligence index v5 65 59 60 58

    Of the nine sub-tests in the general intelligence index v5, this generation took first place in five: scientific reasoning, knowledge understanding, code generation, multilingual translation, and visual question answering. The gap on the remaining four is within 1.2 points. Most notable is the jump in the comprehensive software engineering benchmark from 56.3% to 69.9% — more than 13 percentage points, which is rare in mature model iterations.

    2.2 Balancing Cost and Reasoning Tiers

    Beyond scores, engineering teams care more about the “effect curve per unit of cost.”

    • Highest reasoning tier: average cost per task is roughly 2.6x the previous flagship, suited to research and complex refactoring that needs deep deliberation;
    • Medium reasoning tier: at about half the cost, it approaches the previous flagship’s top-tier results, fitting high-frequency work such as everyday business code generation and unit test writing;
    • Low reasoning tier: significantly lower response latency, suited to real-time interaction such as code completion and documentation generation.

    This tiered design means capability is no longer a single “stronger costs more” axis but an adjustable cost-performance spectrum. Enterprises can schedule dynamically by task type instead of applying the highest configuration across the board.


    3. Long-Horizon Orchestration: From “Fix One Bug” to “Build an OS Over Eight Straight Days”

    3.1 Case One: 1,000+ Sub-Agents Autonomously Build a Bootable OS

    The most visually striking demo at launch: an engineer asked the flagship model to design and implement a complete operating system from scratch in an empty folder.

    The execution proceeded as follows:

    1. Task decomposition: the model split “build an OS” into 12 top-level subtasks — kernel architecture design, process scheduling, memory management, file system, driver layer (disk/keyboard/network), graphical window system, login authentication, installer, and others;
    2. Sub-agent dispatch: each subtask got a dedicated sub-agent instance, while roughly 1,000 finer-grained micro-task nodes were generated dynamically, covering interface definitions, stub code generation, and unit test authoring;
    3. Continuous integration and review: at fixed intervals, the main control agent aggregated all sub-agent output and ran a global build, static analysis, and integration tests; for failing modules, it automatically located the error and routed it back to the responsible sub-agent for repair;
    4. Final delivery: eight days later, the result was an OS prototype that genuinely boots on an ordinary laptop. It has a standalone kernel, basic hardware drivers, a layered file system, window rendering, a user login interface, a CD/USB installer, and even a built-in stripped-down AI chat assistant.

    Key insight: the prototype still falls short in engineering maturity (no complete security audit, no multi-architecture support), but its real significance is proving that a model can autonomously orchestrate a thousand concurrent sub-agents while preserving global consistency. This marks the point where long-horizon software engineering moves from “AI-assisted coding” to “AI-led development.”

    3.2 Case Two: Production Python-to-Rust Migration, 26x Faster Startup

    Unlike the OS prototype, this case happened in production:

    Anthropic used an early version of the model internally to migrate a critical backend service’s implementation language from Python to Rust in its entirety. After migration, cold-start time dropped to about 1/26 of the original, memory usage fell by roughly 60%, and tail latency (P99) converged significantly.

    During the migration, the model:

    • analyzed call relationships and the dependency graph of the Python source file by file;
    • automatically mapped Python’s GIL concurrency model onto Rust’s tokio async runtime;
    • generated corresponding unsafe FFI bindings and safety checks for C extension interfaces;
    • wrote before/after behavioral comparison tests to ensure semantic equivalence.

    Anthropic also disclosed a key figure: more than 90% of merged changes in its core codebase are written by Claude under human guidance. The human engineer’s role is shifting from writing code line by line to architecture decisions, requirement definition, and code review.

    3.3 Community Feedback: A Capability Leap and “Over-Responsibility”

    After release, independent AI researchers and founders called it the strongest publicly available model for coding and reasoning, capable of complex multi-file refactoring projects that no prior model could advance. Some feedback also noted that the model can be “over-responsible” in certain scenarios — triggering safety blocks on low-risk operations that would normally run fine (deleting a temporary file, modifying test data), requiring repeated human confirmation.

    This reflects the classic trade-off between autonomy and controllability in today’s AI-assisted development tools.


    4. Research and Hardware: Extending From Code to the Physical World

    4.1 Mathematical Proof: An Elementary Verification Path for Fermat’s Last Theorem in 30 Hours

    A complete proof of Fermat’s Last Theorem (the Wiles–Taylor proof) involves extremely complex elliptic curve and modular form theory, far beyond what a single inference pass can do. Instead, the research team had the model complete, within 30 hours, an “elementary verification path for a specific subset of exponents” — constructing complete infinite descent proofs for small exponents such as n=3, 4, 5, 6, and verifying each step’s logical validity in a formal language (Coq/Lean style).

    This is not the full Wiles proof, but it demonstrates the model’s persistence over long chains of mathematical deduction and its formal verification ability.

    4.2 Visual Understanding and Hardware Design

    On hardware-related tasks, the model accepts multimodal input such as circuit diagram screenshots, PCB layout images, and oscilloscope waveforms, and can:

    • identify chip part numbers and pin definitions (based on public datasheets);
    • analyze possible root causes of signal integrity issues (reflection, crosstalk);
    • generate draft VHDL/Verilog code;
    • write test cases and assertions.

    This signals AI-assisted development beginning to extend from pure software into hardware-software co-design.


    5. Safety Trade-offs: One Base, Two Strategies

    The dual-model strategy of this release is highly representative:

    Dimension Standard (Public) Research (Controlled Environment)
    Base model Identical Identical
    Capability ceiling Slightly limited Fully released
    Safety filtering Multiple layers: code execution sandbox, sensitive-operation confirmation, content moderation Relies on external risk-control systems; no extra model-layer blocking
    Intended use Enterprise production, education, general development Internal frontier research, security red-teaming

    This “same base + pluggable safety layer” design gives enterprises more flexible deployment options: high-security finance and government scenarios can use the standard version with their own audit and approval workflows layered on top; internal teams prioritizing R&D velocity can use the research version inside a controlled network environment.

    On Baidu AI Cloud’s Qianfan model platform, enterprises can likewise build a similar layered “model capability + safety policy” architecture using large model services at different security levels, combined with content moderation APIs, access control policies, and operation audit logs.


    6. Engineering Practice: Recommendations for Multi-Agent Architectures

    Based on the above, here are practical recommendations for enterprises and teams that want to adopt the “multi-agent long-horizon task” pattern.

    6.1 Task Decomposition: From “Divisible” to “Verifiable”

    Not every task suits multi-agent parallelism. Suitable ones share these traits:

    • clear interface boundaries between subtasks (e.g., microservice modules);
    • independent acceptance criteria per subtask (e.g., unit test pass rate);
    • global consistency that can be automatically checked via integration and contract tests.

    6.2 Orchestration Layer Design: The Main Control Agent’s Boundaries

    The main control agent should focus on:

    • maintaining the global task DAG (directed acyclic graph) and state machine;
    • handling conflicts and dependency waits between sub-agents;
    • deciding when to retry and when to escalate to a human.

    The main control agent should not modify business code directly. It should issue instructions through standardized “task cards” (JSON/YAML):

    1. task_id: "auth-module-impl-003"
    2. assigned_to: "agent-pool-auth"
    3. objective: "Implement a JWT-based user authentication module"
    4. constraints:
    5. - "Must use bcrypt for password hashing"
    6. - "Token lifetime is controlled by configuration, default 30min"
    7. - "Must cover four endpoints: login, refresh, logout, permission check"
    8. acceptance:
    9. - "Unit test coverage >= 85%"
    10. - "Passes the integration test suite auth-it-suite"
    11. - "No high-severity security vulnerabilities (based on SAST tool scan)"
    12. context_refs:
    13. - "docs/api-spec/auth.md"
    14. - "src/models/user.py"
    15. timeout_minutes: 120
    16. max_retries: 2

    6.3 Infrastructure: A Cloud-Native Foundation for Long-Running Tasks

    Multi-agent runs lasting days or weeks impose special infrastructure requirements:

    • Containerization and isolation: each sub-agent runs in its own container, with resource limits and network isolation enforced by a container platform, so one agent’s faulty operation cannot affect the whole;
    • Log aggregation and tracing: all agent inputs/outputs/decision chains are collected centrally through a logging service, with distributed tracing reconstructing the full causal chain of the task;
    • State persistence: the main control agent’s task DAG and sub-agent checkpoints are periodically written to object storage or a database, so an interrupted task can resume from the last checkpoint;
    • Monitoring and alerting: abnormal behavior (a sub-agent failing N times consecutively, resource consumption over threshold, sensitive content generated) triggers real-time alerts and automatically pauses the affected task flow.

    A combination of Baidu AI Cloud products — container engine, log service (BLS), object storage (BOS), and cloud monitoring (BCM) — can cover these infrastructure needs and provide a cloud foundation for building a multi-agent task platform.

    6.4 Cost Control: Dynamic Routing Across Reasoning Tiers

    Under a multi-agent architecture, token consumption grows exponentially. Recommendations:

    • route code generation and documentation writing to the medium reasoning tier;
    • route architecture design, security audits, and hard bug localization to the highest reasoning tier;
    • for simple pattern matching (code formatting, lint fixes), even a traditional rule engine or small model can be used, avoiding waste of large model resources.

    An intelligent routing layer (rule-based or a lightweight classification model) can automate this scheduling.


    7. Summary and Outlook

    This generation of flagship models marks the formal arrival of AI-assisted programming in the era of “long-horizon autonomy”:

    • Capability: from single-file code completion to systematic refactoring across modules and languages;
    • Orchestration: from one-to-one human-machine interaction to parallel collaboration among a thousand sub-agents;
    • Engineering: from demo-grade proofs of concept to real service migrations in production;
    • Safety: from post-hoc review to pluggable layered interception.

    For developers and enterprises, the key is not chasing a single model’s benchmark ranking, but understanding and mastering how to build a reliable multi-agent software engineering process — including task decomposition methodology, orchestration framework design, infrastructure selection, and cost governance.

    In this direction, Baidu AI Cloud, through the agent development framework, model fine-tuning and evaluation tooling, and cloud-native infrastructure offered on the Qianfan model platform, is helping enterprises and developers turn “AI-led long-horizon development” from a paper demo into scalable, governable productivity.


    Further reading:

    • Classic papers and open-source frameworks for multi-agent systems (a comparison of the design philosophies behind AutoGen, CrewAI, and MetaGPT);
    • Industrial applications of formal verification in software;
    • Engineering techniques for reducing large model inference cost (KV cache reuse, speculative decoding, batch scheduling).