Priority: P1
Category: performance, cli
Parent: #3011
Depends on: Startup profiler, Lazy tool registration
Problem / 问题
gemini.tsx main() is fully sequential. Operations like extension cache refresh, MCP connection, telemetry init, and update check block REPL rendering even though their results are not needed for the first user interaction.
main() 完全串行。扩展缓存刷新、MCP 连接、遥测初始化、更新检查等操作阻塞 REPL 渲染,但首次交互并不需要它们。
Proposed Solution / 方案
Categorize startup operations by criticality:
Must await (critical path):
loadSettings(), parseArguments(), loadCliConfig()
performInitialAuth()
- Core config initialization
Fire-and-forget (defer to after render):
extensionManager.refreshCache()
- MCP server connections
- Telemetry initialization
- Update check
- Git repository detection
- IDE client connection (if not in IDE mode)
Implementation pattern:
// Critical path — await
await performInitialAuth();
// Fire-and-forget — don't await
void connectMcpServers();
void initTelemetry();
void checkForUpdates();
Reference: Claude Code startDeferredPrefetches() — same pattern, all prefetches run after root.render().
Acceptance Criteria / 验收标准
Problem / 问题
gemini.tsx main()is fully sequential. Operations like extension cache refresh, MCP connection, telemetry init, and update check block REPL rendering even though their results are not needed for the first user interaction.main()完全串行。扩展缓存刷新、MCP 连接、遥测初始化、更新检查等操作阻塞 REPL 渲染,但首次交互并不需要它们。Proposed Solution / 方案
Categorize startup operations by criticality:
Must await (critical path):
loadSettings(),parseArguments(),loadCliConfig()performInitialAuth()Fire-and-forget (defer to after render):
extensionManager.refreshCache()Implementation pattern:
Reference: Claude Code
startDeferredPrefetches()— same pattern, all prefetches run afterroot.render().Acceptance Criteria / 验收标准