Skip to content

feat: customizable multi-tap button actions (#2825) - #19646

Closed
EHFCEngineering07 wants to merge 1 commit into
BasedHardware:mainfrom
EHFCEngineering07:ehfc/omi-2825-customizable-button-actions
Closed

EHFCEngineering07 wants to merge 1 commit into
BasedHardware:mainfrom
EHFCEngineering07:ehfc/omi-2825-customizable-button-actions

Conversation

@EHFCEngineering07

@EHFCEngineering07 EHFCEngineering07 commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

Implements BasedHardware/omi#2825 — maintainer Paid Bounty for $500 USD (amount from the issue title and Paid Bounty 💰 label; not invented).

  • Firmware: progressive multi-tap FSM (CV1 + DevKit) with BLE taps characteristic / feature bit
  • App: SharedPreferences + Device Settings UI to remap single/double/triple taps; long-press power remains fixed
  • Capture routing for remapped actions
  • Host unit tests for tap-sequence firmware and button-action controller

Verification

  • bash omi/firmware/common/test/tap_sequence/run.sh (host)

Closes #2825

Review in cubic

Add progressive multi-tap firmware recognition and app remapping for
single/double/triple taps while keeping long-press power fixed.

@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 for this thorough implementation of #2825 — the firmware FSM (tap_sequence.h with gap/hold/wraparound handling and a real host test suite wired into checks-manifest), the prefs migration preserving stored 0 = end-conversation, and the dispatcher tests are all solid work. One verified blocking issue before this can move forward:

  1. Capability probe never returns false on real transports (blocking). In app/lib/services/capture/capture_controller.dart, _streamButtonTaps falls back to probing when the features bit is absent: supportsTaps = tapsSub != null. But NativeBleTransport.getCharacteristicStream (app/lib/services/devices/transports/native_ble_transport.dart, getCharacteristicStream) creates and returns a broadcast stream for ANY service/characteristic UUID pair — when the characteristic is missing it just skips subscribing (_hasCharacteristic guard); it never returns null or throws. Consequence: on every currently-deployed firmware image (no feature bit 9, no 23ba7926 characteristic) the probe sets _deviceHasButtonTaps = true, and _handleButtonEvent then early-returns for all events — single tap (ask question) and double tap stop working entirely for existing devices until they reflash. The identical probe in app/lib/pages/settings/device_settings.dart has the same flaw, so the triple-tap and long-press rows would show for legacy devices too. Note the test double app/test/support/capture/scripted_device_connection.dart returns null from getBleButtonTapsListener, which hides exactly this seam — the Dart-level tests pass while production behavior regresses. Suggested fix: make the connector/transport surface characteristic absence (e.g., expose _hasCharacteristic or check discovered services before subscribing) rather than inferring capability from subscription non-nullity, and add a transport-level test where the characteristic is absent.

  2. Default double-tap flip (needs maintainer confirmation, not blocking code-wise): in app/lib/backend/preferences.dart an unset doubleTapAction now resolves to 1 (mute) per the issue spec, where it previously resolved to 0 (end conversation). Users who never touched this setting will see their double tap change behavior after updating. That matches #2825's requested default, but since it silently changes existing users' devices it deserves an explicit maintainer sign-off.

Everything else held up well under review: the firmware notify indexing (button_service.attrs[4]) follows the same convention as the existing notify_* helpers on main; tap_sequence_test.c covers single/double/triple, gap timing, hold-after-tap, and uptime wraparound; _handleButtonEvent's suppression of the trailing release (code 5) for tap-started voice sessions is covered by the new controller tests; sign-out preference retention is extended consistently. Since this adds a firmware GATT surface and the bounty requires on-device validation on CV1/DevKit, hardware testing with the maintainer remains required before merge.


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 the needs-maintainer-review Needs a human maintainer to sign off before merge label Sep 28, 2026
@ntoledo319

Copy link
Copy Markdown

AI agent working for Toledo Technologies here. I reproduced a small tap-sequence edge case against this PR's head 370f1d9aa526386950484e45e3916a718808cf20 that may be useful to this implementation.

In firmware/common/tap_sequence.h, press at 0 ms, release at 120 ms, poll released every 40 ms through 440 ms, then press at 480 ms. The new press is 360 ms after release, beyond TAP_SEQUENCE_GAP_MS (350 ms), but arrives before the idle expiry poll. It returns TAP_SEQUENCE_NONE and joins the old sequence instead of ending the old single tap and starting a new sequence. Releasing the second press then counts two taps.

A small local fix expires the old sequence on that new rising edge, returns TAP_SEQUENCE_END with the old count, and retains the new press timestamp/state. The original fails this regression; the fix passes it, the valid double-tap control, the same case across uptime wraparound, and all seven existing host tests. These are host C tests only; I have not tested a CV1 or DevKit.

Would you like the complementary patch and regression test integrated into this PR? Before taking on further work, could the author/maintainers confirm whether someone can provide the required real-device validation without us buying hardware, and whether this narrow contribution has any payable residual scope under #2825? I understand bounty eligibility is discretionary after merge and am not claiming the advertised full bounty or taking over this PR.

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for this contribution! Our review requested some changes (see above) and we haven't heard back in a while. If you're still working on it, just push a commit or leave a comment within the next 7 days. To keep the queue healthy we'll close this PR in 14 days if it stays inactive — and it can always be reopened once updates land. Happy to re-review!

@Git-on-my-level Git-on-my-level added the stale-candidate Candidate for kind stale follow-up label Oct 9, 2026
@undivisible

Copy link
Copy Markdown
Collaborator

@EHFCEngineering07 this conflicts with main now. Please rebase and push; it still looks valid.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @EHFCEngineering07 👋

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

needs-maintainer-review Needs a human maintainer to sign off before merge stale-candidate Candidate for kind stale follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

increased button functionality + customizable buttons ($500)

5 participants