Overview
Replace @opencode-ai/sdk dependency with native OpenRouter extended thinking via AI SDK.
Parent Epic: #19
Depends on: #21
Acceptance Criteria
Files to Modify
src/tools/opencode-client.ts → DELETE or refactor
src/holons/adk/tools.ts - Update openCodeReasonTool
src/config.ts - Remove opencode section
package.json - Remove @opencode-ai/sdk
Technical Notes
Extended thinking via OpenRouter:
import { streamText } from 'ai';
import { openrouter } from '@openrouter/ai-sdk-provider';
const result = await streamText({
model: openrouter('anthropic/claude-opus-4.5:thinking'),
prompt: problem,
providerOptions: {
openrouter: {
reasoning: { effort: 'high' }
}
}
});
// Access reasoning tokens
const reasoning = result.reasoning;
const usage = result.usage; // includes reasoningTokens
Migration Path
- Create new
src/tools/extended-reasoning.ts using AI SDK
- Update
openCodeReasonTool to use new implementation
- Verify reasoning output matches previous quality
- Remove old OpenCode client and dependency
Testing
- Test extended reasoning on complex decomposition tasks
- Verify reasoning tokens tracked in usage
- Check SSE streaming works for real-time output
- Compare output with OpenCode baseline
Part of Hybrid ADK + AI SDK Migration
Overview
Replace
@opencode-ai/sdkdependency with native OpenRouter extended thinking via AI SDK.Parent Epic: #19
Depends on: #21
Acceptance Criteria
opencode-client.tsremoved or replaced with AI SDK wrapperopencode_reasontool uses AI SDK with:thinkingmodel variant@opencode-ai/sdkremoved frompackage.jsonconfig.tsFiles to Modify
src/tools/opencode-client.ts→ DELETE or refactorsrc/holons/adk/tools.ts- UpdateopenCodeReasonToolsrc/config.ts- Removeopencodesectionpackage.json- Remove@opencode-ai/sdkTechnical Notes
Extended thinking via OpenRouter:
Migration Path
src/tools/extended-reasoning.tsusing AI SDKopenCodeReasonToolto use new implementationTesting
Part of Hybrid ADK + AI SDK Migration