fix(client): prefix all routes with /api/ — every SDK call was 404ing#2
Merged
Conversation
Backend mounts every router under the /api/* namespace (except the bare /health probe). Pre-fix the SDK was calling /memory/extract, /vault/v2/setup, etc. directly — every one of those returns HTTP 404 against the live api.kovamind.io. Patched 14 path strings: /memory/extract -> /api/memory/extract /memory/retrieve -> /api/memory/retrieve /memory/reinforce -> /api/memory/reinforce /memory/surprise -> /api/memory/surprise /memory/context -> /api/memory/context /vault/v2/setup -> /api/vault/v2/setup /vault/v2/unlock -> /api/vault/v2/unlock /vault/v2/lock -> /api/vault/v2/lock /vault/v2/credentials (POST) -> /api/vault/v2/credentials /vault/v2/credentials (GET) -> /api/vault/v2/credentials /vault/v2/handles -> /api/vault/v2/handles /vault/v2/find -> /api/vault/v2/find /vault/v2/execute -> /api/vault/v2/execute /vault/v2/recover -> /api/vault/v2/recover /health stays bare (intentional — backend exempts it from /api). Same systemic bug class as KovaMind/Kova-Mind PRs #612 + #614 (deploy webhook URL fix). The /api/* migration on the backend never propagated to the public SDKs. Verified live against staging on 2026-05-28: paths without /api return 404, paths with /api return 401 (auth) or 200 (with valid bearer token).
There was a problem hiding this comment.
Pull request overview
Fixes a production-down bug where every SDK call was returning HTTP 404 because the backend migrated all routers under /api/* (with /health exempt) but kovamind/client.py was still hitting the bare paths. The fix prepends /api/ to each affected route string and bumps the package version, leaving base_url semantics intact so self-hosters can keep overriding the host.
Changes:
- Prefix all memory and vault v2 route strings in
kovamind/client.pywith/api/, keeping/healthbare. - Bump project version from
0.5.1to0.5.2inpyproject.toml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| kovamind/client.py | Prepends /api/ to memory and vault v2 endpoints to match the backend's routing migration. |
| pyproject.toml | Patch-version bump to 0.5.2 for the bugfix release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
TL;DR
Every SDK call has been returning HTTP 404 for ~7 weeks. The backend migrated all routers to live under
/api/*(except the bare/healthprobe), butkovamind/client.pystill calls/memory/extract,/vault/v2/setup, etc. without the/apiprefix.Verified live against the staging backend on 2026-05-28:
POST https://api.kovamind.io/memory/extract-> HTTP 404POST https://api.kovamind.io/api/memory/extract-> HTTP 200 (or 401 if auth missing)This is the same systemic bug class as KovaMind/Kova-Mind PRs #612 + #614 (deploy webhook URL fix). The
/api/*migration on the backend never propagated to the public SDKs.Change
One file:
kovamind/client.py. 14 path strings get/api/prepended./healthstays bare. No behavior change beyond the URL fix.Plus a patch-version bump in
pyproject.toml.Why patch the path strings, not the base URL?
KovaMind(api_key=..., base_url="https://my-self-hosted.example.com")should still work for self-hosters. The base URL is the HOST; the/apiis a path namespace within the host. Self-hosters mirror our path layout, so prepending/apito each call keeps the override semantics clean.Tests
Existing tests at
tests/test_client.pymock HTTP at the requests-session level, so they pass without hitting a real server — and they didn't catch this bug. That's a separate followup (the tests should at minimum assert what URL the mock saw). For THIS PR I'm fixing the live bug, not refactoring tests.Verification plan post-merge
pip install kovamindin a fresh venv, run the README quickstart against a real km_live_/km_test_ key, expect non-404 resultsCloses the "SDK broken in production" gap surfaced during the 2026-05-28 cross-repo audit.