build(docs): scaffold + document docs-search provisioning (search dead for all users) [DRAFT]#86
Draft
mangrove-one wants to merge 1 commit into
Draft
build(docs): scaffold + document docs-search provisioning (search dead for all users) [DRAFT]#86mangrove-one wants to merge 1 commit into
mangrove-one wants to merge 1 commit into
Conversation
…earch root cause (#85) The self-hosted docs site serves Mintlify's pre-built CLI client, whose search box has no backend: the public box forwards to ${API_ENDPOINT:-localhost:5000}/api/end-user-public/<subdomain>/search and the assistant to ${NEXT_PUBLIC_AI_MESSAGE_HOST}/api/end-user/search -- none of which the build provisions, so every query fails (HTTP 500 locally and in prod). This is what the tester saw as "Login into CLI to enable search" with no usable input. Declare API_ENDPOINT / NEXT_PUBLIC_AI_MESSAGE_HOST / NEXT_PUBLIC_TRIEVE_API_KEY in Dockerfile.docs with empty (no-op) defaults so deploy has an explicit override surface, and add findings/docs-search-provisioning.md documenting the exact routes, the live evidence, and the three resolution options. This does NOT enable search on its own -- that requires a product/infra decision (see #85). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF
The docs-site search box at
docs.mangrovedeveloper.aiis dead for everyone, signed in ornot — it has no search backend. The tester saw it as "Login into CLI to enable search" with
no usable input (older/local-CLI client); the current client shows a "Search…" box that
simply returns nothing. Root cause is architecture, not content: we self-host Mintlify's
pre-built client, but Mintlify search is a hosted feature (a cloud vector DB with the site's
content indexed into it) that the self-hosted build never provisions.
This PR makes the build side explicit and documents the decision; it is a draft because a
working fix requires choosing one of three provisioning paths (below), each needing a Mintlify
account/secret or a new self-hosted search service. It clears the draft once a chosen backend
is provisioned and a real query through
POST /_mintlify/api-public/search/<subdomain>returnsresults (i.e. the human picks an option in #85 and wires the backend + indexed content).
What's wrong (precise routes)
Reverse-engineering the pinned client (
mintlify@4.2.414) shows the two search surfaces and theunset backends they forward to:
POST /_mintlify/api-public/search/<subdomain>${API_ENDPOINT:-http://localhost:5000}/api/end-user-public/<subdomain>/searchAPI_ENDPOINT(+ optionalADMIN_TOKEN)POST /_mintlify/api/search${NEXT_PUBLIC_AI_MESSAGE_HOST}/api/end-user/searchNEXT_PUBLIC_AI_MESSAGE_HOST,NEXT_PUBLIC_TRIEVE_API_KEYThe self-hosted build sets none, so
API_ENDPOINTfalls back tohttp://localhost:5000(nothingthere) and every query fails. (The original bug report's "404" was a wrong-path probe of
/api/search; the real routes are above and they 500.)Change
Dockerfile.docs— declareAPI_ENDPOINT,NEXT_PUBLIC_AI_MESSAGE_HOST,NEXT_PUBLIC_TRIEVE_API_KEYwith empty (no-op) defaults. These are read at runtime bythe standalone server, so real values belong in MangroveAI's Cloud Run env/secret; declaring
them documents the contract and gives deploy an explicit override surface. Empty
API_ENDPOINTkeeps the built-in localhost fallback and Mintlify's env schema treats the empty
NEXT_PUBLIC_*as undefined → behavior is identical to today (no regression).
findings/docs-search-provisioning.md— exact root cause, live evidence, and the threeresolution options with the env each needs.
Resolution options (the decision this draft unblocks — see #85)
Cost: a Mintlify plan + DNS. Least code.
set the three env values at deploy time. Needs a Mintlify account/secret.
POST /api/end-user-public/<subdomain>/search(Trieve-shaped) and pointAPI_ENDPOINTat it,backed by a static index (Pagefind) or by Mangrove's existing free, no-auth
https://kb.mangrovedeveloper.ai/api/search. Most consistent with self-hosting; most code.Verification (real, throwaway containers — torn down after)
Built
mangrove-docs-fix:verifyfrom this branch'sDockerfile.docsand ran it.1. Container is healthy; search is the only dead part (default config):
This reproduces the bug through the real routes, and matches live prod:
2. The env lever works end-to-end — same real route,
API_ENDPOINTpointed at a stub backendon a shared docker network:
Honest scope: this proves the docs route forwards to whatever
API_ENDPOINTpoints at — i.e.the enablement lever is correct and wired. It does not prove real search results, because
that needs a real (Mintlify or self-hosted) backend with the docs content indexed — the product
decision in #85. Hence draft.
Refs #85 (not
Fixes: merging this scaffolding alone does not resolve search).