Skip to content

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) #14384

Closed

Description

@Suyann

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions