Model Resolution Pipeline
Relevant source files
The following files were used as context for generating this wiki page:
The Model Resolution Pipeline within the OhMyOpenCode framework is a structured, multi-phase system designed to transform high-level user requests into executable, verified work plans. Primarily managed by the Prometheus agent, the pipeline enforces a strict separation between strategic planning and technical implementation. It utilizes specialized subagents—specifically Metis for gap analysis and Momus for plan review—to ensure that generated outputs are clear, verifiable, and free of architectural "slop."
This pipeline operates through three distinct phases: Interview Mode, Plan Generation, and High Accuracy Review. By requiring a formal "Clearance Checklist" before proceeding, the system ensures that all technical approaches and test strategies are finalized before a single line of implementation is planned.
Sources: src/agents/prometheus/identity-constraints.ts:13-35, src/agents/prometheus/plan-generation.ts:11-15, src/agents/metis.ts:10-18
Phase 1: Strategic Interview and Intent Classification
The pipeline begins with the Interview Mode, where the system acts as a strategic consultant rather than a code writer. The primary goal is to gather requirements and record decisions into a mandatory Draft File located at .sisyphus/drafts/{name}.md.
Intent Classification
Before requirements gathering, the system classifies the request to determine the interview strategy.
| Intent Type | Signal | Focus |
|---|---|---|
| Refactoring | "restructure", "clean up" | Safety, regression prevention, impact scope. |
| Build from Scratch | "create new", "add feature" | Pattern discovery, codebase consistency. |
| Architecture | "how should we structure" | Strategic trade-offs, Oracle consultation. |
| Research | "investigate", "find how" | Exit criteria, parallel probes. |
Sources: src/agents/prometheus/interview-mode.ts:12-30, src/agents/metis.ts:30-45
Clearance Checklist
The pipeline cannot transition to generation until a self-clearance check passes. This ensures the objective, technical approach, and test strategy are confirmed.
The clearance check requires "YES" for core objectives, scope boundaries, technical approach, and test strategy.
Sources: src/agents/prometheus/identity-constraints.ts:81-100, src/agents/prometheus/interview-mode.ts:108-115
Phase 2: Plan Generation and Gap Analysis
Once cleared, the pipeline triggers the Plan Generation phase. This phase is characterized by a mandatory consultation with the Metis agent to identify hidden requirements and potential over-engineering.
Metis Consultation
Metis acts as a pre-planning consultant. It performs a "Gap Classification" to distinguish between critical issues requiring user input and minor issues that can be self-resolved.
- Critical Gaps: Requires immediate user input (e.g., business logic choices).
- Minor Gaps: Fixed silently by the agent (e.g., missing file references).
- Ambiguous Gaps: Sensible defaults are applied and disclosed in the summary.
Sources: src/agents/prometheus/plan-generation.ts:102-120, src/agents/metis.ts:14-25
Plan Output Structure
Plans are written to .sisyphus/plans/{name}.md using a strict template that includes a TL;DR, context, verification strategy, and atomic TODOs.
Phase 3: High Accuracy Review (Momus)
The final phase involves an optional High Accuracy Mode utilizing the Momus agent. Momus reviews the generated plan with a "ruthless critical eye" to ensure executability.
Momus Review Logic
Momus operates with an Approval Bias, approving plans that are "80% clear" while rejecting those with blocking issues like non-existent file references or vague tasks.
| Action | Criteria |
|---|---|
| OKAY | Referenced files exist; tasks have enough context to start. |
| REJECT | Impossible to start; internal contradictions; broken references. |
Sources: src/agents/momus.ts:35-65, src/agents/prometheus/plan-generation.ts:167-175
The Execution Loop
If Momus rejects a plan, the pipeline enters a loop where Prometheus must fix the identified issues (maximum 3 per rejection) and resubmit until approved.
Technical Constraints and Protocols
Atomic Write Protocol
To prevent content loss during plan generation, the pipeline follows a mandatory write protocol. The system must prepare the entire plan in memory and perform a single write, as the tool overwrites files rather than appending.
Sources: src/agents/prometheus/identity-constraints.ts:128-145
Zero Human Intervention Verification
A core architectural requirement of the pipeline is that every task in a generated plan must be verifiable by the agent without human action. This includes using tools like Playwright for UI, curl for APIs, and tmux for CLI verification.
Sources: src/agents/prometheus/plan-template.ts:60-80
Summary
The Model Resolution Pipeline ensures that engineering tasks are meticulously planned and reviewed before execution. By leveraging Prometheus for strategy, Metis for wisdom, and Momus for practical validation, the pipeline reduces bugs and rework by catching ambiguities in the planning phase rather than during implementation.