Skip to content

fix: restore notification API backwards compatibility - #4747

Merged
mdmohsin7 merged 2 commits into
mainfrom
fix/notification-api-backwards-compat
Feb 11, 2026
Merged

mdmohsin7 merged 2 commits into
mainfrom
fix/notification-api-backwards-compat

Conversation

@mdmohsin7

Copy link
Copy Markdown
Member

Summary

  • PR allow chat tools to send messages #4605 broke existing apps by requiring chat_messages.enabled in manifest — apps without it got a 403 error instead of sending the notification
  • Restores original behavior: push notification is always sent regardless of manifest config
  • chat_messages manifest config now only controls whether the message is additionally stored in chat (main or app chat based on target)
  • send_app_notification now respects target parameter for navigate_to deep link — apps using target: "main" navigate to /chat/omi instead of /chat/{app_id}

Test plan

  • Existing apps without chat_messages in manifest can still send notifications (no 403)
  • Apps with chat_messages.enabled: true, target: "main" store message in main chat and notification navigates to main chat
  • Apps with chat_messages.enabled: true, target: "app" store message in app chat and notification navigates to app chat
  • Apps without chat_messages in manifest only send notification, no message stored in chat

🤖 Generated with Claude Code

mdmohsin7 and others added 2 commits February 11, 2026 18:24
PR #4605 broke existing apps by requiring chat_messages.enabled in
manifest and gating the push notification behind chat_messages.notify.
Apps without chat_messages in their manifest got a 403 error.

Restore original behavior: always send push notification. The
chat_messages manifest config now only controls whether the message
is additionally stored in chat.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
send_app_notification now accepts a target parameter so apps using
target='main' navigate to /chat/omi (main chat) instead of always
navigating to /chat/{app_id}. Default is 'app' so existing callers
are unaffected.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@mdmohsin7
mdmohsin7 merged commit 7a198a8 into main Feb 11, 2026
1 check passed
@mdmohsin7
mdmohsin7 deleted the fix/notification-api-backwards-compat branch February 11, 2026 12:56

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request aims to restore backwards compatibility for the notification API, which was broken in a previous change. The fix correctly ensures that notifications are always sent, regardless of the chat_messages manifest configuration, and that this configuration only controls whether the message is also stored in chat. The change to send_app_notification to respect the target parameter for deep links is also a good improvement. However, I've found a critical issue where the target parameter is not being passed correctly, which would cause incorrect navigation for notifications. I've provided a suggestion to fix this.

Comment on lines +142 to +149
# Always send push notification
send_app_notification(uid, app.name, app.id, data['message'])

# If app has chat_messages enabled in manifest, also store the message in chat
if app.external_integration and app.external_integration.chat_messages_enabled:
target = app.external_integration.chat_messages_target
chat_app_id = None if target == 'main' else app.id
add_app_message(data['message'], chat_app_id, uid)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The send_app_notification function is called without the target parameter. This means it will always use the default value 'app', causing the notification's navigate_to deep link to be incorrect for apps that configure target: 'main' in their manifest. According to the PR description, the target should control the navigation link.

To fix this, you should determine the target before sending the notification and pass it to send_app_notification. This ensures the deep link is correct, and you can reuse the target variable for storing the message in chat if needed. The suggested change refactors the logic to be more concise and correct.

Suggested change
# Always send push notification
send_app_notification(uid, app.name, app.id, data['message'])
# If app has chat_messages enabled in manifest, also store the message in chat
if app.external_integration and app.external_integration.chat_messages_enabled:
target = app.external_integration.chat_messages_target
chat_app_id = None if target == 'main' else app.id
add_app_message(data['message'], chat_app_id, uid)
# Determine if message should be stored in chat and get target.
store_in_chat = app.external_integration and app.external_integration.chat_messages_enabled
target = app.external_integration.chat_messages_target if store_in_chat else 'app'
# Always send push notification, respecting the target for navigation.
send_app_notification(uid, app.name, app.id, data['message'], target=target)
# If enabled, also store the message in chat.
if store_in_chat:
chat_app_id = None if target == 'main' else app.id
add_app_message(data['message'], chat_app_id, uid)

