LearnNewsExamplesServices
Frontmatter
id14424
titleCentralize KB remote deployment detection for guidance and ingest gates
stateClosed
labels
enhancementairefactoring
assigneesneo-gpt
createdAtJul 2, 2026, 5:14 AM
updatedAtJul 3, 2026, 12:53 AM
githubUrlhttps://github.com/neomjs/neo/issues/14424
authorneo-gpt
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 3, 2026, 12:53 AM

Centralize KB remote deployment detection for guidance and ingest gates

Closed v13.1.0/archive-v13-1-0-chunk-8 enhancementairefactoring
neo-gpt
neo-gpt commented on Jul 2, 2026, 5:14 AM

Context

PR #14411 made the Knowledge Base empty-collection guidance cloud-aware for #14410. During cross-family review, @neo-opus-grace flagged a non-blocking follow-up: the remote deployment predicate now exists in two places and will drift as cloud transport surfaces grow.

Live evidence gathered before filing at 2026-07-02T03:13:32Z:

  • ai/services/knowledge-base/SearchService.mjs:164-167 chooses the remote empty-collection answer with aiConfig.transport === "sse".
  • ai/mcp/server/knowledge-base/ingestSourceFilesTool.mjs:19-29 defines isRemoteIngestTransport() with the same aiConfig.transport === "sse" predicate for the remote ingest tool visibility and fail-closed gate.
  • Open issue sweep found #14410 as the shipped parent but no open ticket for centralizing this predicate.
  • Knowledge Base ticket sweep found older adjacent transport/stale-handle work, but no duplicate for isRemoteIngestTransport / getEmptyCollectionAnswer predicate consolidation.
  • A2A in-flight sweep showed the #14411 review follow-up message and no competing lane claim.

Problem

The current cloud/local distinction is duplicated as a literal SSE transport check. Today that is small, but the duplicated predicate is the wrong contract boundary: KB empty guidance and remote ingest exposure both depend on whether the current deployment is remote/tenant-push capable, not on each callsite owning its own interpretation of transport.

If another remote transport spelling or cloud profile is added later, one side can update while the other remains stale. That would either show local remediation guidance in a remote deployment, or expose/gate the ingest facade inconsistently.

Intended Shape

Centralize the predicate behind a single clearly named helper such as isRemoteDeployment() or an equivalent existing-owner helper. Reuse or rename the current isRemoteIngestTransport() boundary if that is the best local ownership fit; do not add a new module unless structural pre-flight validates the owner.

The helper should express the semantic contract: remote/cloud tenant-ingestion profile, currently implemented as transport === "sse". Callers should not duplicate the literal transport check.

Acceptance Criteria

  • SearchService.getEmptyCollectionAnswer() and the KB ingest_source_files visibility/fail-closed gate use one shared remote-deployment predicate.
  • The behavior from #14411 remains unchanged: local stdio deployments get local corpus guidance; remote SSE deployments get ingestion-state guidance.
  • The ingest_source_files tool remains hidden and fail-closed for local stdio clients.
  • Focused unit coverage proves local stdio and remote SSE behavior for both consumers or through their existing public seams.
  • JSDoc / @summary wording makes the helper contract semantic rather than a bare transport spelling.

Out of Scope

  • Changing the supported transport matrix.
  • Adding tenant ingestion features.
  • Reworking global AiConfig ownership.

Related

Retrieval hint: KB empty collection remote deployment predicate; getEmptyCollectionAnswer; isRemoteIngestTransport; ingest_source_files; aiConfig.transport === "sse".

tobiu referenced in commit bb60e0c - "refactor(kb): centralize remote deployment predicate (#14424) (#14494)" on Jul 3, 2026, 12:53 AM
tobiu closed this issue on Jul 3, 2026, 12:53 AM