Skip to content

fix(composio): post memories to integration route - #14507

Merged
kodjima33 merged 5 commits into
BasedHardware:mainfrom
cuentapraces07-ops:bounty-14384-composio-memory
Sep 19, 2026
Merged

kodjima33 merged 5 commits into
BasedHardware:mainfrom
cuentapraces07-ops:bounty-14384-composio-memory

Conversation

@cuentapraces07-ops

@cuentapraces07-ops cuentapraces07-ops commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Corrects the Composio integration URL from the nonexistent /user/facts route to the documented /user/memories route.
  • Leaves the existing payload, authorization header, and public /api/omi/facts compatibility endpoints unchanged.
  • Adds a hermetic regression test that loads the real create_fact() function with framework/database seams stubbed and asserts the exact URL, query string, header, and JSON payload.
  • Registers the suite in .github/checks-manifest.yaml for local and CI lanes.

Verification

  • python plugins/composio/test_omi_api_route.py — 1 test passed.
  • python -m py_compile plugins/composio/src/omi_api.py plugins/composio/test_omi_api_route.py — passed.
  • git diff --check — clean.
  • python .github/scripts/run_checks.py --lane local --base origin/main --head HEAD --check-id composio-memory-route-tests --check-id check-manifest-contract — both selected checks passed (1 route test; 53 manifest-contract tests, 3 expected skips).

No credentials, network calls, or provider services are used by the regression test. AI assistance was used and the implementation was reviewed locally against #14384.

Fixes #14384. The issue proposes a US$25 bounty; reward eligibility and payment remain subject to maintainer review, acceptance, and merge.

Failure-Class: none

Review in cubic

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the core diagnosis and it is correct: backend/routers/integration.py registers POST /v2/integrations/{app_id}/user/memories and the backend's own contract test (backend/tests/unit/test_integration_public_contract.py:27-29) documents that /user/facts is intentionally absent, so the URL change in plugins/composio/src/omi_api.py is the right one-line fix. I ran the new hermetic suite locally: 1/1 pass, no network or credentials needed — good test design.

Requesting changes because, as written, the PR only half-fixes #14384 — the plugin's primary Notion ingestion path still never lands:

  • plugins/composio/src/notion.py:396 stores pending memories with source="notion_page".
  • process_pending_memories in plugins/composio/src/omi_api.py forwards that value (source=memory["source"] or "other").
  • The backend's ExternalIntegrationCreateMemory.text_source is a strict enum (email | social_post | other, backend/models/integrations.py:27), so those requests now return 422 instead of 404 — sync still fails silently. Free-form text_source values on POST /api/omi/facts hit the same 422.
  • The fix is to clamp non-enum sources to "other" and carry the original value in text_source_spec — the same provenance pattern the plugin's own store_fact already uses (source="other", source_spec="notion:<id>"). Please also extend plugins/composio/test_omi_api_route.py with a case for it; right now it pins only the happy path.

File notes: plugins/composio/src/omi_api.py — change and comment accurate, only the enum gap above. plugins/composio/test_omi_api_route.py — solid hermetic approach (framework/db seams stubbed, real module loaded); would benefit from the retired-route-never-used and missing-credentials cases. .github/checks-manifest.yaml — entry well-formed, mid-file insertion with both lanes; Hygiene passed. The two failing Desktop Swift jobs are runner network failures cloning firebase-ios-sdk (logs show Failed to connect to github.com port 443), unrelated to this Python-only diff.

One coordination note for the maintainers: #14385 (by the #14384 author, opened earlier) fixes the same bug and already includes this source clamp plus a broader test suite, so someone should adjudicate which PR lands and how credit for the bounty is handled. Leaving that decision to the maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge python labels Sep 18, 2026
@cuentapraces07-ops
cuentapraces07-ops force-pushed the bounty-14384-composio-memory branch from d444cc9 to 0611701 Compare September 18, 2026 12:49

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root fix is correct (confirmed /user/facts is not a registered route) but reviewer found it only half-fixes #14384 — Notion-sourced memories still 422 on the backend's strict text_source enum. A more complete duplicate, #14385, already covers the enum-clamp case. DIRTY (needs manual rebase, not done here). Approve only; let maintainer adjudicate #14507 vs #14385.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real bug: composio integration posted to nonexistent /user/facts route (still broken on main; open dup #14385 not yet merged). Fix corrects to /user/memories, adds regression test, scoped diff, CI green.

@kodjima33
kodjima33 merged commit 23bb72b into BasedHardware:main Sep 19, 2026
32 checks passed
@cuentapraces07-ops

Copy link
Copy Markdown
Contributor Author

Follow-up after the merge: the linked bounty issue proposed US$25, but the PR states that eligibility and payment remain subject to maintainer review. Could a maintainer confirm whether a reward was approved for this PR, the final amount, and the official private payout channel or instructions? I will not post any wallet or financial details publicly. Thank you.

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

Labels

needs-maintainer-review Needs a human maintainer to sign off before merge python

Projects

None yet

3 participants