mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-04 02:00:10 +00:00
* fix(terminal): run PTYs on Bun's native terminal
Under Bun on macOS and Linux, spawnTerminalPty launched a Node worker
because Bun closes node-pty's nonblocking tty.ReadStream on EAGAIN, so
terminals failed on Bun-only installs without Node. Replace the bridge
with an adapter over Bun.spawn({ terminal }) behind TerminalPtyHandle and
delete the worker, its IPC protocol, their tests, and the terminalPty
runtime entrypoint. Node and Windows keep node-pty.
The adapter keeps node-pty's contract: TERM/PWD handling, UTF-8 string
output, exit after PTY EOF with a 200 ms fallback, signalled exits as
exit code 0 plus the signal number, and session-tree kills. One ordered
queue replays pre-subscription output and honors pause; the OpenClaw Bun
fork's Terminal.pause()/resume() (openclaw/bun#10) supplies real output
backpressure and is feature-detected. A terminating kill keeps reading to
EOF and drains output before exit so a paused consumer cannot hold up
teardown.
The CI process lane runs the new Bun suite on Bun and keeps its siblings
on Node.
* fix(terminal): use Bun’s native PTY on Windows
Route Bun terminal creation through the native adapter on every platform while preserving Windows batch command lines, environment inheritance, and direct kill behavior. Keep node-pty for Node and preserve existing output lifecycle handling.
Add Windows ConPTY coverage and portable spawn-contract regressions; document Windows flow-control availability. Validation: 546 Node tests passed, fork Bun passed 9 tests, stock Bun passed 6, typechecks/lint/format/assertion safety passed, and independent review found no actionable issues. Real Windows ConPTY tests remain unexecuted on this macOS host.
* revert(terminal): keep node-pty for Bun on Windows
Bun.Terminal on Windows does not deliver Ctrl-C to the foreground program; node-pty does on the same host. Restore node-pty for Bun on Windows while retaining Bun native PTYs on macOS and Linux and node-pty for Node on every platform.
* fix(terminal): keep the Node helper on Bun builds without Terminal.pause
Resolve ClawSweeper's P1s for supported stock Bun: preserve output
backpressure and avoid the macOS wait4 event-loop deadlock after fast PTY
child exit. Gate the native adapter on Terminal.prototype.pause, supplied
by the OpenClaw Bun fork carrying openclaw/bun#10 and #11. Other POSIX Bun
builds keep main's Node helper with raw parameters and launch-authority
checks; Node and Windows retain node-pty.
Restore the helper, worker, protocol, tests, and runtime entrypoint
byte-identically from origin/main. Require pause/resume in the gated
native adapter while preserving output replay, teardown drain, EOF grace,
and exit ordering. Update runtime and terminal docs without a changelog edit.
Resolve the P2 replay-test issue with controlled Bun.spawn callbacks,
without sleeps or a production test hook. Cover capability routing and a
real stock-Bun Node-helper terminal; retain CI routing with native PTY
cases skipped until its Bun pin gains the capability.
Validation: Node product suites 550 passed; fork Bun 16 passed; stock Bun
9 passed with all 8 native cases skipped. Typechecks, scoped lint,
formatting, assertion-safety ratchet, and docs syntax pass. The requested
combined Node command reports only the known lint-suppression mismatch
already fixed on main by
|
||
|---|---|---|
| .. | ||
| agent.md | ||
| background-work.md | ||
| channel.md | ||
| config-and-utilities.md | ||
| gateway-and-nodes.md | ||
| media.md | ||
| models.md | ||
| state-and-system.md | ||