perf(details): batch Conversation Details plugin loading, reuse frames & staged reveal #32
Closed
gabrielvidal
wants to merge 0 commits from
details-panel-perf into main
pull from: details-panel-perf
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: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: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#32
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
Optimizes the Conversation Details panel loading from up to ~42 HTTP requests + 10 simultaneous Python subprocesses down to 1 batched data request (plus 1 cached HTML bundle on cold start and 0 sandbox-frame fetches after first load), while keeping plugin iframes alive across conversation switches and revealing data-backed cards together in one smooth beat with zero blank-box flashes.
Key changes
backend/plugins/manifest.py,backend/plugins/routes.py,docs/plugins.md): Added optionalui.slots[].query(declaring a slot's initialreadOnlyaction + parameterized$conversationId/$sessionIdpayload) andui.slots[].reuseFrame(boolean opt-in to keep the iframe mounted across conversation switches), exposed viaGET /api/plugins/uiwithout changing existing plugins' approval fingerprints.backend/plugins/batch.py,backend/plugins/routes.py,backend/plugins/proxyroutes.py):POSTandGET /api/plugins/batch-read(up to 32readOnlyitems, bounded per-batch concurrency of 5 so one drawer never saturatesREQUEST_SCRIPT_SLOTS=12, sharedsingleflightdeduplication, per-item error isolation, and a 512-entry versioned cache: 30 s for finished conversations, 3 s for running ones, 5 s otherwise — invalidated on plugin lifecycle mutations, non-readOnlyPOSTs, andhub/changed).batch.resolve_call()shared by single-action and batch routes.GET /api/plugins/ui-bundle?where=<place>returning all active slot HTML documents in one payload withETag/304 Not Modified.plugins.useinbackend/authz/routes.pyand updatedbackend/authz/matrix.golden.txt./sandbox-frame.html(backend/core/csp.py,backend/main.py,frontend/vite.config.ts,frontend/src/lib/sandboxFrame.ts):/sandbox-frame.html?v=<sha256[:12]>withCache-Control: public, max-age=31536000, immutablewhile keepingContent-Security-Policy: sandbox ...(unversioned or mismatched requests stayno-cache).?n=seqwith a build-hashed?v=<hash>&p=<poolSlot>recycled on unmount/release, eliminating Chromium's cache lock and reducing repeat frame navigations to 0 HTTP requests.frontend/src/business/plugins/api.ts,pluginData.ts,pluginQueries.ts,components/PluginSlots.tsx,frontend/src/business/conversations/components/BatchReveal.tsx,pages/Conversation.tsx,frontend/src/mock/handlers.ts):usePluginSlotHtmlBundle("conversation.details")loads all slot HTML in one request (staleTime: Infinity, invalidated by SSEplugins) and seeds individual slot caches + IndexedDB.preloadDetailSlots()fires onebatch-readright as the drawer mounts for all visible non-stashed slots (using manifestquery+ parameterized learned-preload fallback), seedingpluginQuerieswith a 10 s fresh window so booting frames paint synchronously with 0 extra requests; concurrent unpreloaded reads within 25 ms auto-coalesce into one batch.reuseFrameslots keep a staticinitso switching conversations sendsonUpdatewithout tearing down 16 iframes.BatchReveal.tsx): core + pure-snapshot cards render immediately, all plugin cards usestartEmpty, a compact "Loading details…" indicator shows while the batch is in flight (capped at 1 s), and data-backed cards fade in together in one beat.frontend/src/mock/handlers.ts) implements/api/plugins/ui-bundleand/api/plugins/batch-read.Key decisions
GET /api/conversations/{id}or declarative rewrite): Preserves the "thread goes first" paint rule and full plugin HTML/chart freedom while collapsing all detail reads into one request from the very first cold visit (with automatic learned-preload fallback for third-party plugins without manifestquery).ai-agent-pluginsaddsquery+reuseFrameacross all 16conversation.detailsslots; both PRs are backwards-compatible in either merge order.Changelog
ui.slots[].queryandui.slots[].reuseFrameplugin manifest options,GET|POST /api/plugins/batch-read, andGET /api/plugins/ui-bundle.Test notes
backend/test_plugin_details_batch.py(11 tests covering manifest validation, batch POST/GET, concurrency, partial errors, cache/invalidation,ui-bundleETag/304, and immutablesandbox-frame.html). Verified passing per-module:test_plugin_details_batch.py(11),test_authz.py(19),test_authz_matrix.py(2),test_csp.py(7),test_plugin_widget_platform.py(11),test_stage2_platform.py(7), plus all 33test_plugin*.py,test_batch1_platform.py,test_machine_wake.py, andtest_gate.py.conversation.detailsslots) inai-agent-pluginsagainst the updatedbackend/plugins/manifest.py.npx tsc --noEmitclean,npm run buildsucceeds,npm test1,098 passed (only pre-existingFreshContext.test.tsxknown failure fromscripts/test-known-failures.txt), including newbatchLoading.test.tsx(6), updatedpluginQueries.test.ts(13), andsandboxFrame.test.ts(11).https://fedora.tail5edf31.ts.net:5301/?mock=1(screenshots attached below in dark and light themes).ai-agent-pluginsPR).Screenshots
Merged into
mainas52a0fc2eby the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/01a221fa-1e3e-7447-a970-dee68df49b40.Pull request closed