Skip to content

Migrate vide_core from claude_sdk to agent_sdk types#76

Merged
Norbert515 merged 4 commits intomainfrom
refactor/agent-sdk-migration
Feb 22, 2026
Merged

Migrate vide_core from claude_sdk to agent_sdk types#76
Norbert515 merged 4 commits intomainfrom
refactor/agent-sdk-migration

Conversation

@Norbert515
Copy link
Owner

Summary

  • Decouples vide_core services from claude_sdk-specific types — core business logic now depends only on the provider-agnostic agent_sdk interface
  • Adds bidirectional type mappers in the claude_sdk bridge layer (toClaude/fromClaude) so provider-specific conversions happen at the boundary
  • Fixes 3 type-safety regressions: Object? parameter in createForked, ClaudeAgentClient cast in forkAgent, and raw parameter map access in TUI renderers
  • Adds typed tool invocation subclasses (AgentWriteToolInvocation, AgentEditToolInvocation, AgentFileOperationToolInvocation) to agent_sdk with factory dispatch
  • Replaces MockClaudeClient with MockAgentClient in all vide_core tests

Changes by package

agent_sdk — New typed tool invocation hierarchy, permission models, createTyped() factory, path dependency

claude_sdk — Reverse mappers (toClaude) for conversation, message, response, permission types. New test suites for round-trip verification

vide_core — All services use AgentClient instead of ClaudeClient. createForked takes AgentConversation? instead of Object?. Removed ClaudeAgentClient import from agent_lifecycle_service. Tests migrated to MockAgentClient

TUI — Renderers use typed invocations (is AgentWriteToolInvocation, etc.) instead of raw parameters['file_path'] map access

Test plan

  • dart analyze clean across all 4 packages (agent_sdk, claude_sdk, vide_core, root)
  • dart test packages/agent_sdk — 37/37 new typed invocation tests
  • dart test packages/claude_sdk — 759/759 (32 new reverse mapper tests)
  • dart test packages/vide_core — 504/504 (all tests migrated to MockAgentClient)
  • Verified no remaining ClaudeClient/ClaudeConversation references in vide_core/lib
  • Verified no remaining raw parameters['...'] access in TUI renderers

Decouple vide_core services from claude_sdk-specific types so the core
business logic depends only on the provider-agnostic agent_sdk interface.

Key changes:
- vide_core services use AgentClient instead of ClaudeClient
- Added bidirectional type mappers in claude_sdk bridge (toClaude/fromClaude)
- Changed createForked interface from Object? to AgentConversation?
- Removed ClaudeAgentClient cast from agent_lifecycle_service
- Added typed tool invocation subclasses to agent_sdk
  (AgentFileOperationToolInvocation, AgentWriteToolInvocation, AgentEditToolInvocation)
- Updated TUI renderers to use typed invocations instead of raw parameter map access
- Replaced MockClaudeClient with MockAgentClient in vide_core tests
@Norbert515 Norbert515 force-pushed the refactor/agent-sdk-migration branch from aa7871b to 8ddb0f2 Compare February 21, 2026 22:01
- Fix Codex thinking tokens not rendering in TUI: forward ThinkingEvent
  in RemoteVideSession, map streaming reasoning deltas to ThinkingResponse,
  deduplicate completed reasoning events
- Improve thinking token styling: bump opacity to 0.6, add spacing between
  thinking and response text, strip Codex bold markers
- Make AgentClientFactory injectable via VideCoreConfig for Codex support
- Add CodexAgentClient/CodexAgentClientFactory bridge (codex_sdk)
- Add Codex backend toggle in settings UI
- Add sessionLogPath() to VideLogger for resolving log file paths
- Add /logs slash command to open current session log in file viewer
- Add Session Logs entry in Settings > Debug section
- Make file preview text selectable (split gutter/content into two
  synced ListViews so only content is inside SelectionArea)
@Norbert515 Norbert515 merged commit aec1369 into main Feb 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant