chore(lint): reduce warning debt across core adapters and model clients
This commit is contained in:
@@ -135,6 +135,8 @@ export class GatewayServer {
|
||||
}
|
||||
|
||||
private registerHandlers(): void {
|
||||
const channelRegistry = this.config.channelRegistry;
|
||||
const runtimeConfig = this.config.config;
|
||||
const systemHandlers = createSystemHandlers({
|
||||
startTime: this.startTime,
|
||||
version: this.config.version ?? '0.1.0',
|
||||
@@ -142,14 +144,14 @@ export class GatewayServer {
|
||||
getToolCount: () => this.config.toolRegistry.list().length,
|
||||
getConnectionCount: () => this.sessionBridge.connectionCount,
|
||||
restart: this.config.restart,
|
||||
getChannels: this.config.channelRegistry
|
||||
? () => this.config.channelRegistry!.list().map(a => ({ name: a.name, status: a.status }))
|
||||
getChannels: channelRegistry
|
||||
? () => channelRegistry.list().map(a => ({ name: a.name, status: a.status }))
|
||||
: undefined,
|
||||
getServices: this.config.config && this.config.channelRegistry
|
||||
? () => discoverServices(this.config.config!, this.config.channelRegistry!)
|
||||
getServices: runtimeConfig && channelRegistry
|
||||
? () => discoverServices(runtimeConfig, channelRegistry)
|
||||
: undefined,
|
||||
getPresence: this.config.channelRegistry
|
||||
? (opts) => this.config.channelRegistry!.getPresence(opts)
|
||||
getPresence: channelRegistry
|
||||
? (opts) => channelRegistry.getPresence(opts)
|
||||
: undefined,
|
||||
getUsage: () => ({
|
||||
totalSessions: this.config.sessionManager.listSessions().length,
|
||||
@@ -307,7 +309,7 @@ export class GatewayServer {
|
||||
});
|
||||
}
|
||||
|
||||
private handleConnection(ws: WebSocket, identity?: string): void {
|
||||
private handleConnection(ws: WebSocket, _identity?: string): void {
|
||||
// Gateway lock — reject if another client is already connected
|
||||
if (this.config.lock && this.connectionMap.size > 0) {
|
||||
ws.close(4003, 'Gateway locked — another client is already connected');
|
||||
|
||||
@@ -124,7 +124,10 @@ describe('SessionBridge', () => {
|
||||
const bridge = createBridge();
|
||||
bridge.connect('conn-1');
|
||||
const agent = bridge.getAgent('conn-1');
|
||||
const cancelSpy = vi.spyOn(agent!, 'cancel');
|
||||
if (!agent) {
|
||||
throw new Error('Expected agent for conn-1');
|
||||
}
|
||||
const cancelSpy = vi.spyOn(agent, 'cancel');
|
||||
|
||||
bridge.setBusy('conn-1', true);
|
||||
expect(bridge.cancel('conn-1')).toBe(true);
|
||||
@@ -193,7 +196,7 @@ describe('SessionBridge', () => {
|
||||
},
|
||||
compaction: { enabled: false },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3-haiku' } },
|
||||
} as any);
|
||||
} as unknown as SessionBridgeConfig['config']);
|
||||
|
||||
bridge.connect('conn-tier');
|
||||
const agent = bridge.getAgent('conn-tier');
|
||||
@@ -201,7 +204,7 @@ describe('SessionBridge', () => {
|
||||
});
|
||||
|
||||
it('keeps different sessions isolated by persisted model tier', () => {
|
||||
const sessionById: Record<string, any> = {};
|
||||
const sessionById: Record<string, typeof mockSession> = {};
|
||||
const localSessionManager = {
|
||||
...mockSessionManager,
|
||||
getSession: vi.fn((frontend: string, sessionId: string) => {
|
||||
@@ -238,7 +241,7 @@ describe('SessionBridge', () => {
|
||||
},
|
||||
compaction: { enabled: false },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3-haiku' } },
|
||||
} as any,
|
||||
} as unknown as SessionBridgeConfig['config'],
|
||||
});
|
||||
|
||||
bridge.connect('conn-a');
|
||||
|
||||
Reference in New Issue
Block a user