fix(cli): keep every result in entity delete, not just the last (#5936)

This commit is contained in:
Abhay Singh
2026-06-29 14:58:16 +05:30
committed by GitHub
parent ee0c38e081
commit ad57cbb8d6
2 changed files with 52 additions and 4 deletions
+6 -4
View File
@@ -296,13 +296,15 @@ class PlatformBackend(Backend):
entities = {t: v for t, v in type_map.items() if v}
if not entities:
raise ValueError("At least one entity ID is required for delete_entities.")
# Delete each provided entity via the v2 path-based endpoint
result: dict = {}
# Delete each provided entity via the v2 path-based endpoint. Key each
# response by entity type so a multi-entity delete (e.g. --user-id and
# --agent-id together) doesn't discard everything but the last result.
results: dict = {}
for entity_type, entity_id in entities.items():
result = self._request(
results[entity_type] = self._request(
"DELETE", f"/v2/entities/{entity_type}/{entity_id}/", params={"source": "CLI"}
)
return result
return results
def ping(self, timeout: float | None = None) -> dict:
"""Call the ping endpoint and return the raw response.