Skip to content

✨ knowledge: refresh inbox sources and surface reload errors after connector hot-load - #18135

Merged
kubestellar-prow[bot] merged 1 commit into
v5from
feat/knowledge-connectors-hotload-followup
Nov 13, 2026
Merged

kubestellar-prow[bot] merged 1 commit into
v5from
feat/knowledge-connectors-hotload-followup

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Summary

Follow-up to #18099 (hot-load of the knowledge connector syncer via Syncer.Reconfigure), porting the two remaining pieces of #18100 onto the #18099 design (no factory / Apply; boot's reloadKnowledgeConnectors stays the single owner of the syncer lifecycle).

1. The Inbox follows the live connector set. Connectors that feed the Inbox were attached once in bootInbox, so a Plaud/WisprFlow connector added from the dashboard never showed in the Inbox until a restart.

  • inbox.Service.SetSources / HasSource replace the source map at runtime (src/pkg/inbox/service.go).
  • boot.inboxSources / boot.refreshInboxSources build sources from an explicit entry list + syncer (src/cmd/hive/boot_inbox.go). boot.reloadKnowledgeConnectors calls it after a successful reconfigure, after a hot-load build, and when the list is emptied; bootKnowledgeConnectors calls it once the boot syncer exists.
  • Side effect worth noting: the Inbox boots before the syncer, so inboxSource previously always saw b.knowledgeConnectors == nil and the direct Plaud read path (PreferDirect) was never attached at boot. It now is (same as ✨ knowledge: hot-load connector syncer on dashboard config changes #18100). Hives not signed in to Plaud are unchanged (Ready gates the direct path).

2. A save the running syncer refused is surfaced. The config is already persisted when Reconfigure fails, so the PUT now answers 200 with runtime_error (the reload error verbatim) and runtime (same meaning as the status endpoint: a syncer is running). kcSave rejects with saved, but the running syncer did not reload: <error> so every caller's existing catch handler toasts it instead of the plain success. Server.reloadKnowledgeConnectors now returns the error; the previous runtime is kept as before.

No new Dependencies field: ReloadKnowledgeConnectors from #18099 already routes into boot, which is where the Inbox lives.

Refs #18091 (follow-up to #18099, ports the remaining pieces of #18100)

Tests

  • src/pkg/inbox/service_sources_test.go (from ✨ knowledge: hot-load connector syncer on dashboard config changes #18100): SetSources wires, replaces and drops sources; Items picks the new set up on the next call.
  • src/cmd/hive/boot_inbox_sources_test.go: a hive booted with zero connectors gains the Inbox plaud source on reloadKnowledgeConnectors (as *inbox.PreferDirect) and loses it when the list is emptied; a hive booted with a Plaud connector attaches PreferDirect, not FactSource.
  • src/pkg/dashboard/api_knowledge_connectors_hotload_test.go: TestKnowledgeConnectorsPutReportsRuntimeError: a failing reload still persists the config, answers runtime_error verbatim with runtime: true, and keeps the previous runtime; a clean reload has no runtime_error.
  • src/pkg/dashboard/knowledge_connector_reload_error.test.js (node --test): kcSave rejects with the saved-but-not-reloaded message after refreshing the list, the rejection reaches a caller toast verbatim, clean saves resolve, empty runtime_error is not an error, non-2xx still reports the server error.
  • static/index.html regenerated with go generate ./pkg/dashboard/webstatic/; no time.Sleep added; citation guard reports no drift.

Not run locally per repo policy; CI is the gate.

🤖 Generated with Claude Code

…nnector hot-load

Follow-up to #18099 (Syncer.Reconfigure hot-load), porting the two pieces
#18100 had that #18099 left out:

- The Inbox follows the live connector set. boot.reloadKnowledgeConnectors
  rebuilds the Inbox sources (inbox.Service.SetSources) after every
  dashboard save that reached the runtime, so a Plaud/WisprFlow connector
  added through the dashboard feeds GET /api/inbox at once, and removing
  the last one drops it. bootKnowledgeConnectors does the same once the
  boot syncer exists, so the direct Plaud read path (PreferDirect) is
  attached at boot instead of the fact-only fallback the Inbox had because
  it boots ahead of the syncer.
- A save the running syncer refused is reported. The PUT still persists
  the config, but the response now carries runtime_error verbatim (plus
  runtime, with the status endpoint's meaning), and kcSave rejects with
  'saved, but the running syncer did not reload: ...' so the toast says so
  instead of a plain success.

Refs #18091

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18094 🌱 dashboard: move the shared auth-headers helper and Campaigns/Jam UI out of inception.js same files src/pkg/dashboard/static/index.html

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 13, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 1c8c604 into v5 Nov 13, 2026
94 of 100 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/knowledge-connectors-hotload-followup branch November 13, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant