Repository navigation
Conversation
create_fact in plugins/composio/src/omi_api.py built its 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"; backend/tests/unit/test_integration_public_contract.py:27-29
says /user/facts is "intentionally absent"). Every Notion/Composio memory
the plugin tried to sync therefore came back 404 and was logged as an
error. The Integration Import API creates memories at
POST /v2/integrations/{app_id}/user/memories?uid=; the request payload
({"text", "text_source", "text_source_spec"}) already matched that route,
so only the path changes. Same defect class as BasedHardware#14343 (manual-import),
flagged there by the maintainer review.
Adds a hermetic regression test that stubs fastapi/pydantic/requests/dotenv
and the sibling .db module, loads the real omi_api.py, and pins the route,
bearer header and payload; registers it in the checks manifest.
Verification:
- PYTHONUTF8=1 python3 plugins/composio/test_omi_api_route.py -> 3 tests passed
- same test against the previous omi_api.py -> 2 FAIL (url .../user/facts)
Failure-Class: none
|
Verified against the backend and the new tests — the core claim checks out, and I ran the hermetic suite locally (3/3 pass).
One residual follow-up worth a follow-up commit (non-blocking for this fix): the backend enum Thanks for the clean, well-evidenced fix. Leaving the final merge call to the maintainers since this changes a production integration import path. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
The backend enum ExternalIntegrationMemorySource accepts email | social_post |
other and rejects anything else with 422. process_pending_memories forwards the
DB source ("notion_page", stored by notion.py) and /api/omi/facts forwards the
client's free-form text_source, so those callers still failed after the route
fix. create_fact now clamps a non-enum source to "other" and keeps the original
value in text_source_spec (same provenance pattern store_fact already used), so
every caller sends a payload the server accepts. The happy-path test now asserts
a payload the backend accepts ("other"), plus two new cases for the clamp and
the enum pass-through.
Verification:
- PYTHONUTF8=1 python3 plugins/composio/test_omi_api_route.py -> 5 tests passed
- the clamp test fails against the previous commit (text_source "notion_page")
Failure-Class: none
|
Took both follow-ups in a second commit: |
kodjima33
left a comment
There was a problem hiding this comment.
Confidence gate 5/5: real bug (backend serves /v2/integrations/{app_id}/user/memories, not /user/facts -- confirmed via backend/routers/integration.py and the backend's own public-contract test), root cause clear, hermetic regression test added, confirmed not already fixed on main. mergeStateStatus is DIRTY -- per standing policy I do not rebase/force-push PR branches, so holding at approve only. Needs manual rebase before merge.
… in a stable section Moves the checks-manifest.yaml entry out of the tail of the checks list, where several concurrent PRs insert at the same spot and every merge conflicts, into the stable section after desktop-backend-drift-fixtures. No behaviour change; the check still runs in both lanes with the same triggers.
|
Resolved the merge conflict: the only conflicting file was .github/checks-manifest.yaml (several PRs append at the same spot before exempt:). The entry is now registered in a stable section of the checks list (after desktop-backend-drift-fixtures) with the same command, triggers and lanes; no code change. The branch merges cleanly against current main (git merge-tree), the regression test passes, and pr-preflight passes locally. |
|
Follow-up verification on the updated head (1d69153): both items from the earlier automated review are resolved, and the post-approval commit checks out.
Maintainer note: #14507 opens the same fix on the same files ~10h later; this PR is the original and the further-along one (it also carries the source-clamp follow-up). No open concerns from automated review — the remaining step is the maintainer merge decision. by AI on behalf of David |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed real 404 route-mismatch bug (composio posting to retired /user/facts), hermetic test, live curl proof, 5/5.
|
Closing: #14507 landed on main first and carries both parts of this PR (the /user/memories route and the normalisation of non-enum text_source values), so there is nothing left to merge here. Thanks for the reviews. |
|
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
create_fact()in the Composio/Notion sync plugin now posts 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 #14384. Follow-up to #14343, where the maintainer review flagged this sibling occurrence.Why
backend/routers/integration.pyhas no/user/factshandler; memories are created at/user/memories. 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)." Every memory the plugin tried to sync therefore came back404(logged asError creating fact: HTTPError,Response status: 404) andcreate_factreturnedFalse, so/api/omi/facts,/api/omi/facts/batchandprocess_pending_memoriesall failed silently. Live proof (no key needed — a missing route 404s, a real route asks for the key):The payload the plugin already sends (
{"text", "text_source", "text_source_spec"}) matches the v2 route'sExternalIntegrationCreateMemorymodel, so only the path changes.Changes
plugins/composio/src/omi_api.py: URL/user/facts→/user/memories(comment explains why). No other behaviour is touched; the plugin's own/api/omi/factsendpoints keep their names.plugins/composio/test_omi_api_route.py(new): hermetic regression test — stubsfastapi,pydantic,requests,dotenvand the sibling.dbmodule, loads the realomi_api.pyas a package submodule (so the relative import works), and pins the full URL with?uid=, the bearer header and thetext/text_source/text_source_specpayload; also asserts the retired/user/factspath is never used and that missing credentials raiseValueErrorwithout making a request..github/checks-manifest.yaml: registerscomposio-omi-memories-route-tests(local + ci lanes, triggered byplugins/composio/**).Relationship to open #13304 (
fix(composio): preserve first-person Notion memories): that PR touchessrc/notion.py, the README and its own test files, notsrc/omi_api.py; the only shared touch point is the adjacent manifest insertion beforeexempt:, a trivial textual conflict if it lands first.Follow-up commit (from the review on this PR)
create_fact()now clamps asourceoutside the backend enum (email | social_post | other,backend/models/integrations.py:27) to"other"and keeps the original value intext_source_spec(e.g."notion_page:notion"), the same provenance patternstore_factalready used. Without this,process_pending_memories(DB source"notion_page") and free-form/api/omi/factscallers would still 422 after the route fix. The happy-path test now asserts a payload the backend accepts, and two new cases cover the clamp and the enum pass-through.Tests
Same test against the previous
omi_api.pyfails as intended:Also run:
python3 plugins/oauth/test_client_log_safety.py(OK, 5 tests),git diff --check(clean),bash scripts/pr-preflight --pr-body-file <this body>(see below). A full live sync needs a real integration API key for the composio 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 — same conclusion as #14342/#14343.)Invariants
scripts/pr-preflight --suggestreports no affected product invariants for this diff (plugin-only change).Bounty
Claims the US$25 proposed in #14384; 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.