Skip to content

fix(provisioning): tolerate non-UTF-8 SSH output - #84

Merged
sjug merged 1 commit into
quadsproject:mainfrom
sjug:fix-ssh-nonutf8-output
Aug 7, 2026
Merged

fix(provisioning): tolerate non-UTF-8 SSH output#84
sjug merged 1 commit into
quadsproject:mainfrom
sjug:fix-ssh-nonutf8-output

Conversation

@sjug

@sjug sjug commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • decode streaming and collected SSH command output as UTF-8 with replacement for invalid bytes
  • prevent arbitrary llama.cpp model metadata bytes from surfacing as an opaque SSH disconnect during runtime verification
  • keep exact ASCII runtime evidence fail-closed while allowing unrelated diagnostic lines to contain replacement characters

Root cause

AsyncSSH inherited strict UTF-8 decoding for remote command sessions. The llama.cpp verbosity-4 startup log can contain raw tokenizer or model metadata bytes, so one invalid byte aborted the channel while QIIP read /var/log/llamacpp-serve.log. The server had started successfully, but runtime verification never reached the valid fit records later in the log.

Testing

  • Python 3.12: 1,497 passed
  • Python 3.13: 1,497 passed
  • coverage: 92.59% against the 92% floor
  • mypy strict: 143 source files, no issues
  • Ruff check and format, shellcheck, and git diff --check: clean

Remote tools can emit arbitrary model metadata bytes which AsyncSSH's
strict UTF-8 decoder treats as a channel failure. This made an otherwise
healthy llama.cpp startup fail while runtime verification read its log.

Decode command output as UTF-8 with replacement for both streaming and
collected commands. Exact ASCII runtime evidence remains fail-closed,
while invalid bytes in unrelated diagnostic output no longer abort SSH.
@sjug
sjug requested review from grafuls and sadsfae August 7, 2026 01:20
@sjug
sjug merged commit b3cd642 into quadsproject:main Aug 7, 2026
3 checks passed
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