Repository navigation
Conversation
The manual import app built its API_URL as
/v2/integrations/{app_id}/user/facts, a path the backend does not serve
(curl -X POST https://api.omi.me/v2/integrations/x/user/facts?uid=u -> 404
"Not Found"), so every extracted memory came back 404 and nothing was
imported. The Integration Import API (backend/routers/integration.py,
docs/doc/developer/apps/Import.mdx) creates memories at
POST /v2/integrations/{app_id}/user/memories?uid=, which answers 401 for a
missing key rather than 404. The request payload ({"text": ...}) already
matched that route, so only the path changes; stale "facts" comments are
updated alongside.
Adds a hermetic regression test that stubs flask/requests/openai/httpx and
drives submit_memories() end to end, pinning the route, and registers it in
the checks manifest.
Verification:
- PYTHONUTF8=1 python3 plugins/import/manual-import/test_submit_memories_route.py -> 3 tests passed
- same test against the previous app.py -> 2 FAIL (url .../user/facts)
Failure-Class: none
|
Verified against the backend — this fix is correct, and nicely done. What I checked:
Two maintainer notes (neither blocks this PR):
Fixes a real user-visible outage (every manual import failing with 404) and ships a regression test that exercises the real module rather than a copy. Solid first contribution — thank you! Feedback by Omi's AI maintainer assistant on behalf of David — flag disagreements, it learns. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Thanks for the thorough verification. Took the composio follow-up you flagged: #14385 fixes the same dead |
|
Hey @Suyann 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
What
The manual import app (
plugins/import/manual-import) now posts extracted memories to the Integration Import route the backend serves,POST /v2/integrations/{app_id}/user/memories?uid=, instead of/v2/integrations/{app_id}/user/facts, which is not a route and returns 404 in production. Fixes #14341.Why
backend/routers/integration.pyhas no/user/factshandler; memories are created at/user/memories. The app's comments claimed the API "still uses facts", so every memory in every import came back❌ ERROR: Status code 404and nothing was ever stored. Live proof (no key needed — a missing route 404s, a real route asks for the key):The backend's own public-contract test says it explicitly (
backend/tests/unit/test_integration_public_contract.py:27-29): "/v2/integrations/{app_id}/user/factsis intentionally absent: memories and facts are the same concept on the backend and are served by /user/memories (POST)."The request body the app already sends (
{"text": ..., "text_source": "other", "text_source_spec": "learning_notes"}) matches the v2 route'sExternalIntegrationCreateMemorymodel, so only the path changes.Changes
plugins/import/manual-import/app.py:API_URL→/v2/integrations/{app_id}/user/memories; the two stale "facts" comments are corrected. No behaviour change beyond the path.plugins/import/manual-import/test_submit_memories_route.py(new): hermetic regression test — stubsflask,requests,openai,httpx,dotenv, loads the realapp.py, drivessubmit_memories()end to end with rule-based extraction, and pins the outgoing URL, bearer header andtextpayload; also asserts a request withoutuidis rejected with 400 and makes no HTTP call..github/checks-manifest.yaml: registersmanual-import-memories-route-tests(local + ci lanes, triggered byplugins/import/manual-import/**).Relationship to #13659: that PR URL-encodes
uidin therequests.postcall of this same file; this PR changes only theAPI_URLconstant and comments above it. They merge cleanly in either order.Tests
Same test against the previous
app.pyfails as intended:Also run:
python3 plugins/oauth/test_client_log_safety.py(OK, 5 tests),git diff --check(clean). A full live import needs a real integration API key for the app, which I do not have; the route itself was exercised live with the curl calls above.Failure-Class
Failure-Class: none
(
scripts/failure-class preparelists no registry class for a client hard-coding a route the server does not serve.)Invariants
scripts/pr-preflight --suggestreports no affected product invariants for this diff (plugin-only change).Bounty
Claims the US$25 proposed in #14341; payout details will be sent to [email protected] after merge as the Contribution guide asks.
Authored with Claude Code on behalf of @Suyann; every command listed was actually run on this branch.