diff --git a/packages/plugin/src/hooks/magic-context/hook.ts b/packages/plugin/src/hooks/magic-context/hook.ts index 43bb20a00..228248548 100644 --- a/packages/plugin/src/hooks/magic-context/hook.ts +++ b/packages/plugin/src/hooks/magic-context/hook.ts @@ -178,6 +178,10 @@ export interface MagicContextDeps { min_chars: number; }; transform_mode?: ResolvedTransformMode; + /** Path to the subc daemon's connection file. Threaded to the module + * transport so a host that publishes it outside the default data-dir + * location (e.g. a systemd RuntimeDirectory) is actually reachable. */ + subc?: { connection_file: string }; /** Compaction-off mode gate (issue #266). Resolved ONCE here at the * session-hook construction boundary via isCompactionEnabled; the * resolved boolean is threaded to the transform phases. */ @@ -774,7 +778,7 @@ export function createMagicContextHook(deps: MagicContextDeps) { const authorityRecoveryModuleClient = deps.rustModeModuleClient ?? (() => { - const transport = new SubcModuleTransport(); + const transport = new SubcModuleTransport(deps.config.subc?.connection_file); const client: RustModeModuleClient = { call: (args) => transport.call(args), stateSyncCapabilities: (args) => transport.stateSyncCapabilities(args), diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index d8e10e1b5..eb1e76712 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -203,7 +203,9 @@ const server: Plugin = async (ctx) => { const liveSessionState = createLiveSessionState(); const rustModeModuleClient: RustModeModuleClient | undefined = - pluginConfig.transform_mode === "rust" ? new SubcModuleTransport() : undefined; + pluginConfig.transform_mode === "rust" + ? new SubcModuleTransport(pluginConfig.subc?.connection_file) + : undefined; const hooks = await createSessionHooksAsync({ ctx,