Reproducible Methods for Rebuilding Open-Source AI Projects with Multi-Model Agents

    This article describes a reproducible workflow for rebuilding an open-source AI project with multi-model agents. The workflow includes six test configurations, two rounds of prompts with acceptance gates, deliverable-based acceptance criteria, and security constraints for API keys. The main finding is that agents that only check connectivity tend to miss boundary issues. Requiring a test coverage report makes the depth of testing verifiable and comparable.

    This article turns one practice of rebuilding an open-source AI project with multi-model agents into a reproducible workflow. The workflow includes six test configurations, two rounds of prompts, acceptance criteria for each deliverable, and security constraints for API keys. The core finding is that agents that only check connectivity tend to miss boundary issues. Requiring a test coverage report makes the depth of testing possible to inspect and compare.

    1. Six Test Configurations

    The test configurations combine four dimensions: role orchestration, context specification, tool form, and model category. Pairing these dimensions produces six configurations, listed in the table below.

    ID Role Orchestration Context Specification Tool Form Model Category
    A Multi-role team (architect, frontend, testing) Ultra-long context Cloud agent platform General-purpose model with long-document processing capability
    B Multi-role team Standard context Cloud agent platform General-purpose model
    C Single agent Ultra-long context Command-line tool General-purpose model with long-document processing capability
    D Single agent Standard context Local client General-purpose model
    E Single agent Standard context Command-line tool Code-specialized model
    F Single agent Standard context Command-line tool General-purpose model

    Record the exact model name, version, context window length, and unit price before each run. Models are updated often, and the same name can refer to different capabilities at different times. A model name alone is not enough to reproduce results. Each configuration should also record the run date, operating system, runtime version, and dependency lock file.

    2. Two Rounds of Prompts and Execution

    The workflow has two rounds. Each round has an acceptance gate, and a round that fails its gate does not move on to the next one.

    The first round covers analysis and framework design only. It does not call external services and does not require an API key. The prompt template is:

    1. You are the architecture analysis team for this project. The team has three roles: architect, frontend developer, and test engineer.
    2. Input materials: {project background materials}
    3. Replication goal: {replication goal}
    4. Output the following in order:
    5. 1. A list of functional modules. For each module, specify its inputs, outputs, and dependencies.
    6. 2. A data flow description and a system architecture diagram in Markdown and Mermaid format.
    7. 3. A first version of the code framework, including the directory structure and dependency versions.
    8. Do not call any external services in this round.

    The acceptance gate for round one has three conditions. All core functions of the original project appear in the module list. Each module defines its inputs and outputs. The Mermaid diagram renders correctly.

    The second round moves into execution. The model compiles the code, starts a local service, and completes end-to-end integration testing. The prompt template is:

    1. Now enter the execution phase.
    2. Read the API key from the environment variable PROJECT_API_KEY. Do not output its content in code, logs, or replies.
    3. The sandbox may only access the following allowlisted domains: {domain list}.
    4. Complete compilation, start the local service, and run end-to-end integration testing. Then output:
    5. 1. A test case list covering normal input, abnormal input, empty data, concurrent requests, and timeout scenarios.
    6. 2. The pass results for each category and a coverage report.
    7. 3. The issues found, fix records, and re-test results after fixes.

    The acceptance gate for round two has four conditions. The service starts normally. The test case list includes all five scenario categories above. The coverage report exists, and its figures can be checked. The re-test results after fixes match the report.

    3. Security Constraints for API Keys and Sandboxes

    The execution phase requires a real API key. When providing a key, follow these constraints:

    • Use a temporary key with the minimum permissions needed for this task.
    • Inject the key through environment variables or a secrets management service. Do not write it into prompts, code, configuration files, or logs.
    • Run the agent in an isolated container sandbox. The agent must not access the host file system or internal network resources.
    • Allow outbound network traffic only to allowlisted domains.
    • Set a usage cap, and interrupt the task automatically when the cap is exceeded.
    • Revoke the key immediately after the task ends, and check the logs for leftover sensitive information.

    These constraints do not reduce test depth. They limit where the key is visible and how it could be misused. The agent can still complete full end-to-end integration testing.

    4. Acceptance Criteria by Deliverable

    This task has three deliverables. Each one is accepted separately.

    Product feature document and structure diagram

    • Core functional modules are complete and match the original project description.
    • Data flow directions are consistent between the document and the diagram.
    • The Mermaid diagram renders, and its node names use the same terms as the document.

    Basic replica web page

    • The layout and text of the main pages match the original project.
    • The core interaction paths can be completed from start to finish.
    • The data structures returned by the API match the frontend rendering logic.
    • When data is empty, an API returns an error, or a request times out, the page shows a visible message instead of a blank screen or an error stack trace.

    Improved web page based on lessons learned

    • The page displays correctly at both mobile and desktop widths.
    • The size and load time of first-screen resources are recorded and compared with the basic version.
    • Abnormal scenarios are handled by a unified error-tolerance mechanism, and test cases cover them.

    5. Shallow and Deep Testing Compared

    The configurations differed clearly in how they executed the task. After receiving an API key, one type of agent sent a single request, confirmed a 200 response and a rendered page, and declared the task complete. The other type wrote its own tests for abnormal input, concurrency, and empty data. When those tests found problems, it returned to the code and fixed them.

    Comparison Item Shallow Smoke Testing Deep Boundary Testing
    Trigger condition Verifies connectivity only Requires a coverage report and a list of test scenarios
    Main output Single request result, page screenshot Test case list, coverage report, defect records
    Time and cost Low High, usually requires multiple rounds of calls
    Main risk Hides boundary issues and abnormal logic High resource consumption, requires usage caps
    Suitable scenario Quick check of whether the environment works Quality verification before delivery

    Deep testing found more boundary issues in this practice. We did not count defects, so we cannot draw a quantitative conclusion about the quality gap. To compare configurations, record these metrics: number of test cases, coverage, defects found, fix rounds, total time, and token cost.

    6. Practical Recommendations and Limitations

    When adopting this workflow, choose a configuration based on the task type. For long-document parsing and tasks that need a large amount of context, prioritize the ultra-long context configuration. For deep code refactoring and test generation, compare the results of code-specialized models with those of general-purpose models. Model selection should not rely only on general leaderboard scores. Run small-sample tests on your own project.

    This practice has clear limitations. It used one open-source project of a single type, so the conclusions may not apply to other domains. Results may change after model version updates. Costs and security boundaries were verified only at small scale.

    The next steps are to expand the project sample, repeat runs with fixed model versions, and add the metrics above to the record sheet for every experiment. Only with enough metric data can we judge whether the differences between configurations are stable.