diff --git a/app/onyx_client.py b/app/onyx_client.py index 4ba5b88..356d7ed 100644 --- a/app/onyx_client.py +++ b/app/onyx_client.py @@ -133,10 +133,17 @@ class OnyxClient: # -- idempotent connector provisioning ----------------------------------- def find_cc_pair_id_by_name(self, name: str) -> int | None: """Look up an existing connector/credential pair by name so provisioning is - idempotent even if the local state (cached id) was lost.""" + idempotent even if the local state (cached id) was lost. + + Onyx 5.0 paginates this endpoint (10 connectors per source per page) and + defaults to page 1, so without ``get_all_connectors`` a connector beyond + the first page is invisible — the lookup would miss it and provisioning + would then fail with "duplicate naming not allowed". Request every + connector so the match is reliable regardless of how many exist.""" resp = self._request( "POST", "/manage/admin/connector/indexing-status", - json={"secondary_index": False}, auth=self._admin_auth, + json={"secondary_index": False, "get_all_connectors": True}, + auth=self._admin_auth, ) if resp.status_code >= 400: return None @@ -237,4 +244,4 @@ class OnyxClient: def _admin_auth(self) -> tuple[str, str] | None: if self._admin_email and self._admin_password: return (self._admin_email, self._admin_password) - return None + return None \ No newline at end of file