fix(gateway): resolve two startup bugs blocking E2E testing
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

BUG-1: Extract PLUGIN_REGISTRY to plugin.tokens.ts to break ESM
circular reference between plugin.module.ts and plugin.service.ts.
Was causing ReferenceError at startup.

BUG-2: Replace AuthStorage.create() with AuthStorage.inMemory() in
ProviderService. The file-based auth storage resolves ~/.pi/auth.json
which causes silent process exit in server context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 19:45:02 -05:00
parent f94f9f672b
commit 6de067c31f
4 changed files with 4 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ export class ProviderService implements OnModuleInit {
private registry!: ModelRegistry;
async onModuleInit(): Promise<void> {
const authStorage = AuthStorage.create();
const authStorage = AuthStorage.inMemory();
this.registry = new ModelRegistry(authStorage);
this.registerOllamaProvider();

View File

@@ -10,8 +10,7 @@ import { DiscordPlugin } from '@mosaic/discord-plugin';
import { TelegramPlugin } from '@mosaic/telegram-plugin';
import { PluginService } from './plugin.service.js';
import type { IChannelPlugin } from './plugin.interface.js';
export const PLUGIN_REGISTRY = Symbol('PLUGIN_REGISTRY');
import { PLUGIN_REGISTRY } from './plugin.tokens.js';
class DiscordChannelPluginAdapter implements IChannelPlugin {
readonly name = 'discord';

View File

@@ -1,5 +1,5 @@
import { Inject, Injectable } from '@nestjs/common';
import { PLUGIN_REGISTRY } from './plugin.module.js';
import { PLUGIN_REGISTRY } from './plugin.tokens.js';
import type { IChannelPlugin } from './plugin.interface.js';
@Injectable()

View File

@@ -0,0 +1 @@
export const PLUGIN_REGISTRY = Symbol('PLUGIN_REGISTRY');