When you "agree to disagree" with someone, it probably means that the set of problems you are trying to solve, and the set the other person is trying to solve do not completely intersect.
You can either work together to grow a single solution into something that covers both problem domains, or create two separate solutions. Sometimes the former is not practical. It is often helpful to start with the latter approach and then compare the two side-by-side, factoring out commonalities until there is nothing left to factor. You may end up with nothing left over, but even if you do, at least you have managed to reduce the amount of disjoint code that must be maintained in the future.
In order to collaborate on a solution, that solution must solve both sets of problems concurrently. This may sound obvious, but if you aren't in the habit of "seeking first to understand", it is easy to miss the other person's needs, subconsciously filtering out that which does not happen to intersect with your own mental model.