Skip to content

SDK: a null agent uuid in the create/update response becomes the string "None" #705

Description

@mocha06

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefect: incorrect or broken behavior vs documented contract

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions