chore(lint): burn down remaining warnings to zero
This commit is contained in:
@@ -39,7 +39,7 @@ export async function initAgents(deps: AgentsDeps): Promise<AgentsResult> {
|
||||
|
||||
if (sandboxManager) {
|
||||
lifecycle.onShutdown(async () => {
|
||||
await sandboxManager!.destroyAll();
|
||||
await sandboxManager.destroyAll();
|
||||
console.log('Docker sandboxes destroyed');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { Lifecycle } from './lifecycle.js';
|
||||
|
||||
describe('Lifecycle', () => {
|
||||
|
||||
@@ -148,7 +148,10 @@ export function createMessageRouter(deps: {
|
||||
// Lazy sandbox: create the sandboxed tools with a deferred sandbox reference
|
||||
// The sandbox is created on first use via SandboxManager.getOrCreate()
|
||||
const sandboxSessionId = sessionId;
|
||||
const sandboxManager = deps.sandboxManager!;
|
||||
const sandboxManager = deps.sandboxManager;
|
||||
if (!sandboxManager) {
|
||||
throw new Error('Sandbox manager unavailable for sandboxed agent execution');
|
||||
}
|
||||
|
||||
// Create a proxy sandbox that lazily initializes
|
||||
const lazySandboxShell: Tool = {
|
||||
|
||||
+4
-3
@@ -68,21 +68,22 @@ export function initTools(deps: ToolsDeps): ToolsResult {
|
||||
// Initialize browser manager and register browser tools (if enabled)
|
||||
let browserManager: BrowserManager | undefined;
|
||||
if (config.browser?.enabled) {
|
||||
browserManager = new BrowserManager({
|
||||
const manager = new BrowserManager({
|
||||
executablePath: config.browser.executable_path,
|
||||
wsEndpoint: config.browser.ws_endpoint,
|
||||
headless: config.browser.headless,
|
||||
maxPages: config.browser.max_pages,
|
||||
defaultTimeout: config.browser.default_timeout,
|
||||
});
|
||||
browserManager = manager;
|
||||
|
||||
for (const tool of createBrowserTools(browserManager)) {
|
||||
for (const tool of createBrowserTools(manager)) {
|
||||
toolRegistry.register(tool);
|
||||
}
|
||||
console.log(`Browser tools enabled (headless=${config.browser.headless})`);
|
||||
|
||||
lifecycle.onShutdown(async () => {
|
||||
await browserManager!.shutdown();
|
||||
await manager.shutdown();
|
||||
console.log('Browser manager stopped');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user