15527ce2ce
Capture the assessment of how opencode integrates the AI SDK today and the phased plan to replace it with @opencode-ai/llm behind a feature flag. Sections: - Today's architecture, including the trace of one streamText call and the existing native path's gate conditions - Where the spaghetti actually lives (AI SDK type leakage in 11+ files, scattered provider-specific transforms, the provider/sdk/copilot/* fork, duplicated MessageV2 conversion) - Target architecture (one flag, one decision point at layer construction) - Phased migration: Decouple → Service swap → Native parity → Flag rollout → Delete AI SDK - Suggested execution order, key files, risks and open questions