omi icon indicating copy to clipboard operation
omi copied to clipboard

manual-import: submit_memories posts to /v2/integrations/{app_id}/user/facts, which is not a backend route (404) — every import fails ($25 bounty proposed)

Open Suyann opened this issue 2 months ago • 0 comments

Symptom

plugins/import/manual-import (the "paste text → memories" importer) fails every submission: each extracted memory is POSTed and comes back ❌ ERROR: Status code 404, so nothing is ever imported.

Evidence

plugins/import/manual-import/app.py:20 builds

API_URL = f"https://api.omi.me/v2/integrations/{APP_ID}/user/facts"

with comments saying the API "still uses facts". It does not: backend/routers/integration.py registers POST /v2/integrations/{app_id}/user/memories and there is no /user/facts route anywhere in the backend.

Live check against production (a missing route 404s; a real route asks for the key):

$ curl -s -X POST -H 'Content-Type: application/json' -d '{"text":"t"}' \
    'https://api.omi.me/v2/integrations/testapp/user/facts?uid=u1'
{"detail":"Not Found"}                                   # HTTP 404

$ curl -s -X POST -H 'Content-Type: application/json' -d '{"text":"t"}' \
    'https://api.omi.me/v2/integrations/testapp/user/memories?uid=u1'
{"detail":"Missing or invalid Authorization header. Must be 'Bearer API_KEY'"}   # HTTP 401

The request body the app already sends ({"text": ..., "text_source": "other", "text_source_spec": "learning_notes"}) matches the v2 memories route's ExternalIntegrationCreateMemory model, so only the path is wrong.

Fix

Point API_URL at /v2/integrations/{app_id}/user/memories, drop the stale "facts" comments, and add a hermetic regression test (stubs flask/requests/openai/httpx, drives submit_memories() end to end, pins the route) registered in .github/checks-manifest.yaml. PR incoming.

Note: #13659 (uid encoding across linear/hive/manual-import) touches the same file on a different line (the requests.post call); the two changes are independent and merge cleanly in either order.

Bounty

Per the Contribution guide ("No bounties available? … suggest your own"), proposing a US$25 bounty for this fix + regression test. cc @josancamon19 @kodjima33

Investigated and fixed with Claude Code on behalf of @Suyann; every command above was actually run.

Suyann avatar Sep 17 '26 13:09 Suyann