Files
oh-my-pi/packages/agent/src/index.ts
T
hezhiyang2000 2159f56386 fix: add EventLoopKeepalive to eliminate idle busy-wait
Root cause: Bun 1.3.x (JavaScriptCore) busy-waits when the only
pending work is an unresolved Promise. A setInterval keepalive
keeps the event loop in epoll_wait instead of userspace spinning.

- EventLoopKeepalive: setInterval-based keepalive (re-arms after each
  firing, addressing the bot review concern about setTimeout expiry)
- keepaliveWhile(): wrapper to await a Promise with keepalive active
- Applied to getUserInput() in main.ts
- Retains yieldIfDue() and ExponentialYield from #1396

Idle CPU drops from ~100% to ~0% (wchan=do_epoll_wait).
2026-05-27 14:57:46 +08:00

22 lines
570 B
TypeScript

// Core Agent
export * from "./agent";
// Loop functions
export * from "./agent-loop";
// Append-only context mode
export * from "./append-only-context";
// Compaction
export * from "./compaction";
export * from "./harmony-leak";
// Proxy utilities
export * from "./proxy";
// Run-level telemetry collector + aggregators
export * from "./run-collector";
// Telemetry
export * from "./telemetry";
// Thinking selectors
export * from "./thinking";
// Types
export * from "./types";
// Yield utilities for Bun event-loop busy-wait prevention
export * from "./utils/yield";