Skip to content

fix(opencode): keep stderr tails on character boundaries - #47

Merged
nexxeln merged 2 commits into
nxl/rpc-settle-on-exitfrom
nxl/rpc-stderr-tail
Oct 5, 2026
Merged

nexxeln merged 2 commits into
nxl/rpc-settle-on-exitfrom
nxl/rpc-stderr-tail

Conversation

@nexxeln

@nexxeln nexxeln commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #43 | Stack: #46 ← #47

Why the change

The stderr tail attached to RPC failures is cut to its last 8 KiB by bytes, so a failure message could start with a stray � where the cut split a multi-byte character.

Special things to note

Change outline

The tail is still cut by bytes. When it's formatted, any leading UTF-8 continuation bytes (10xxxxxx) are skipped, so the message starts on a whole character.

 describe(message)
+  skip leading bytes where (byte & 0xc0) === 0x80
   detail = tail.toString().trim()
   return detail ? `${message}: ${detail}` : message

@nexxeln
nexxeln added this pull request to stack #48 October 5, 2026 07:05
@nexxeln nexxeln changed the title nxl/rpc stderr tail fix(opencode): keep stderr tails on character boundaries Oct 5, 2026
@nexxeln
nexxeln merged commit 8f7f686 into dev Oct 5, 2026
9 checks passed
@nexxeln nexxeln mentioned this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant