Repository navigation
fix(hume-ai): post emotion memories to the v2 integration import route - #14342
Conversation
|
Verified end to end against the backend sources:
One non-blocking deployment note: the v2 route enforces app capability (app_can_create_memories) and per-user app enablement, so a quick smoke test with the real hume app credentials would confirm memories now land as 200 rather than surfacing a 403 config gap. Thanks @Suyann — excellent first contribution: live reproduction of the 404, a minimal targeted fix, and a regression test that pins the contract. AI-generated maintainer feedback on behalf of the Omi maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed /v1/integrations/{app_id}/memories (retired, 404) still used on main; v2 route fix is correct and well-tested with live curl proof. Approve only -- PR is DIRTY (merge conflict), never rebasing branches myself.
create_omi_memory targeted POST /v1/integrations/{app_id}/memories, a path
the backend never serves (curl -X POST https://api.omi.me/v1/integrations/x/memories?uid=u
-> 404 "Not Found"). The Integration Import API (backend/routers/integration.py,
docs/doc/developer/apps/Import.mdx) is POST /v2/integrations/{app_id}/user/memories?uid=,
which answers 401 for a missing key rather than 404. Every emotion memory the
plugin tried to save was therefore rejected and only surfaced as a logged error.
Adds a hermetic regression test that stubs the Hume SDK and httpx and pins the
route, header and payload, plus its checks-manifest registration.
Verification:
- PYTHONUTF8=1 python3 plugins/hume-ai/test_create_omi_memory_route.py -> 3 tests passed
- same test against the previous app.py -> 2 FAIL (url .../v1/integrations/app123/memories)
Failure-Class: none
0ef42c0 to
c95a2da
Compare
|
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. |
|
Verified the rebase — no code change, ready for a quick re-approval:
Thanks again @Suyann — the conflict resolution was exactly the right scope (move the entry, touch nothing else). by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed retired /v1/integrations/.../memories route (404) still on main, correct v2 fix, hermetic test, 5/5.
What
create_omi_memory()in the Hume emotion plugin now posts to the Integration Import route the backend actually serves,POST /v2/integrations/{app_id}/user/memories?uid=, instead of/v1/integrations/{app_id}/memories, which returns 404 in production. Fixes #14340.Why
backend/routers/integration.pyregisters only the v2 import routes; there has never been a/v1/integrations/{app_id}/memorieshandler. Every emotion memory the plugin tried to save was rejected with404 {"detail":"Not Found"}and only surfaced as a✗ Omi API errorlog line, so the feature silently did nothing. Live proof (no key needed — a missing route 404s, a real route asks for the key):The backend's own public-contract test says the same:
backend/tests/unit/test_integration_public_contract.pyenumerates every integration route inEXPECTED_OPERATIONSand contains no/v1/integrations/...entry.The payload the plugin sends (
text,timestamp,emotions) is accepted by the v2 route (ExternalIntegrationCreateMemoryrequirestextormemories; extra keys are ignored), so only the path changes.Changes
plugins/hume-ai/app.py: route/v1/integrations/{app_id}/memories→/v2/integrations/{app_id}/user/memories(comment explains why).plugins/hume-ai/test_create_omi_memory_route.py(new): hermetic regression test — stubs the Hume SDK modules andhttpx.AsyncClient, calls the realcreate_omi_memory(), and pins the route,Authorizationheader andtextpayload; also asserts the retired/v1/path is never used and that missing config short-circuits without a request..github/checks-manifest.yaml: registershume-ai-create-memory-route-tests(local + ci lanes, triggered byplugins/hume-ai/**).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). The live user-facing path (a real Hume-detected emotion → memory in an Omi account) needs a Hume key and an enabled app with an integration API key, 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; the advisory candidates it surfaced — nonexecuting-verification-command, runtime-image-boundary, secret-printed-to-plugin-logs — do not apply.)Invariants
scripts/pr-preflight --suggestreports no affected product invariants for this diff (plugin-only change).Bounty
Claims the US$25 proposed in #14340; 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.