omi icon indicating copy to clipboard operation
omi copied to clipboard

composio: create_fact posts to /v2/integrations/{app_id}/user/facts, which is not a backend route (404) — Notion memory sync never lands ($25 bounty proposed)

Open Suyann opened this issue 2 months ago • 0 comments

Symptom

plugins/composio (the Notion → Omi memory sync) never stores a memory: every create_fact() call logs Error creating fact: HTTPError / Response status: 404 and returns False, so /api/omi/facts, /api/omi/facts/batch and the pending-memory processor all fail silently.

Evidence

plugins/composio/src/omi_api.py:61 builds

url = f"{API_BASE_URL}/{APP_ID}/user/facts?uid={user_id}"   # API_BASE_URL = https://api.omi.me/v2/integrations

backend/routers/integration.py registers POST /v2/integrations/{app_id}/user/memories and has no /user/facts handler; the backend's own contract test says so explicitly (backend/tests/unit/test_integration_public_contract.py:27-29): "/v2/integrations/{app_id}/user/facts is intentionally absent: memories and facts are the same concept on the backend and are served by /user/memories (POST)."

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 payload the plugin sends ({"text", "text_source", "text_source_spec"}) already matches the v2 route's ExternalIntegrationCreateMemory model, so only the path is wrong. This is the same defect as #14341 (manual-import); the maintainer review on #14343 pointed at this sibling occurrence.

Fix

Point the URL at /v2/integrations/{app_id}/user/memories and add a hermetic regression test (stubs fastapi/pydantic/requests/dotenv and the sibling .db module, loads the real omi_api.py, pins route/header/payload) registered in .github/checks-manifest.yaml. PR incoming.

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 19:09 Suyann