Skip to content

fix(ui): register chat action plugins under vite preview, not just dev - #7295

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
xfodev:feat/miner-ui-preview-chat-actions-7228
Jul 19, 2026
Merged

fix(ui): register chat action plugins under vite preview, not just dev#7295
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
xfodev:feat/miner-ui-preview-chat-actions-7228

Conversation

@xfodev

@xfodev xfodev commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

chatGovernorActionsPlugin (vite-chat-governor-actions.ts) and chatDiscoverAttemptActionsPlugin (vite-chat-discover-attempt-actions.ts) implemented only configureServer, so their registerGovernorChatActions / registerDiscoverAttemptChatActions calls never ran under vite preview — the exact deployment mode the miner-ui README's "persistent service" section documents and systemd/loopover-miner-ui.service.example runs (npm run build + npm run preview, which fires only configurePreviewServer).

The result: under preview, the shared chat-action registry stayed empty, so an operator's chat-issued pause/resume/release/requeue/discover/attempt commands dispatched against nothing and surfaced as "action is not registered" — a confusing gap, since the same command works under npm run dev.

Every other local vite-*-api plugin already registers on both hooks. This makes these two match: each now registers on both configureServer and configurePreviewServer, calling the same (already-idempotent) registration function from each — the exact shape chatApiPlugin uses.

Scope

  • Touches only the two named plugin files + a new test; no configureServer behavior change, no change to the src/lib/ registration modules or any other plugin
  • No new /api/* route added — the existing plugin hook is registered, as the issue requires

Validation

  • @loopover/ui-miner typecheck, lint, test, and build all green (after ui:kit:build)
  • New regression test proves both registerGovernorChatActions and registerDiscoverAttemptChatActions are invoked when only configurePreviewServer is exercised (not just configureServer), mirroring the app's existing plugin-test convention
  • ui:version-audit clean; rebased onto latest main

Safety

  • No secrets or private terms introduced; registration functions remain idempotent (no new idempotency logic added in the plugin files)

Closes #7228

`chatGovernorActionsPlugin` and `chatDiscoverAttemptActionsPlugin` only
implemented `configureServer`, so their `registerGovernorChatActions` /
`registerDiscoverAttemptChatActions` calls never ran under `vite preview` —
the exact mode the miner-ui README's "persistent service" path and
systemd/loopover-miner-ui.service.example use (`npm run build` + `npm run
preview`, which fires only `configurePreviewServer`). Every other local
vite-*-api plugin already registers on both hooks; these two were the
outliers, so a preview-mode operator's chat pause/resume/release/requeue/
discover/attempt commands dispatched against an empty registry and surfaced
as "action is not registered".

Register on both `configureServer` and `configurePreviewServer`, calling the
same (already-idempotent) registration function from each — matching the
shape chatApiPlugin and the other plugins use.

Closes JSONbored#7228
@xfodev
xfodev requested a review from JSONbored as a code owner July 19, 2026 13:07
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-19 13:14:52 UTC

3 files · 1 AI reviewer · no blockers · readiness 88/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a `configurePreviewServer` hook alongside the existing `configureServer` hook to both chat-action plugins, extracting a shared `register()` closure so the same idempotent registration function fires under `vite preview` as under `vite dev`, matching the pattern already used by `chatApiPlugin`. The fix is correctly targeted at the actual defect (missing hook, not a downstream symptom), closes #7228 as required, and ships a regression test exercising `configurePreviewServer` directly via a mocked registry-adjacent module. The change is narrowly scoped to the two named files plus one new test file, with no route or registration-module changes.

Nits — 4 non-blocking
  • The new test file `chat-action-plugins-preview.test.ts` duplicates coverage already present in the per-module test files (e.g. `chat-discover-attempt-actions.test.tsx` already has a `configureServer` plugin test); consider whether the preview-hook assertions could simply be added to those existing describe blocks instead of a third parallel test file.
  • The `register` closure is duplicated verbatim in both plugin files with only the import path and function name differing; if a third chat-action plugin appears this pattern should be factored into a small shared helper.
  • apps/loopover-miner-ui/src/chat-action-plugins-preview.test.ts: fold these tests into the existing chat-governor-actions.test.tsx / chat-discover-attempt-actions.test.tsx files alongside the current configureServer plugin tests for a single source of truth per plugin.
  • Consider a tiny shared factory like `makeServerPlugin(name, importFn, register)` in a common module to eliminate the duplicated register-closure/hook wiring between vite-chat-governor-actions.ts and vite-chat-discover-attempt-actions.ts.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7228
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 27 registered-repo PR(s), 16 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor xfodev; Gittensor profile; 27 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds configurePreviewServer to both vite-chat-governor-actions.ts and vite-chat-discover-attempt-actions.ts, calling the same registration functions as configureServer, exactly mirroring the vite-chat-api.ts pattern the issue asks for, and includes a regression test exercising configurePreviewServer in isolation for both plugins.

Review context
  • Author: xfodev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, TypeScript
  • Official Gittensor activity: 27 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

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.

  • Re-run LoopOver review

@loopover-orb loopover-orb 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.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 2dd743f into JSONbored:main Jul 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat governor and discover/attempt action registration is missing from configurePreviewServer, unlike every sibling vite-*-api.ts plugin

1 participant