* fix(lsp): cleanup orphaned LSP servers on session.deleted When parallel background agent tasks complete, their LSP servers (for repos cloned to /tmp/) remain running until a 5-minute idle timeout. This causes memory accumulation with heavy parallel Sisyphus usage, potentially leading to OOM crashes. This change adds cleanupTempDirectoryClients() to LSPServerManager (matching the pattern used by SkillMcpManager.disconnectSession()) and calls it on session.deleted events. The cleanup targets idle LSP clients (refCount=0) for temporary directories (/tmp/, /var/folders/) where agent tasks clone repos. * chore: retrigger CI checks
83 lines
2.0 KiB
TypeScript
83 lines
2.0 KiB
TypeScript
import {
|
|
lsp_hover,
|
|
lsp_goto_definition,
|
|
lsp_find_references,
|
|
lsp_document_symbols,
|
|
lsp_workspace_symbols,
|
|
lsp_diagnostics,
|
|
lsp_servers,
|
|
lsp_prepare_rename,
|
|
lsp_rename,
|
|
lsp_code_actions,
|
|
lsp_code_action_resolve,
|
|
lspManager,
|
|
} from "./lsp"
|
|
|
|
export { lspManager }
|
|
|
|
import {
|
|
ast_grep_search,
|
|
ast_grep_replace,
|
|
} from "./ast-grep"
|
|
|
|
import { grep } from "./grep"
|
|
import { glob } from "./glob"
|
|
export { createSlashcommandTool, discoverCommandsSync } from "./slashcommand"
|
|
|
|
import {
|
|
session_list,
|
|
session_read,
|
|
session_search,
|
|
session_info,
|
|
} from "./session-manager"
|
|
|
|
export { sessionExists } from "./session-manager/storage"
|
|
|
|
export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash"
|
|
export { createSkillTool } from "./skill"
|
|
export { getTmuxPath } from "./interactive-bash/utils"
|
|
export { createSkillMcpTool } from "./skill-mcp"
|
|
|
|
import {
|
|
createBackgroundOutput,
|
|
createBackgroundCancel,
|
|
} from "./background-task"
|
|
|
|
import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin"
|
|
import type { BackgroundManager } from "../features/background-agent"
|
|
|
|
type OpencodeClient = PluginInput["client"]
|
|
|
|
export { createCallOmoAgent } from "./call-omo-agent"
|
|
export { createLookAt } from "./look-at"
|
|
export { createSisyphusTask, type SisyphusTaskToolOptions, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS } from "./sisyphus-task"
|
|
|
|
export function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition> {
|
|
return {
|
|
background_output: createBackgroundOutput(manager, client),
|
|
background_cancel: createBackgroundCancel(manager, client),
|
|
}
|
|
}
|
|
|
|
export const builtinTools: Record<string, ToolDefinition> = {
|
|
lsp_hover,
|
|
lsp_goto_definition,
|
|
lsp_find_references,
|
|
lsp_document_symbols,
|
|
lsp_workspace_symbols,
|
|
lsp_diagnostics,
|
|
lsp_servers,
|
|
lsp_prepare_rename,
|
|
lsp_rename,
|
|
lsp_code_actions,
|
|
lsp_code_action_resolve,
|
|
ast_grep_search,
|
|
ast_grep_replace,
|
|
grep,
|
|
glob,
|
|
session_list,
|
|
session_read,
|
|
session_search,
|
|
session_info,
|
|
}
|