fix(miner-ui): register chat governor and discover/attempt actions under vite preview too - #7292
Conversation
…der vite preview too vite-chat-governor-actions.ts and vite-chat-discover-attempt-actions.ts only implemented configureServer, unlike every other vite-*-api.ts plugin in this app. vite preview only runs configurePreviewServer, so under the documented persistent-service deployment path (npm run build && npm run preview, per systemd/loopover-miner-ui.service.example) the shared chat-action registry never gets these two registrations, and any chat-issued governor pause/resume or discover/attempt command dispatches against an empty registry as unknown_action. Both registration functions already guard against re-registering via registry.has() checks, so calling them from both hooks is safe. Closes JSONbored#7228
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-19 13:14:34 UTC
Review summary Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of open PR #7295). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
apps/loopover-miner-ui/README.md's "Running as a persistent service" section documents that everyvite-*-api.tsplugin registers for bothconfigureServerandconfigurePreviewServer, sonpm run build && npm run previewalone is sufficient — no extra step needed. Two plugins didn't actually honor that contract:vite-chat-governor-actions.ts'schatGovernorActionsPlugin()andvite-chat-discover-attempt-actions.ts'schatDiscoverAttemptActionsPlugin()only implementedconfigureServer.vite previewonly ever runs a plugin'sconfigurePreviewServerhook, neverconfigureServer— which is exactly the deployment modesystemd/loopover-miner-ui.service.example(this repo's own recommended persistent-deployment unit) uses. Under that mode,registerGovernorChatActions()/registerDiscoverAttemptChatActions()never ran, so the shared chat-action registry stayed empty and any chat-issued governor pause/resume or discover/attempt command dispatched against it, surfacing to the operator as a silent-lookingunknown_action("Couldn't {pause/release/…}: action is not registered.") — identical wording to a real bug, with the actual cause being the deployment mode, not the command itself.register()function and wired it to bothconfigureServerandconfigurePreviewServer, matching the shape every other plugin in this app already uses (vite-chat-api.ts'schatApiPlugin).registerGovernorChatActions/registerDiscoverAttemptChatActionsare already idempotent — confirmed by readingpackages/loopover-miner/lib/chat-governor-actions.js/chat-discover-attempt-actions.js, both guard each registration with aregistry.has(...)check before callingregister— so no new idempotency logic was needed; calling the same function from either hook is safe.configureServer's existing behavior, the registration modules undersrc/lib/, or any other plugin file.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7228
Validation
git diff --check— clean.npm --workspace apps/loopover-miner-ui run typecheck(tsc --noEmit) — clean.npm --workspace apps/loopover-miner-ui run lint(eslint .) — 0 errors; the 7 pre-existing warnings (Fast Refresh /exhaustive-depson unrelated files) are untouched by this change.npx vitest runinapps/loopover-miner-ui— 328/328 passing across all 29 test files (no regressions), including two new test files:src/vite-chat-governor-actions.test.tsandsrc/vite-chat-discover-attempt-actions.test.ts, each proving the registration function is invoked when onlyconfigurePreviewServeris exercised (not justconfigureServer), via a mock of the dynamically-imported registration module.apps/**is outside this repo's Codecovcoverage.includescope (confirmed in PR Ledgers page and portfolio's queue-actions table never join the shared live-refresh poll cadence #7082's own body and this issue's own Test Coverage Requirements section), so this PR carries nocodecov/patchobligation — the new dedicated tests are the local coverage proxy.npm run test:ci'sui:buildstep (which builds@loopover/ui-mineramong other workspaces) was not run locally — it's a heavy, multi-workspace build (engine + both UI apps + both extensions) on this shared, memory-constrained sandbox, and this change is scoped to two plugin files' Vite lifecycle hooks with no build-config or route changes;ui:typecheck/ui:lint/ui:testabove are the local proxy for this workspace.npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:openapi:check(not applicable — no Worker route, MCP transport, or OpenAPI surface changed)npm audit --audit-level=moderate(no dependency changes)If any required check was skipped, explain why:
ui:buildstep wasn't run locally for the resource reasons above; CI's isolated runner performs the real build.ui:typecheck/ui:lint/ui:test(all clean, scoped to the actual affected workspace) are the local substitute.Safety
/api/*route added or changed; the governor/discover/attempt HTTP routes this registry ultimately gates dispatch for are unchanged and already tested elsewhere.)UI Evidencesection below with JPG/JPEG or PNG screenshots. (N/A — no visible UI changes.)