aido-onyx/branding/smb/smb-ui.patch
Naeem Dosh f3ab7f4cee SMB connector: fix stuck 'Initial Indexing', configurable name prefix + timeout
Four items from client feedback:

1. Stuck 'Initial Indexing' status. Root cause (by design in Onyx):
   docprocessing/utils.py never runs a classic index attempt for INGESTION_API
   connectors — documents are pushed via the API, not polled — so
   last_finished_status stays null and the badge is stuck even though the docs
   are indexed and searchable (also why it's safe: no risk of re-index deleting
   the pushed docs). Two-part fix:
   - Connector now sets each cc_pair ACTIVE after provisioning (set_cc_pair_active),
     which fixes the connector detail page + 'Active Connectors' count.
   - Frontend overlay (branding/smb/smb-ui.patch): the Ingestion table shows the
     real cc_pair_status for ingestion_api connectors instead of forcing
     'Initial Indexing'. Verified live: new cc_pair comes up ACTIVE.

2. Connector name now configurable: ONYX_CONNECTOR_NAME_PREFIX (default 'AIDO SMB').
3. HTTP timeout now configurable: ONYX_HTTP_TIMEOUT (default 60), for large embeds.
4. (Phase 2 already delivered in ab64692 — the preview/path overlay.)

Verified live against running Onyx: provisioning sets ACTIVE, custom prefix
'Livtec Docs - Sales' applied, timeout honoured, ä-filename still indexed. Full
overlay apply green, no conflict markers, connector modules parse.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-10 23:14:28 +05:00

52 lines
2.4 KiB
Diff

diff --git a/web/src/app/admin/indexing/status/CCPairIndexingStatusTable.tsx b/web/src/app/admin/indexing/status/CCPairIndexingStatusTable.tsx
index 39061740..04cf8794 100644
--- a/web/src/app/admin/indexing/status/CCPairIndexingStatusTable.tsx
+++ b/web/src/app/admin/indexing/status/CCPairIndexingStatusTable.tsx
@@ -175,7 +175,13 @@ function ConnectorRow({
<TableCell>
<CCPairStatus
ccPairStatus={
- ccPairsIndexingStatus.last_finished_status !== null
+ // AIDO: ingestion-API connectors (e.g. the SMB sync) are never run
+ // through Onyx's classic indexer — documents are pushed via the API —
+ // so last_finished_status stays null and the badge would otherwise be
+ // stuck on "Initial Indexing" even though the docs are indexed. Show
+ // the real connector status for them instead.
+ ccPairsIndexingStatus.last_finished_status !== null ||
+ ccPairsIndexingStatus.source === ValidSources.IngestionApi
? ccPairsIndexingStatus.cc_pair_status
: ccPairsIndexingStatus.last_status == "not_started"
? ConnectorCredentialPairStatus.SCHEDULED
diff --git a/web/src/lib/search/utils.ts b/web/src/lib/search/utils.ts
index bdb98931..14aa85eb 100644
--- a/web/src/lib/search/utils.ts
+++ b/web/src/lib/search/utils.ts
@@ -6,6 +6,7 @@ import {
SourceMetadata,
} from "./interfaces";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
+import { toast } from "@opal/layouts";
export const buildFilters = (
sources: SourceMetadata[],
@@ -32,6 +33,20 @@ export const openDocument = (
document: OnyxDocument,
updatePresentingDocument?: (document: MinimalOnyxDocument) => void
) => {
+ // AIDO: documents synced from SMB/network shares (ingestion API) have no
+ // browsable link and no stored file to preview — a normal preview click would
+ // just fail. Instead, surface the logical path by copying it to the clipboard
+ // so the user can open the file directly on the share.
+ if (document.source_type === ValidSources.IngestionApi) {
+ const path = document.semantic_identifier || document.document_id;
+ if (path) {
+ void navigator.clipboard
+ ?.writeText(path)
+ .then(() => toast.success(path))
+ .catch(() => undefined);
+ }
+ return;
+ }
if (document.link) {
window.open(document.link, "_blank");
} else if (