mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
perf: remove eager agent restoration blocking server startup
Remove blocking restorePersistedAgents() call that was resuming all 87 agents before opening the HTTP socket. The architecture already supports lazy loading through handleInitializeAgentRequest() - agents are shown in the UI from the registry and only initialized when clients request them. This eliminates: - Sequential thread resumes with network handshakes to Codex/Claude - Synchronous history file reads from disk - DNS lookups and model catalog fetches - 87 awaited operations before socket binding Server now starts immediately by just loading the lightweight agents.json registry. Agents resume on-demand when requested by clients. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,10 +12,7 @@ import { AgentRegistry } from "./agent/agent-registry.js";
|
||||
import { ClaudeAgentClient } from "./agent/providers/claude-agent.js";
|
||||
import { CodexAgentClient } from "./agent/providers/codex-agent.js";
|
||||
import { initializeTitleGenerator } from "../services/agent-title-generator.js";
|
||||
import {
|
||||
attachAgentRegistryPersistence,
|
||||
restorePersistedAgents,
|
||||
} from "./persistence-hooks.js";
|
||||
import { attachAgentRegistryPersistence } from "./persistence-hooks.js";
|
||||
import { createAgentMcpServer } from "./agent/mcp-server.js";
|
||||
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
||||
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
||||
@@ -108,9 +105,12 @@ async function main() {
|
||||
});
|
||||
|
||||
attachAgentRegistryPersistence(agentManager, agentRegistry);
|
||||
|
||||
await restorePersistedAgents(agentManager, agentRegistry);
|
||||
console.log("✓ Global agent manager initialized with persisted agents");
|
||||
const persistedRecords = await agentRegistry.list();
|
||||
console.log(
|
||||
`✓ Agent registry loaded (${persistedRecords.length} record${
|
||||
persistedRecords.length === 1 ? "" : "s"
|
||||
}); agents will initialize on demand`
|
||||
);
|
||||
|
||||
const agentMcpTransports: AgentMcpTransportMap = new Map();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user