AI Coding in Practice: 8 Days, 1,000 Agents, and a Working OS Prototype

    This article examines a recent AI coding experiment in which over a thousand sub-agents collaborated for eight days to build an operating system prototype that boots on a laptop. It explains why "actually runs" is harder than "looks right," breaks down four pillars that keep long-running multi-agent tasks under control—task decomposition, context engineering, automated verification loops, and cost control—and offers practical advice and risk boundaries for teams adopting AI coding.

    1. From Writing Snippets to Shipping Systems

    Over the past two years, most developers have viewed AI coding tools as assistants that autocomplete a few lines or explain an error message. A recent, widely discussed experiment pushed that perception much further: an operating system prototype built primarily by AI, running continuously for eight days and coordinating more than a thousand sub-agents. The result boots on a real laptop and includes a kernel, drivers for hardware such as disk and keyboard, file storage, a window system, a login screen, and an installer, with an interface point reserved for an AI assistant.

    Around the same time, a content team used AI coding tools to rebuild photo editing and video editing software, then dropped the general-purpose commercial subscriptions they had relied on for years. The common thread in these cases is not “it generated fast,” but “what it generated actually works.” This marks a shift in how we evaluate AI coding: away from code similarity and generation speed, and toward runnability, maintainability, and the ability to handle real workloads.

    2. Why “It Runs” Is Harder Than “It Looks Right”

    A common failure mode in early AI-generated interfaces is high visual fidelity paired with an empty shell: buttons do nothing, and critical paths are missing. The reason is that the core cost of software engineering lies not in syntax but in four hidden constraints:

    1. State consistency: State such as layers, selections, and timelines must stay synchronized across multiple places; missing one breaks the feature.
    2. Boundary conditions: Empty files, extremely high resolutions, abnormal encodings, and insufficient permissions rarely appear in demos but are routine in daily use.
    3. Contract stability: Once interfaces between modules drift, upper-layer features fail in clusters.
    4. Verifiability: Without automated verification, a model can only “declare done after writing,” pushing defects onto users.

    So the key to getting usable systems from AI is not stronger single-turn generation, but making engineering constraints explicit and letting the model work inside a closed loop.

    3. Four Pillars: Keeping Long-Running Multi-Agent Tasks Under Control

    3.1 Task Decomposition and Dependency Orchestration

    A thousand sub-agents running in parallel without a strict dependency graph will only produce conflicting changes. A workable approach is to first produce a stable architectural skeleton and an interface list, then dispatch tasks in batches by dependency layer: low-level drivers and memory management first, then the file system and input subsystem, and finally the window and UI layers. Each sub-agent has one clear goal, a clear input/output contract, and acceptance criteria.

    A sample task description looks like this:

    1. Goal: Implement keyboard interrupt handling and character mapping
    2. Input: Interrupt vector table definition, device register layout doc
    3. Output: Compilable module + unit tests + known limitations
    4. Acceptance: After injecting a simulated interrupt, buffer contents match expectations
    5. Prohibited: Modifying memory allocator and scheduler interfaces

    The “Prohibited” and “Acceptance” fields matter just as much as the goal; they are the guardrails against scope creep.

    3.2 Context Engineering: Give Each Agent Exactly What It Needs

    Context windows are limited, while a large codebase far exceeds their capacity. An effective strategy is layered supply: the global layer holds only architecture decisions and interface contracts, the module layer holds relevant files and callers, and the task layer holds failure logs and reproduction steps. Retrieval pulls information on demand instead of stuffing the whole repository into the prompt. It also helps to maintain a continuously updated fact sheet (agreed interfaces, deprecated approaches, known defects) so new agents do not repeat the same mistakes.

    3.3 Automated Verification Loops: Replace “I Think It’s Right” With “The Machine Proves It”

    The biggest risk in long-running sessions is the model’s self-confirmation bias. You need an external judge: compilation as a gate, unit and integration tests run in layers, fuzz testing for memory and permission errors, and end-to-end smoke tests of the boot flow. Any commit that fails verification is rolled back, and the failure log is written back into the task queue in structured form, creating a “generate-verify-fix” loop. This also explains why such projects need to run for days: most of the time goes into verification and repair, not typing code.

    3.4 Cost Control: The Engineering Logic Behind a 20% Drop in API Spend

    In large projects, cost overruns usually come from three sources: repeatedly reading the same context, retrying failed tasks over and over, and failing to reuse intermediate artifacts. The matching optimizations are caching and reusing build artifacts and test baselines, routing tasks by difficulty to models of different sizes, batching small tasks, and capping retries for failed tasks while forcing human or stronger-model intervention. These ideas align with running parallel tasks on a general-purpose container platform on Baidu AI Cloud, storing build artifacts in object storage, and tracking failure rates with logging and monitoring/alerting services: get observability solid first, and cost optimization has a basis.

    4. Practical Advice for Teams

    • Start with internal tools: Choose scenarios with familiar workflows and clear acceptance criteria, such as batch processing, format conversion, and internal reports, rather than core transaction paths.
    • Define contracts before generating: Have humans confirm interfaces and data structures, and leave implementation to the model; this significantly reduces rework.
    • Shift verification left: Make tests and static checks generation constraints up front, not after-the-fact fixes.
    • Keep human gates: Operations involving permissions, data deletion, and external calls must be confirmed by a human.
    • Measure, don’t guess: Track first-pass rate, average repair rounds, cost per task, and human takeover rate, and use data to decide whether to scale up.

    5. Boundaries and Risks

    It is important to be clear-eyed: these results are closer to “a runnable prototype” than to production-grade systems, with clear gaps in security auditing, permission isolation, supply-chain trust, long-term maintenance, and documentation completeness. License compliance, traceability of generated code provenance, and determinism on critical paths cannot rely on the model’s own judgment. A reasonable positioning is to treat AI as a high-intensity executor while keeping architectural judgment, risk trade-offs, and final accountability with humans.