mdmohsin7 added a commit that referenced this pull request Feb 11, 2026
## Summary
- Follow-up to #4747 — `send_app_notification` was called without the
`target` parameter, so apps with `target: "main"` in their manifest
still got `navigate_to='/chat/{app_id}'` instead of `'/chat/omi'`
- Determines `target` from manifest before sending the notification so
the deep link matches where the message is stored

## Test plan
- [ ] App with `target: "main"` — notification click opens main chat
- [ ] App with `target: "app"` or no manifest — notification click opens
app chat (unchanged)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@beastoin beastoin mentioned this pull request Feb 12, 2026
ellaaicare pushed a commit to ellaaicare/omi that referenced this pull request Apr 12, 2026
…4747)

## Summary
- PR BasedHardware#4605 broke existing apps by requiring `chat_messages.enabled` in
manifest — apps without it got a 403 error instead of sending the
notification
- Restores original behavior: push notification is always sent
regardless of manifest config
- `chat_messages` manifest config now only controls whether the message
is **additionally stored** in chat (main or app chat based on `target`)
- `send_app_notification` now respects `target` parameter for
`navigate_to` deep link — apps using `target: "main"` navigate to
`/chat/omi` instead of `/chat/{app_id}`

## Test plan
- [ ] Existing apps without `chat_messages` in manifest can still send
notifications (no 403)
- [ ] Apps with `chat_messages.enabled: true, target: "main"` store
message in main chat and notification navigates to main chat
- [ ] Apps with `chat_messages.enabled: true, target: "app"` store
message in app chat and notification navigates to app chat
- [ ] Apps without `chat_messages` in manifest only send notification,
no message stored in chat

🤖 Generated with [Claude Code](https://claude.com/claude-code)
ellaaicare pushed a commit to ellaaicare/omi that referenced this pull request Apr 12, 2026
…dHardware#4748)

## Summary
- Follow-up to BasedHardware#4747 — `send_app_notification` was called without the
`target` parameter, so apps with `target: "main"` in their manifest
still got `navigate_to='/chat/{app_id}'` instead of `'/chat/omi'`
- Determines `target` from manifest before sending the notification so
the deep link matches where the message is stored

## Test plan
- [ ] App with `target: "main"` — notification click opens main chat
- [ ] App with `target: "app"` or no manifest — notification click opens
app chat (unchanged)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…4747)

## Summary
- PR BasedHardware#4605 broke existing apps by requiring `chat_messages.enabled` in
manifest — apps without it got a 403 error instead of sending the
notification
- Restores original behavior: push notification is always sent
regardless of manifest config
- `chat_messages` manifest config now only controls whether the message
is **additionally stored** in chat (main or app chat based on `target`)
- `send_app_notification` now respects `target` parameter for
`navigate_to` deep link — apps using `target: "main"` navigate to
`/chat/omi` instead of `/chat/{app_id}`

## Test plan
- [ ] Existing apps without `chat_messages` in manifest can still send
notifications (no 403)
- [ ] Apps with `chat_messages.enabled: true, target: "main"` store
message in main chat and notification navigates to main chat
- [ ] Apps with `chat_messages.enabled: true, target: "app"` store
message in app chat and notification navigates to app chat
- [ ] Apps without `chat_messages` in manifest only send notification,
no message stored in chat

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…dHardware#4748)

## Summary
- Follow-up to BasedHardware#4747 — `send_app_notification` was called without the
`target` parameter, so apps with `target: "main"` in their manifest
still got `navigate_to='/chat/{app_id}'` instead of `'/chat/omi'`
- Determines `target` from manifest before sending the notification so
the deep link matches where the message is stored

## Test plan
- [ ] App with `target: "main"` — notification click opens main chat
- [ ] App with `target: "app"` or no manifest — notification click opens
app chat (unchanged)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant