Dual-Model Collaboration: Combining Planning and Execution Quotas in Practice

    This article presents a reusable engineering pattern that separates planning from execution across two models with independent quotas. A reasoning model produces analysis and plans, while a coding tool reads those plans and handles file changes, test runs, and result write-back. The two sides exchange information through a collaboration directory inside the repository, coordinated by a local Model Context Protocol (MCP) service exposed through an encrypted tunnel. The article covers the architecture, one-time setup, the handoff protocol for executable plans, an end-to-end workflow, and common pitfalls such as over-exposure, vague plans, and uncontrolled retries. Readers will learn how to balance idle conversational quota against exhausted execution quota while keeping changes reviewable, auditable, and reversible.

    1. The Problem: Capabilities Fragmented by Quota Boundaries

    A common frustration in day-to-day development is that the model responsible for “thinking things through” and the coding tool responsible for “getting work done” usually belong to two separate resource systems. The former is more reliable at understanding complex requirements, weighing trade-offs, and breaking down tasks, and its answers tend to be more measured. The latter can read and write local files, run tests, and iterate repeatedly, but it tends to lose focus during long-horizon planning. The awkward part is that the tool side typically does not allow freely switching to any reasoning tier, which creates a split: the one that can think cannot act, and the one that can act does not think well enough.

    On top of that, the two quotas are settled independently. Conversational scenarios often leave a large amount of quota idle, while the execution-side quota is quickly consumed by frequent reads, writes, and test runs. This article discusses how to turn that structural mismatch into a reusable engineering collaboration pattern.

    2. Overall Approach: One Side Thinks, the Other Acts

    The core approach can be summarized as “separation of planning and execution plus a standard handoff artifact.” The reasoning-side model only produces analysis and plans and never modifies source code directly. The execution-side tool reads the plan, then makes code changes, runs tests, and writes results back. The two sides exchange information through a collaboration directory inside the repository, forming a closed loop.

    This design delivers three direct benefits:

    • Complementary quotas: planning consumes conversational quota, execution consumes tool-side quota, and neither side is wasted.
    • Clear responsibilities: planning artifacts can be reviewed and rolled back, avoiding the hidden damage caused by “thinking and editing at the same time.”
    • Auditable process: every planning and execution record is persisted in the repository, making retrospectives and handoffs easier.

    3. Architecture: Controlled Exposure and Two-Way Records

    The key to implementing this pattern is to start a local service that follows the Model Context Protocol (MCP) and expose the repository’s necessary information to the remote model in a controlled way. The local service is then securely mapped outward through an encrypted tunnel so the remote side can access it. The exposure scope should be strictly limited to: the project file tree, source code content, version control status, and the plans and execution records in the collaboration directory.

    A schematic directory and protocol structure looks like this:

    1. .ai-bridge/
    2. plan.md # Planning artifact: goals, constraints, breakdown steps, acceptance criteria
    3. tasks/ # Atomic task list; each item includes input, expected change, verification method
    4. runs/ # Execution records: commands, output summaries, failure reasons
    5. state.json # State machine: planned -> running -> verified -> done

    On security, one point must be emphasized: the tunnel should be temporary and session-scoped; tokens should follow least privilege and be short-lived; the exposure list should use an allowlist rather than a denylist; and reads of key or credential files should be denied by default. These constraints are not optional. They are the prerequisite for using this pattern in real projects.

    4. One-Time Setup: Preparing the Environment

    Setup only needs to be done once, after which a single command starts things each day. The recommended steps are:

    1. Prepare the runtime environment (a general-purpose runtime and package manager) and confirm the versions meet requirements.
    2. Install the bridge component globally and run its initialization command to generate a configuration template.
    3. Fill in the repository path, exposure allowlist, collaboration directory name, and tunnel parameters in the configuration.
    4. Enable developer mode on the conversational side and register the MCP service, then verify the tool list is visible.
    5. Run a connectivity self-check to confirm that all three read types work: file tree, version status, and collaboration directory.
    1. # Example: install and initialize (actual commands depend on the chosen implementation)
    2. npm install -g <bridge-tool>
    3. <bridge-tool> setup

    Note that command and parameter naming varies significantly across implementations. This article does not bind to any specific tool; readers should follow the official documentation of the component they choose and avoid copying parameters that may not work.

    5. The Handoff Protocol: Making Plans Actually Executable

    A plan that looks good but cannot be executed is the most common failure point in this kind of collaboration. An executable plan should contain four elements: goals and scope, constraints and off-limits areas, a sequence of atomic tasks, and acceptance criteria. Each atomic task should correspond to a single verifiable change and specify the verification command.

    1. ## Goal
    2. Reduce repeated computation in list queries without changing the external interface.
    3. ## Constraints
    4. - Do not modify public type definitions
    5. - Do not introduce new runtime dependencies
    6. ## Tasks
    7. 1. Extract the cache key generation function and add unit tests
    8. 2. Integrate caching in the query layer and keep the existing fallback branch
    9. 3. Run tests and static checks, and record the timing comparison
    10. ## Acceptance
    11. - All tests pass
    12. - No new static check warnings

    Each time the execution side completes an item, it writes the command, output summary, and failure reason into the run record and updates the state machine. The planning side uses this to decide whether to continue, replan, or roll back, turning a “one-shot long plan” into a convergent iterative process.

    6. End-to-End Walkthrough: From Requirement to Mergeable Change

    Using a medium-complexity requirement as an example, the full chain is:

    1. Start the bridge service and confirm on the conversational side that the repository is readable.
    2. State the requirement and acceptance criteria, and have the reasoning side produce plan.md and the task list.
    3. Review the plan manually, trim out-of-scope items, and confirm constraints.
    4. Hand it to the execution side to implement item by item, run tests, and write back records.
    5. If consecutive failures occur, trigger replanning instead of blindly retrying.
    6. After all acceptance criteria pass, prepare the change description and risk notes, and move to review.

    The most effective habit in practice is “small-step handoff”: release only two or three atomic tasks at a time, observe the quality of the execution records, then scale up. This is more stable than delivering one very long plan at once and makes problems easier to locate.

    7. Common Pitfalls and How to Avoid Them

    • Over-exposure: adding keys or irrelevant directories to the allowlist is extremely risky and should be denied by default.
    • Vague plans: a plan without acceptance criteria lets the execution side improvise, producing uncontrolled output.
    • Uncontrolled failure retries: without a replanning mechanism, execution quota is easily consumed repeatedly at the same spot.
    • Out-of-sync state: when the state machine does not match actual changes, it causes duplicated work, so it should be forcibly updated after every execution.
    • Ignoring rollback: any batch change should be revertible with one action, keeping version control as the last line of defense.

    8. Conclusion

    Splitting “strong planning” and “strong execution” into two roles connected by a standard handoff artifact is a general engineering method that does not depend on any specific product. It eases pressure on the execution-side quota and gives idle conversational quota real value. Readers can implement the same protocol entirely with self-built scripts or internal team tools. The key is clear constraints, complete records, and convergent iteration.