refactor(toolproxy): the tools are plugins — retire the core brokers, guest tool groups and hub editions #13
Closed
gabrielvidal
wants to merge 0 commits from
retire-tool-proxy into main
pull from: retire-tool-proxy
merge into: gabrielvidal:main
gabrielvidal:main
gabrielvidal:card-icon-beside-title
gabrielvidal:worktrees-cli
gabrielvidal:worktrees-plugin
gabrielvidal:agent-presets
gabrielvidal:no-plugin-white-flash
gabrielvidal:agy-tasks
gabrielvidal:home-declutter
gabrielvidal:perf-plugin-batching
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:android-push-bridge
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: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#13
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
Since 2026-11-25 the guests' paid tools have been live plugins (
nanobanana,video-extract,3d-gen,3d-render,matomo,movies,meta), each with its own proxy and managed grants. The core still served the old path right next to them: per-tool brokers, per-guest tool groups, Settings → Meta Business and sevencli/skills"hub editions" that took precedence over the plugin skills on workers. This PR finishes the move. The tool proxy is now just the door: bearer tokens,whoami, the tool ledger and the tools chip. A one-time carry-over turns every guest's switches and the brokers' data into the plugins' own. This is move A of the "what could move to ai-agent-plugins" review (formai-agent-moves-to-ai-agent-plugins_o2qxmd).Homelab companion (Seerr webhook + lab shims): gabrielvidal/homelab#18
Matomo companion (the
extraSitesgrant field): gabrielvidal/ai-agent-plugins#15Update 2026-11-27: rebased on
41665fa2, plus the Matomo extra sitesad150f1f, after41665fa2, "remove the core's legacy Meta Business" (already deployed). Where both branches deleted the same code, main's Meta removal is the one kept:toolproxy/{meta,metaroutes,snapshots}.py,schemas/meta.py,cli/skills/meta,business/meta/and the/settings/metaredirect now come from main. This PR removes everything else. Main's unrelated additions are kept, includingc6e15991: a guest's cron job still gets its tool token, becausetool_scopegives one whenever the guest has plugin skills.carryover_tools.matomo_sites):users.jsontools.matomoSites(for example Cel's[11], calamite.net) goes into the matomo grant'sextraSites(a list of ints). The grant is also turned on for every guest in theanalyticsgroup. This runs once per guest rather than once per plugin, so Cel, who got analytics and site 11 after the groups moved, still gets it. An explicit grant is never overridden: it only getsextraSiteswhen it has none. If the installed matomo manifest doesn't have the field yet, the sites wait, and the plugin's update carries them over. CLAUDE.md's Matomo note points at the grant field.Key changes
backend/toolproxy/{matomo,media,webroutes,owned,catalog}.py(the Meta files had already gone in41665fa2). Also removed: the nanobanana / 3d-gen / 3d-render / video-extract / matomo / meta / movies routes and the core movies webhook,/api/me/meta,/api/users/{uid}/metaand/api/movies/*.toolproxy/routes.pykeeps the shared HTTP client, the bearer helpers andwhoami(now: who, the caller's live plugins, this month's spend).access.pykeeps the tokens andresolve; the group, Pro, budget and in-flight checks moved to the plugin side long ago.cli/skills/{nanobanana,3d-gen,3d-render,video-extract,matomo,movies,meta}(~3.1k lines).workers/labsync.items_for: a live plugin's skill now wins over a lab skill of the same name, on guest computers and on owner workers. Proxied plugin skills keep theirhub.json(with_hub/tool_hubstay).users.jsontoolsis no longer read or written (only the carry-over reads it), along withCaller.tool_groups,Me.tools/GuestUser.tools/UserBody.toolsand the schemasGuestTools,PaidToolsMonth,Meta*andMovie*.users/runs.tool_scopeis plugin-only, andTOOLS_LINEsays "Tools the hub shares with them".depsis now passed toscope_for/scratch_scopeon resume, reply, fork and No project runs. Before, only spawns got plugin skills; the old groups masked the gap.moviesgrant comes on, either at guest creation (on by default) or through the owner's switch. This goes throughplugins/routes._granted→users/routes.movies_bring_jellyfin, then a Pocket ID sync.plugins/carryover_tools.py(new; wired intocarryover.run_alland also run when one of these plugins is installed or put in the catalog). See Carry-over below.business/meta/,/settings/meta→/settings/plugin/meta), and the User page's Paid tools and Tools budget panels.managedplugin rows.managedrows.openapi.jsonandsrc/generatedregenerated;authz/matrix.golden.txtlost the 8 routes.Carry-over (once; never over an explicit grant)
images(+ Pro switch, tools budget)nanobananagrant on,allowPro= Pro, monthly budget = tools budgetvideovideo-extractgrant +video-dlinstalled for the guest3d3d-gen+3d-rendergrantsanalyticsmatomogrant (per guest, also after the groups moved)tools.matomoSitesextraSites, only when the grant doesn't have it yetmedia(the old default)movies(on by default) — a guest who had Movies off gets an explicit offmetametainstalled for the guest/data/tools-meta.jsonmetauser secrettoken+connection.json/snapshot.json(no key, no Page tokens)/data/meta-snapshots/<uid>/*.json/data/tools-matomo.json<uid>/matomo/_private/viewer.json(0600)/data/tools-media.json<uid>/movies/state.json(seerrUser,requests,indexed) + pending titles in the sharedrequests.jsonindex/data/tools-owned.json<uid>/3d-gen/_private/owned.jsonEach legacy file is renamed
….migratedonce fully carried. A plugin that isn't installed (or in the catalog) yet waits: the next start, or its install, carries it over.Key decisions
release-holds.defaultForGuests) only gets an explicit off for guests who had it off. Nano Banana always gets its Pro + budget.owned.pyandcatalog.pydeleted too (the brief said keepowned.py). Nothing reads them once the brokers are gone: the 3d-gen plugin has its own_private/owned.json(carried over), andnb_classifylives in the plugin.access.py,ledger.pyandwhoamiare kept.meta --as <guest>from the owner's runs still reads it.legacyLedgerTool: "nanobanana"stays, so this month's rows from the old route still count toward the key's spend.Changelog
Test notes
~/projects/ai-agentmain atad150f1ffor comparison):/data. Everything passes excepttest_typed_plugins::test_records_carry_kind, which fails the same way on main.test_guard×4,test_guest_accounts×1, plus 1 known).test_conv_ref×3).useShareTarget×2 plus 1 known). Main has 1085 passing because this PR deletes one test.openapi.jsonwas re-dumped fromapp.openapi()(venv under bwrap) andnpm run gen:apiwas re-run./data, all 155 modules. Everything passes excepttest_typed_plugins(test_records_carry_kind), which fails identically on main (missing fixture dir).test_carryover_tools.py(14 tests, 4 of them for the Matomo sites: Cel added after the groups moved, explicit grants, waiting for the field, no analytics means no grant) and a rewrittentest_tool_proxy.py(11: tokens, whoami, retired routes 404/405, run / scratch scopes, labsync plugin-wins +hub.json).test_oidc.py(Jellyfin on the grant),test_guest_computers.py,test_plugin_key_health.py(the core Gemini classifier test left withcatalog.py) andauthz/matrix.golden.txt.test_conv_ref.py×3 fails identically on main.test_labsync,test_shared_skillsandtest_toolspass (22).tsc --noEmitis clean. vitest: 1058 pass, 3 fail — the already-knownuseShareTarget×2 andFreshContext CacheExpiredNotice.npm run build:mockis OK.ai-agent-deploy).extraSites, ai-agent #24 and the other retire-legacy PRs), rebasing each in turn.nanobanana,video-extract,3d-gen,3d-render,matomo,moviesas managed plugins).metaandvideo-dlmust be installed for the owner or in the hub catalog, so the carry-over can install them for guests.tool carry-over:and that/data/tools-*.jsonbecame….migrated.authHeaderthere: Seerr still sends it, and the plugin's URL carries its own token.extraSites(ai-agent-plugins #15) is installed or reloaded, check that Cel's matomo grant shows Extra sites = 11 (tool carry-over: matomo for celin the logs).SEERR_WEBHOOK_TOKEN,MATOMO_*,SEERR_*andMETA_*inservices/ai-agent/docker-compose.yml/ the root.envare no longer read by the core.root.tsx,registry.ts,CLAUDE.md,carryover.pyand the generated API: rebase in merge order.🤖 Generated with Claude Code
Held, not merged. While the batch was testing,
matomo-site-grants(0797e454, Matomo site grants for guests + guest-job mailHtml) landed on main. It extends what this PR deletes:backend/toolproxy/matomo.py,users/store.pyguestTools,PaidTools.tsx/User.tsx/userDraft.ts,schemas/users.py,test_tool_proxy.pyand the generatedguestToolsmodel all conflict (two modify/delete). Merging needs the guests' Matomo site grants ported into the matomo plugin (its grant config) — a feature port, not a merge resolution. The rest of the batch (#11, #12, #14, #15, #16) shipped without it; homelab #18 is landed (its shims work against the plugins' editions already). Next: rebase on main and port the site grants into the matomo plugin.50e621fda0to4d0dcfa3ffMerged into
mainas101b6f6eby the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/12d75a3b-25dc-487a-ac3b-17782cba4214.Pull request closed