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).
22 lines
570 B
TypeScript
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";
|