Skip to content

test(backend): pass a request to enable_app_endpoint - #15194

Closed
singhharsh1708 wants to merge 2 commits into
BasedHardware:mainfrom
singhharsh1708:fix/backend-enable-app-endpoint-test
Closed

singhharsh1708 wants to merge 2 commits into
BasedHardware:mainfrom
singhharsh1708:fix/backend-enable-app-endpoint-test

Conversation

@singhharsh1708

@singhharsh1708 singhharsh1708 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #15195.

tests/unit/test_setup_completed_url_uid_query.py fails on main, which reds every backend shard:

TypeError: enable_app_endpoint() missing 1 required positional argument: 'request'

#15099 gave enable_app_endpoint a request: Request parameter for record_product_event, and this suite calls the endpoint directly rather than through the app, so its two apps-enable cases stopped constructing a valid call. The oauth-token half of the same parametrization still passes, which is why the failure reads as a partial one.

The call now passes a request. record_product_event only reads headers off it, through extract_client_kind and extract_app_build, and the whole body is wrapped so telemetry cannot fail a request, so SimpleNamespace(headers={}) is enough and keeps the test at its existing level of abstraction: this suite is about the uid query parameter appended to setup_completed_url, not about metrics.

$ cd backend && BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh
4 passed, 8 warnings in 1.55s

Failure-Class: none

BasedHardware#15099 gave the endpoint a request parameter for record_product_event; this suite calls it directly, so both apps-enable cases died with a TypeError and took every backend shard red on main.
@singhharsh1708
singhharsh1708 force-pushed the fix/backend-enable-app-endpoint-test branch from 731dc75 to 165ff03 Compare September 20, 2026 17:23
@singhharsh1708

Copy link
Copy Markdown
Contributor Author

Pushed a second commit: test_app_enable_install_count.py calls enable_app_endpoint the same way and fails for the same reason, so it is fixed here too.

Both files fail on current main. On fdcae0a, with no changes:

FAILED tests/unit/test_app_enable_install_count.py::test_enabling_an_installed_app_again_counts_one_install - TypeError: enable_app_endpoint() missing 1 required positional argument: 'request'
FAILED tests/unit/test_app_enable_install_count.py::test_each_new_user_still_counts_an_install

On this branch both files pass, 3 and 4 tests, exit 0.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified — thanks for the quick fix and the precise diagnosis.

What I checked against the head (165ff03):

The SimpleNamespace(headers={}) substitution is sound: record_product_event in backend/utils/product_metrics.py is best-effort (fully exception-wrapped, so telemetry cannot fail the request), and extract_client_kind/extract_app_build only read headers with their own error handling — a bare headers mapping exercises everything the endpoint can do with the request. I also confirmed there are no other direct-call sites: these two test files plus the router itself are the only references to enable_app_endpoint in the repo, so the fix is complete.

Backend unit suite, hermetic merge gate, unit shards, Hygiene, and Formatting are all green on this head. Bounty adjudication for #15195 stays with the maintainers and is unaffected by this review.

🤖 Automated review on behalf of 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 positive-signal Automation verified a genuine fix/quality contribution backend Backend Task (python) labels Sep 20, 2026

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

Genuine fix for a self-caused test failure (enable_app_endpoint now requires a Request param since #15099); scoped, well-tested. Approving only, not merging: PR Metadata Preflight is currently failing with a real merge conflict against origin/main in both touched test files (backend/tests/unit/test_app_enable_install_count.py and test_setup_completed_url_uid_query.py), confirmed via reran CI, not a stale run. Needs a rebase, which I won't do.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing as tests-only of FIXED_OPEN. enable_app_endpoint already takes request: Request on origin/main a979f6239c.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @singhharsh1708 👋

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:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

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!

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

Labels

backend Backend Task (python) positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty proposal] main is red: enable_app_endpoint test misses the new request argument ($50 proposed)

4 participants