Skip to content

Fix docs search diagnostics and bump 0.8.6#62

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/docs-search-diagnostics-0.8.6
Jul 6, 2026
Merged

Fix docs search diagnostics and bump 0.8.6#62
ChiragAgg5k merged 1 commit into
mainfrom
fix/docs-search-diagnostics-0.8.6

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

  • sanitize whitespace from OPENAI_API_KEY before creating the OpenAI docs-search embedder
  • surface docs-search embedding failures with clearer diagnostics and error telemetry
  • bump package, server registry metadata, lockfile, and runtime server version to 0.8.6

Testing

  • uv run python -m unittest tests.unit.test_docs_search -v
  • uv run python -m unittest tests.unit.test_operator -v
  • uv run --group dev ruff check src tests
  • uv run --group dev black --check src tests
  • uv run --group dev pyright

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a latent bug where a whitespace-only or whitespace-padded OPENAI_API_KEY would be passed to the OpenAI client instead of being rejected early, and improves error surfacing when the embedding call inside _rank() fails. It also aligns SERVER_VERSION in constants.py (which was one patch behind at 0.8.4) with the bumped package version 0.8.6.

  • _default_embedder() now strips all whitespace from the key via "".join(api_key.split()) and then re-checks for an empty string, correctly handling keys that are purely whitespace.
  • DocsSearch.search() wraps self._rank() in a try/except, records telemetry with outcome="error", and re-raises as a descriptive RuntimeError chained to the original exception so the full traceback is preserved.
  • Version is bumped to 0.8.6 across pyproject.toml, server.json, constants.py, and uv.lock.

Confidence Score: 5/5

Safe to merge — the changes are small, targeted, and correct.

Both code changes in docs_search.py are well-guarded: the double-check pattern for api_key correctly handles None, "", and whitespace-only strings, and the try/except in search() preserves the original exception via chaining while adding useful diagnostics. All four version fields are now consistent at 0.8.6.

No files require special attention.

Important Files Changed

Filename Overview
src/mcp_server_appwrite/docs_search.py Adds whitespace sanitization for OPENAI_API_KEY and wraps _rank() in a try/except to surface embedding failures with clearer diagnostics and error telemetry.
src/mcp_server_appwrite/constants.py SERVER_VERSION bumped from 0.8.4 to 0.8.6 to match the package version (it was already one patch behind).
pyproject.toml Version bumped from 0.8.5 to 0.8.6.
server.json Version bumped from 0.8.5 to 0.8.6 in both the top-level field and the packages entry.
uv.lock Lockfile updated to reflect the 0.8.6 version bump.

Reviews (1): Last reviewed commit: "Fix docs search diagnostics and bump 0.8..." | Re-trigger Greptile

@ChiragAgg5k ChiragAgg5k merged commit 0b1b64b into main Jul 6, 2026
5 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/docs-search-diagnostics-0.8.6 branch July 6, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant