You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maka TUI cold start is ~1.28s ESM compile on main@a5c2631 vs maka --help 0.23s.
strace shows TUI loads 879 files vs cli-core 148 files. Dominant cost is compileSourceTextModule.
Root cause: packages/cli/src/tui-mcp-control.ts statically imports createMcpCapabilityProvider from runtime-host-capability-provider-command.ts, which statically imports runRuntimeHostProcessLifecycle from @maka/runtime-host/server. That pulls full @maka/runtime (372 files, linkedom/zod/openai etc) even though TUI only needs the pure createMcpCapabilityProvider function.
Patched (remove server import) reduces TUI import from 1280ms/879 files/233 runtime to 471ms/287 files/3 runtime (-62%).
How to reproduce
On main@a5c2631 after npm --workspace maka-agent run build:
maka is Node ESM (packages/cli/dist/cli.js), not a compiled Rust binary. Release npm tarball ships same JS, so binary release has same issue. Native addons are only runtime-host-peer/gitoxide-helper.
Proposed fix: split mcp-capability-provider.ts (pure) from runtime-host-capability-provider-command.ts (CLI, needs server). tui-mcp-control.ts should import from pure module.
Verified via strace -e openat and NODE_DEBUG=esm / --cpu-prof.
Activity
me2seeks commentedon Aug 27, 2026
我在工作
fix(cli): split MCP capability provider to avoid pulling runtime-host…
fix(cli): split MCP capability provider to avoid pulling runtime-host…