refactor!: remove duplicated agent surface (callModel, tools, ModelResult) - #806
refactor!: remove duplicated agent surface (callModel, tools, ModelResult)#806christineschen wants to merge 2 commits into
Conversation
Original prompt from christine.chen
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Summary
Deletes the agent implementation that now lives in
@openrouter/agent, per the migration already announced in the README. 20 hand-written source files, their unit tests, and the examples that only demo them are gone, along withOpenRouter.callModeland theToolTypere-export from the generated client class.This is a breaking public API change and needs a major release. Not a semver-patch cleanup, even though the code is internally dead:
callModelis a published method, andpackage.json's wildcard exports (./*,./*.js) made every deleted module externally addressable.Removed subpaths a consumer could have been importing:
lib/tool,lib/tool-types,lib/tool-executor,lib/tool-orchestrator,lib/tool-context,lib/tool-event-broadcaster,lib/model-result,lib/conversation-state,lib/turn-context,lib/next-turn-params,lib/async-params,lib/stop-conditions,lib/reusable-stream,lib/stream-transformers,lib/stream-type-guards,lib/chat-compat,lib/anthropic-compat,lib/claude-constants,lib/claude-type-guards,funcs/call-model.Every one of these has a counterpart in
@openrouter/agentexcept three that were SDK internals and are not dedicated agent exports:tool-executor,tool-orchestrator,stream-type-guards.src/models/claude-message.tsis generated and untouched.The
callModelmethod and its imports lived in the two persistent-edit regions ofsrc/sdk/sdk.ts, so the deletion is expressed by emptying those regions rather than by an overlay. Worth a second pair of eyes from whoever owns the generation pipeline: if regeneration re-derives the class body from a source other than these regions, the method could come back.Verification
pnpm lint,pnpm typecheck,pnpm build, andnpx vitest run --project unitpass, and no reference to a deleted module remains undersrc/. E2E tests were not run (they need a liveOPENROUTER_API_KEY).Related
@openrouter/agent/tool. It should land before this SDK version ships.Link to Devin session: https://openrouter.devinenterprise.com/sessions/cc64b378b1f04154aae4b8cf03d67d0b
Requested by: @christineschen