Repository navigation
Accept transfer_to_number tools that use transfer_rules - #940
Conversation
Mirrors elevenlabs-js: no_transfers only when neither transfers nor a loaded transfer_rules has entries, loaded rules kept as loaded, and a new conflicting_transfers error when both are set. Vendors fixtures 22 and 23. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR SummaryLow Risk Overview A new Tests and shared JSON fixtures cover the happy path round-trip and the conflict case. Reviewed by Cursor Bugbot for commit 68c9731. Bugbot is set up for automated code reviews on this repo. Configure here. |
transfer_to_agent has no transfer_rules, so a loaded one no longer lets an agent transfer skip no_transfers. Adds tests that an agent transfer with rules is no_transfers and that build() sends loaded rules in the request. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
A
transfer_to_numbertool can hold per-providertransfer_rulesinstead oftransfers; the API takes exactly one of the two. The tools-as-code builder rejected a pulled rules-only tool asno_transfers, so it couldn't be loaded and written back. Now such a tool is valid, its rules are kept exactly as loaded, and a tool with both lists is a newconflicting_transferserror.Details
no_transfersfires only when neithertransfersnortransfer_ruleshas entries. The API requires thetransferskey, so a pulled rules tool carries"transfers": [], which is written back as loaded.transfer_rulesis load-only: there is no builder method for it. Rules are nested per-provider unions (Twilio, SIP trunk, Exotel, each with two transfer modes), which would be a large surface to add in all eight SDKs for a field the API describes as an alternative form.conflicting_transfers:transfer()on a loaded rules tool (or a loaded config with both) would otherwise produce a config the API rejects.22-transfer-rules.json(byte-identical round trip of a rules tool) and23-errors-conflicting-transfers.json.Testing
pytest tests/agent_tools: 90 passed.ruff checkandruff format --checkclean.🤖 Generated with Claude Code