feat(plugins): notify.respond, answering webhooks and asset links for the Android app #43
Closed
gabrielvidal
wants to merge 0 commits from
android-push-bridge into main
pull from: android-push-bridge
merge into: gabrielvidal:main
gabrielvidal:main
gabrielvidal:fresh-context-plugin
gabrielvidal:remove-hooks-page
gabrielvidal:palette-plugins
gabrielvidal:linear-projects
gabrielvidal:agent-messaging
gabrielvidal:model-router
gabrielvidal:conv-card-layout
gabrielvidal:ask-more-options
gabrielvidal:agent-limits
gabrielvidal:generic-ui-strings
gabrielvidal:auto-translate
gabrielvidal:filter-chips
gabrielvidal:plugin-catalog
gabrielvidal:file-viewers
gabrielvidal:plugins-page-rework
gabrielvidal:hub-mcp-plugin
gabrielvidal:translation-plugin
gabrielvidal:scheduled-doors
gabrielvidal:cron-jobs-plugin
gabrielvidal:context-skills-plugin
gabrielvidal:files-plugins
gabrielvidal:worker-names
gabrielvidal:details-panel-perf
gabrielvidal:services-plugin-only
gabrielvidal:fix-test-env-leaks
gabrielvidal:bg-shells-plugin
gabrielvidal:feat-commits-plugins
gabrielvidal:fix-branch-line-tag-rows
gabrielvidal:retire-dead-leftovers
gabrielvidal:runner-into-harness-pi
gabrielvidal:retire-tool-proxy
gabrielvidal:new-project-policy-plugin-only
gabrielvidal:guest-jobs-sonnet
gabrielvidal:push-buttons-everywhere
gabrielvidal:mail-send-plugin
gabrielvidal:ui-polish-batch
gabrielvidal:command-palette-plugin
gabrielvidal:keyboard-shortcuts-plugin
gabrielvidal:prompt-shortcuts-plugin
gabrielvidal:matomo-site-grants
gabrielvidal:lab-chrome-plugin
gabrielvidal:performance-plugin
gabrielvidal:whats-new-plugin
gabrielvidal:skills-agents-plugin
gabrielvidal:goals-plugin-only
gabrielvidal:storage-server-side
gabrielvidal:plugin-scheduled-conversations
gabrielvidal:plugin-fences
gabrielvidal:handoff-plugin
gabrielvidal:plugin-commands
gabrielvidal:plugin-speed
gabrielvidal:cleanup-provider-harness
gabrielvidal:plugin-conversation-labels
gabrielvidal:plugin-plan-usage
gabrielvidal:fix-worker-harness-sync
gabrielvidal:plugin-gcloud-reauth
gabrielvidal:feat/plugin-cards-in-thread
gabrielvidal:feat/plugin-proxy-wake
gabrielvidal:unify-subagents-children
gabrielvidal:wave3d-frontend-typed-plugins
gabrielvidal:wave3c-sidecar-strict-plugins
gabrielvidal:wave3a-catalog-accounts-profiles
gabrielvidal:wave3b-pricing-usage-cutover
gabrielvidal:wave1a-typed-plugins
gabrielvidal:wave1b-sidecar-runtime
gabrielvidal:fix-ios-overlay-scroll
gabrielvidal:batch2-work-resources-core
gabrielvidal:batch2-apikeys
gabrielvidal:plugin-blue-green-deploy
gabrielvidal:plugin-ship
gabrielvidal:plugin-project-env
gabrielvidal:plugin-memories
gabrielvidal:plugin-activity
gabrielvidal:plugin-templates
gabrielvidal:plugin-desk-phone
gabrielvidal:batch1-platform
gabrielvidal:plugins-list-view
gabrielvidal:dash-plugins
gabrielvidal:pets-plugin
gabrielvidal:ha-push-channel
gabrielvidal:mail-agents
gabrielvidal:graph-fix
gabrielvidal:graph-plugin
gabrielvidal:services-plugin
gabrielvidal:left-to-do-plugin
gabrielvidal:plugins-gallery
gabrielvidal:home-conv-menu
gabrielvidal:meta-business
gabrielvidal:agy-rdrand
gabrielvidal:bg-lag
gabrielvidal:conv-load-perf
gabrielvidal:askform-instant
gabrielvidal:fix/drawer-menu-done-chip
gabrielvidal:pi-midrun-compaction
gabrielvidal:interrupt-menu-btn
gabrielvidal:authz
gabrielvidal:inkling
gabrielvidal:repo-plugins
gabrielvidal:work-sync
gabrielvidal:leftovers
gabrielvidal:fix/agy-guest-guard
gabrielvidal:feat/model-presets
gabrielvidal:scroll-back
gabrielvidal:feedback-bell
gabrielvidal:feat/movies-tool
gabrielvidal:feat/running-thread-padding
gabrielvidal:feat/drawer-filter-button-card-chat
gabrielvidal:burn-rate
gabrielvidal:guest-install
gabrielvidal:guest-usage
gabrielvidal:guest-palette
gabrielvidal:guest-form-links
gabrielvidal:form-open-buttons
gabrielvidal:clarifier-lean
gabrielvidal:auto-archive
gabrielvidal:guests-profile
gabrielvidal:conv-motion
gabrielvidal:share-target
gabrielvidal:terminal-sync
gabrielvidal:work-context-past
gabrielvidal:work-context-brief
gabrielvidal:enroll-codes
gabrielvidal:open-image-file
gabrielvidal:worker-uploads
gabrielvidal:conv-drawer-search
gabrielvidal:stack-motion-v3
gabrielvidal:notif-stack-fixes
gabrielvidal:home-motion
gabrielvidal:i18n-fr
gabrielvidal:local-electricity-cost
gabrielvidal:cache-pill-thread
gabrielvidal:cache-scenarios
gabrielvidal:fresh-start
gabrielvidal:msg-select
gabrielvidal:shortcuts-setup
gabrielvidal:ui-0-40-3
gabrielvidal:outbox-landing
gabrielvidal:resume-scope
gabrielvidal:conv-filter-range
gabrielvidal:fix-subagent-form-session
gabrielvidal:ask-form-integration
gabrielvidal:form-visual-options
gabrielvidal:watcher-perf
gabrielvidal:last-msg-summary
gabrielvidal:secret-fields
gabrielvidal:commit-review
gabrielvidal:summary-mode-fixes
gabrielvidal:service-tag-parser
gabrielvidal:clarifier
gabrielvidal:fetch-diet-2
gabrielvidal:fetch-diet
gabrielvidal:conv-look
gabrielvidal:pwa-links
gabrielvidal:tool-widgets
gabrielvidal:worker-autoupdate
gabrielvidal:usage-rings
gabrielvidal:opencode-harness
gabrielvidal:notif-diet
gabrielvidal:conv-resources
gabrielvidal:scheduled-tasks
gabrielvidal:profiles
gabrielvidal:notify-exact-cost
gabrielvidal:usage-measuring
gabrielvidal:guest-projects
gabrielvidal:usage-calibration
gabrielvidal:account-switch
gabrielvidal:multiuser-improve
gabrielvidal:form-groups
gabrielvidal:multiuser
gabrielvidal:motion-reel
gabrielvidal:dashboards-fixes
gabrielvidal:split-big-files
gabrielvidal:held-regex
gabrielvidal:subagent-interrupts
gabrielvidal:form-html
gabrielvidal:tokunia-video
gabrielvidal:settings-uniform
gabrielvidal:worker-ask-fix
gabrielvidal:worker-generic-mac
gabrielvidal:runner-shortcuts
gabrielvidal:notify-unify
gabrielvidal:perf-list-cache
gabrielvidal:mac-worker
gabrielvidal:model-switch
gabrielvidal:pipeline-paths
gabrielvidal:multi-account
gabrielvidal:feature-flags
gabrielvidal:qwen38-support
gabrielvidal:url-prompt
gabrielvidal:running-pages
gabrielvidal:homelab-tag
gabrielvidal:root-project
gabrielvidal:or-models
gabrielvidal:deploying-loader
gabrielvidal:worktree-diff
gabrielvidal:conv-tags
gabrielvidal:tags-page
gabrielvidal:agents-page
gabrielvidal:icon-picker-shortcuts
gabrielvidal:conv-cta
gabrielvidal:stamp-refine
gabrielvidal:post-task-cache
gabrielvidal:post-tidy-completed
gabrielvidal:form-badge
gabrielvidal:hooks-delay-seconds
gabrielvidal:cost-dashboard
gabrielvidal:plan-forms
gabrielvidal:form-mobile
gabrielvidal:guidelines-dag
gabrielvidal:skills-view
gabrielvidal:navbar-hold
gabrielvidal:spawnbox-status
gabrielvidal:hold-editable-expand
gabrielvidal:drawer-transparent
gabrielvidal:hold-fix
gabrielvidal:hold-editable
gabrielvidal:charroll-bump
No Reviewers
Labels
No items
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
gabrielvidal (Gabriel Vidal)
Clear assignees
No Assignees
gabrielvidal
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gabrielvidal/ai-agent#43
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The hub side of the native Android app (
gabrielvidal/ai-agent-android, contractdocs/PROTOCOL.md) is the newandroid-pushplugin (ai-agent-plugins PR, branchandroid-push). This PR is the small, generic core part it needs: a bridge that lets a phone channel answer for its user, webhooks that can be a plugin's own API, and the asset-links file the app's Trusted Web Activity checks.Merge order: this PR first, then the plugins PR (its manifest uses
notify.respond,respondandmethods, which the current hub refuses).Key changes
backend/plugins/hubnotify.py— capabilitynotify.respond(/proxy/tools/plugins/{pid}/hub/notify/…, the plugin's handler token only):GET pairing(who the installer is, the addresses their app can use and the install's webhook URLs),GET push/{id}(one recorded push or ask, whole),GET push/{id}/image(that push's own picture as bytes),POST answer,POST action,POST dismissed. Everything acts as the handler's user and only on their own pushes (notifications.routes.push_is_for: in the entry'sto, or their conversation's audience); anything else is a 404.backend/notifications/routes.py— the ask / action / dismissed routes share their work with the bridge (record_ask_answer,run_notify_action,dismiss_tags); their own behaviour is unchanged.backend/users/deliver.py,backend/notifications/channels.py—clear(skip_channel=…)/clear_async(exclude=…): a swipe on one phone channel clears the person's other channels (Home Assistant, in parallel), not the one it came from.backend/plugins/manifest.py,backend/plugins/proxyroutes.py—webhooks[].respond: "result"(the action's JSON is the HTTP body, or a_fileof the plugin's shared / the installer's data dir as a download) andwebhooks[].methods(GET). Written and fingerprinted only when set, so installed plugins keep their approval.backend/core/routes.py—GET /.well-known/assetlinks.json, unauthenticated, every host.backend/test_notify_respond.py(30),backend/test_assetlinks.py(3);docs/plugins.md("A phone app as a channel", capability table, runtime APIs) and a CLAUDE.md section.Key decisions
notify.respondmust be approvable by them. It is safe because it is handler-only (a guest's run token gets 403) and scoped to the token's user.answered/expired);/api/ask/{id}/answeritself still overwrites, as before — not changed here./proxy/tools/…/webhook/…is served onai-agent.lab.gabvdl.xyz(tailnet) andai-agent.gabvdl.xyz(internet);hub.gabvdl.xyzrefuses every/proxy/path at Traefik (ai-agent-owner-machines). The webhook token names the install, so the owner's already answers on the guest host:pairinggiveshub: https://hub.gabvdl.xyz+hook: https://ai-agent.gabvdl.xyz/proxy/tools/plugins/android-push/webhook/app?token=…. No Traefik change needed, and the hook isn't behind the FR+DE geo-lock.push/{id}/imageis not a proxy — only the image recorded on the person's own push,image/*, at most 5 MB. A picture on the hub itself is read through the file route it names (/api/host-file/raw,/api/artefact,/api/project-asset;/api/screenshotand/api/data-assetfor the owner only) by calling that route's function as this person, so its check stays the check; a public address goes through the existingimage_proxy.fetch; a lab address is never fetched._file+methods: ["GET"]) rather than a new download route: the app repo is private and guests need the build too.openapi.json,src/generatedandmatrix.golden.txtare unchanged (checked: no path added or removed;test_authz_matrixpasses).Changelog
notify.respond) — what the Android app's channel usesrespond,methods)/.well-known/assetlinks.jsonfor the Android app (ANDROID_APP_FINGERPRINTS,ANDROID_APP_PACKAGE)Test notes
backend/test_*.pymodule, one process each under a throwaway/data(bwrap): all pass excepttest_typed_plugins.py::TestStore::test_records_carry_kind, which fails the same way on main.Host: ai-agent.gabvdl.xyz, a push and an ask sent through/api/notifyand/api/askreached a local HTTP sink as protocol JSON,op: answerresolved the ask (GET /api/ask/{id}→ answered, a second answer →answered),op: dismissedmoved the push to dismissed in the ledger, a guest's webhook couldn't touch the owner's ask, the APK came back byte-identical from theapkwebhook, a push whose picture is a hub file came back byte-identical from the plugin'simgwebhook (a guest's token on it: 404), and/.well-known/assetlinks.jsonanswered 200 on every host.scripts/test.pyitself (it needs the lab's image).ai-agent-deploy), with two things only Gabriel can do:ANDROID_APP_FINGERPRINTS(the release — and debug — certificate SHA-256) in the service's env; until then the route is a 404 and the TWA shows its address bar;ai-agent.lab.gabvdl.xyzis behind Authelia: its router needs a no-auth rule forPath(/.well-known/assetlinks.json)if the app is ever paired on the tailnet address (the publichub.gabvdl.xyzand the guest host need nothing).🤖 Generated with Claude Code
GET …/hub/notify/push/{id}/image: the image recorded on the handler's user's own push, as bytes (image/* only, at most 5 MB). A picture on the hub itself is read through the file route it names with that route's own check; a public one through image_proxy.fetch; a lab address is never fetched. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>Merged into
mainas293a6a5dby the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/e16d945b-9f58-4a6c-9747-71e0d81d3bd4.Pull request closed