mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-10 13:31:38 +00:00
Expanding a tall <diff showLineNumbers> pinned to the scrollbox bottom froze the TUI with ERR_INVALID_ARG_VALUE looping out of CliRenderer.loop every frame. Root cause: @opentui/core 0.4.0 marshals OptimizedBuffer fillRect/drawText/setCell* coordinates as u32 in the FFI table while LineNumberRenderable.renderSelf passes raw screen coordinates — NEGATIVE when the diff is partially scrolled above the viewport. Bun's FFI silently wraps negatives (native side bounds-checks them into a no-op); Node's experimental node:ffi rejects them. bufferDrawBox already uses i32, which is why ordinary boxes/text scroll fine and only the diff line-background path crashed. Fix at the seam we own: boundary/ffiSafe.ts patches OptimizedBuffer to clip fillRect to the non-negative quadrant and skip negative-origin drawText/setCell*/drawChar before the FFI call (Bun parity). Installed from boundary/renderer.ts (live) and test/lib/render.ts (headless). TODO(upstream): widen those FFI params to i32 so this shim can be deleted. |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| .gitignore | ||
| .prettierrc | ||
| eslint.config.mjs | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||