Problem
AiAgentService.create_agent and AiAgentService.update_agent (packages/sdk/src/pipefy_sdk/services/ai_agent_service.py) check only that the response agent has a uuid key:
if not agent or "uuid" not in agent:
raise ValueError(...)
agent_uuid = str(agent["uuid"])
If the API returns "uuid": null, the check passes and str(None) makes the UUID the string "None".
create_agent returns agent_uuid: "None" as a success.
PipefyClient.create_ai_agent then sends the chained update for the agent "None". That update fails, so the caller gets AiAgentConfigureError(agent_uuid="None"), which names an agent that does not exist.
Proposal
Reject a missing or null uuid with the existing ValueError in both methods: if not agent or not agent.get("uuid"). Add a test for each method with "uuid": None.
Context
Raised in the review of #704. The check predates that PR.
Problem
AiAgentService.create_agentandAiAgentService.update_agent(packages/sdk/src/pipefy_sdk/services/ai_agent_service.py) check only that the responseagenthas auuidkey:If the API returns
"uuid": null, the check passes andstr(None)makes the UUID the string"None".create_agentreturnsagent_uuid: "None"as a success.PipefyClient.create_ai_agentthen sends the chained update for the agent"None". That update fails, so the caller getsAiAgentConfigureError(agent_uuid="None"), which names an agent that does not exist.Proposal
Reject a missing or null
uuidwith the existingValueErrorin both methods:if not agent or not agent.get("uuid"). Add a test for each method with"uuid": None.Context
Raised in the review of #704. The check predates that PR.