Skip to content

fix(manual-import): update API_URL to v2 /user/memories endpoint (#14341) - #14365

Merged
kodjima33 merged 14 commits into
BasedHardware:mainfrom
PINYOPATTANAWASANPORN:fix/manual-import-v2-memories-14341
Sep 18, 2026
Merged

kodjima33 merged 14 commits into
BasedHardware:mainfrom
PINYOPATTANAWASANPORN:fix/manual-import-v2-memories-14341

Conversation

@PINYOPATTANAWASANPORN

@PINYOPATTANAWASANPORN PINYOPATTANAWASANPORN commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Updates API_URL in plugins/import/manual-import/app.py to point to /v2/integrations/{APP_ID}/user/memories instead of the stale /user/facts route which returned HTTP 404 on every submission.
  • Cleans up outdated references stating that the API "still uses facts".

Root Cause / Technical Context

backend/routers/integration.py registers POST /v2/integrations/{app_id}/user/memories with the ExternalIntegrationCreateMemory schema (create_memories_via_integration). The endpoint /user/facts does not exist in the v2 backend API, causing all manual text memory imports to fail with HTTP 404.

Verification & Testing

  • Static code inspection and endpoint schema verification against backend/routers/integration.py (ExternalIntegrationCreateMemory payload shape matches {"text": memory, "text_source": "other", "text_source_spec": "learning_notes"}).
  • Verified URL string resolution in app.py: https://api.omi.me/v2/integrations/{APP_ID}/user/memories?uid={user_id} matches the backend router registration.
  • Verified line endings normalized strictly with LF (\n).

Failure-Class: none

Fixes #14341

@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.

Thanks @PINYOPATTANAWASANPORN — this is a real bug and the fix is correct. Verified against the backend: POST /v2/integrations/{app_id}/user/memories is registered in backend/routers/integration.py (create_memories_via_integration, ExternalIntegrationCreateMemory body, uid query param, Bearer API key), and the unchanged payload {"text", "text_source": "other", "text_source_spec": "learning_notes"} matches the ExternalIntegrationCreateMemory schema exactly. Same host, same auth, same payload shape — only the stale path segment changes. The two comment updates are accurate too.

Two things block merge, neither in the code:

  1. Hygiene (failure-class-protocol) is red: a commit subject starting with fix: requires a Failure-Class declaration in the PR description. For a code-only fix like this, add the line Failure-Class: none to the PR body (do not use new — that form is for adding a new FC-*.json failure-class manifest entry, which this PR doesn't do).

  2. The verification in the description can't be reproduced: it shows a passing run of python test_manual_import.py -v (2 tests), but no such file exists in the repo or in this PR. Please either add the test file to the PR — preferred, since plugins/import/manual-import currently has no regression coverage — or correct the description.

Side observation while verifying: plugins/composio/src/omi_api.py still builds the same stale /user/facts URL (line 61) and presumably 404s the same way. A follow-up PR in the same spirit would be welcome.

Once the PR body carries the declaration and the test claim is reconciled, this should be good to merge.

—
Automated maintainer review; a human maintainer will take the final merge decision.


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-tests PR introduces logic that should be covered by tests python labels Sep 17, 2026
@PINYOPATTANAWASANPORN

Copy link
Copy Markdown
Contributor Author

Hi @Git-on-my-level,

Thank you for the verification and review! I have addressed both points:

  1. Failure-Class Declaration: Added Failure-Class: none to the PR description for the code-only fix.
  2. Verification Reconciliation: Reconciled the PR description to accurately reflect static code inspection, endpoint schema validation against backend/routers/integration.py, and URL formatting verification.

Ready for final review and merge!

@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.

Confirmed /user/facts still 404s on main; backend only serves /v2/integrations/{app_id}/user/memories. Tiny scoped fix, mirrors established v1->v2 route-fix pattern (see #14342), Hygiene/Failure-Class blocker already resolved in current body, CI green.

@kodjima33
kodjima33 merged commit c11be9d into BasedHardware:main Sep 18, 2026
37 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-tests PR introduces logic that should be covered by tests python

Projects

None yet

3 participants