Repository navigation
Push manages only webhook and client tools; branches never write the main file - #941
Conversation
…main file Brings the four agents-as-code fixes the six ports carry back to the reference: - tools() lists only webhook and client tools. A tool of another kind (mcp...) stays attached by the id it was loaded with, in tool_ids and workflow nodes; without one, validate() reports invalid_tool. - A branch entry without a non-empty config path is rejected before anything is written, and recording a branch never falls back to the main file. - from_json keeps loaded tools of other kinds in tool_ids, as pull does, so update(tools=...) no longer drops them. - An other-kind tool whose id is already attached is not listed twice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR SummaryMedium Risk Overview Loading and serialization change so Branch project writes no longer fall back to the main config file: branch push/pull/record requires a branch Reviewed by Cursor Bugbot for commit 0ad696d. Bugbot is set up for automated code reviews on this repo. Configure here. |
Summary
Cursor Bugbot found four agents-as-code bugs in the SDK ports. They are fixed there, and the same code is in this reference SDK, so this brings the fixes back to keep all eight SDKs behaving the same.
agents.push()now creates and updates only webhook and client tools. An MCP or other unmodeled tool stays attached by the id it was loaded with. A branch push or pull whoseagents.jsonentry has no config file of its own is rejected before anything is sent or written.Details
Agent.tools()used to leave out only system tools, so push would create or PATCH an MCP tool with a stripped config. It now returns only webhook and client tools, which is what the spec already said. A tool of another kind goes intotool_idsand workflow nodes under its loaded id (itstools_by_idkey, the first in sort order if there are several). With no loaded id,validate()reportsinvalid_toolattools.<name>:Tool "<name>" has type "<type>", which push doesn't create or update: load it with its id or attach it with tool_ids. In a loaded workflow nobody has edited, other-kind tool ids are left as they were._record_agentwrotebranch["config"], so a branch entry with noconfigraisedKeyErrorand an empty one wrote to a bogus path (the ports fell back to the main file). The branch check, which runs before any request, now also requires a non-empty stringconfigon the matching branch entry and raises the existing "has no config file" error. The fallback is gone. The branch lookup is also skipped when there's nobranch_id, so an entry missingbranch_idcan't match a main-branch push.from_jsonturned everytools_by_idmatch into a tool object, soupdate(tools=...)dropped a loaded MCP tool. Now only webhook and client matches become objects. Other kinds stay intool_ids, aspullalready leaves them.tools_by_idstill holds them, so a workflow node oradd_tool()can use the object.tool_idsis assembled, an other-kind tool object whose id is already in the list is skipped. Before this, re-adding a loaded MCP tool withadd_tool()listed its id twice.docs/agents-as-code/agent-spec.md).pma/agents-as-codePRs, e.g. Add agents as code: Agent builder, client.Agents.Push/Pull and CLI projects elevenlabs-go#13 and Add agents as code: Agent builder, Agents.PushAsync/PullAsync and AgentProject elevenlabs-dotnet#12. Reference counterpart, with the spec change: Push manages only webhook and client tools; branches never write the main file elevenlabs-js#500.Testing
pytest tests/agent_builder: 62 passed. The 8 new tests (branch entry with no, empty or non-stringconfig; MCP tool without an id; MCP tool kept by id when loaded, fromtools.jsonand in a workflow node; loaded MCP tool kept intool_idsand attached once afteradd_tool()) all fail againstmain's source. With only fix 4 reverted, theadd_tool()assertion fails on its own.ruff format,ruff checkandmypy src/elevenlabs/agent_builderpass.🤖 Generated with Claude Code