feat(plugin-honcho): show what Honcho remembers about you
Nightly Build / build (push) Successful in 2m24s

The opt-in page gains a debug panel, once the user's saved flag is on:
service status (reachability, latency, the caller's own processing
queue, with the specific Honcho error when something is wrong), a full
overview (peer card, derived facts with ids, summary) and one text
field with two actions — search (raw ranked facts) and ask (Honcho's
server-side LLM answers), plus an in-page mini-guide.

Every endpoint gates on the per-user opt-in server-side, fail closed,
and derives the peer from the authenticated Caller — never from the
request body — since the workspace is shared. Honcho 404s are
translated per-endpoint as 'no memory yet' rather than failures.
This commit is contained in:
Daniele
2026-08-24 21:47:36 +01:00
parent 5c2bec043e
commit 9feaaaff29
10 changed files with 749 additions and 49 deletions
+10 -5
View File
@@ -764,10 +764,11 @@ pub struct HonchoPlugin {
handle: Mutex<Option<JoinHandle<()>>>,
/// Shared Memory implementation — created once, updated on start/stop.
honcho_memory: Arc<HonchoMemory>,
/// Deps the HTTP router (config/opt-in pages + `POST /admin/test`) needs at
/// request time. Handed to the router once at boot as a shared cell; `start`
/// fills it and `stop` clears it, so handlers resolve the current wiring and
/// answer 503 while the plugin is enabled but not running.
/// Deps the HTTP router (config/opt-in pages, `POST /admin/test`, and the
/// opt-in-gated introspection endpoints) needs at request time. Handed to
/// the router once at boot as a shared cell; `start` fills it and `stop`
/// clears it, so handlers resolve the current wiring and answer 503 while
/// the plugin is enabled but not running.
web: WebCell,
}
@@ -920,10 +921,14 @@ impl core_api::plugin::Plugin for HonchoPlugin {
let workspace_id = cfg.workspace_id.clone();
let user_config = Arc::clone(&ctx.user_config);
// Wire the HTTP router (config/opt-in pages + admin test endpoint).
// Wire the HTTP router (config/opt-in pages + the admin test and the
// opt-in-gated introspection endpoints).
*self.web.lock().await = Some(HonchoWeb {
user_channel: Arc::clone(&ctx.user_channel),
i18n: Arc::clone(&ctx.i18n),
client: Arc::clone(&client),
workspace_id: workspace_id.clone(),
user_config: Arc::clone(&user_config),
});
self.honcho_memory.activate(Arc::clone(&client), workspace_id.clone(), Arc::clone(&user_config));