Skip to content

SEC-768: refactor: remove the old callModel code that moved to @openrouter/agent - #1356

Merged
LukasParke merged 3 commits into
mainfrom
devin/1793837540-sec-768-stopwhen-before-approval
Nov 5, 2026
Merged

LukasParke merged 3 commits into
mainfrom
devin/1793837540-sec-768-stopwhen-before-approval

Conversation

@alexb-openrouter

@alexb-openrouter alexb-openrouter commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SEC-768 (stopWhen checked after auto-approved siblings of an approval-gated call ran) is in the SDK's old copy of callModel. callModel and its tool system moved to @openrouter/agent (see the README's migration note), and the copy here is not exported from the package entry points. So this PR deletes that code instead of fixing it. The agent-side fix is OpenRouterTeam/typescript-agent#143.

Removed:

  • src/funcs/call-model.ts and the 19 hand-written src/lib/ files that only it used: model-result, tool, tool-types, tool-executor, tool-orchestrator, tool-context, tool-event-broadcaster, conversation-state, stop-conditions, next-turn-params, async-params, turn-context, reusable-stream, stream-transformers, stream-type-guards, anthropic-compat, chat-compat, claude-type-guards, claude-constants. No generated file imports any of them.
  • The OpenRouter#callModel method and the ToolType re-export in the custom regions of src/sdk/sdk.ts.
  • The 11 unit tests and 5 examples that used this code. Also removed the callModel architecture section from CLAUDE.md.

Breaking-change note: OpenRouter#callModel and ToolType were still on the class and in the 1.5.56 typings. Tool, tool(), stop conditions and ModelResult were not exported from any entry point. Anyone who still calls client.callModel() must move to @openrouter/agent.

Testing

  • pnpm run lint, pnpm run typecheck, pnpm run build pass. esm/sdk/sdk.d.ts no longer mentions callModel.
  • pnpm test: 7 files, 65 tests pass.
  • CI validate has been failing on the live-API e2e test tests/e2e/image-generation.test.ts. The same failure shows up on other open PRs, so this change didn't cause it.

Fixes SEC-768

Link to Devin session: https://openrouter.devinenterprise.com/sessions/c1a6389d6666493e86069406d08ef2ef
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/c1a6389d6666493e86069406d08ef2ef?variant=devin
Requested by: @alexb-openrouter

…of an approval-gated call

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

devin-ai-integration Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot changed the title SEC-768: fix(callModel): check stopWhen before running auto-approved siblings of an approval-gated call SEC-768: refactor: remove the old callModel code that moved to @openrouter/agent Nov 5, 2026
@LukasParke
LukasParke merged commit 531e4cb into main Nov 5, 2026
3 checks passed
@LukasParke
LukasParke deleted the devin/1793837540-sec-768-stopwhen-before-approval branch November 5, 2026 17:38
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.

3 participants