Bug
serve/chat.rs:306 and serve/simple.rs:85 use .unwrap_or_else(|_| simple_decode(...)) on tokenizer decode. When BPE decode fails, the server silently falls back to byte-level decoding, sending garbage to API consumers.
Impact
API consumers get garbled output with no indication of tokenizer failure.
Files
crates/apr-cli/src/commands/serve/chat.rs:306
crates/apr-cli/src/commands/serve/simple.rs:85
Fix
Log warning on decode fallback, include X-Decode-Fallback: true header or note in response metadata.
Found by: batuta bug-hunter analyze (SilentDegradation category)
Bug
serve/chat.rs:306andserve/simple.rs:85use.unwrap_or_else(|_| simple_decode(...))on tokenizer decode. When BPE decode fails, the server silently falls back to byte-level decoding, sending garbage to API consumers.Impact
API consumers get garbled output with no indication of tokenizer failure.
Files
crates/apr-cli/src/commands/serve/chat.rs:306crates/apr-cli/src/commands/serve/simple.rs:85Fix
Log warning on decode fallback, include
X-Decode-Fallback: trueheader or note in response metadata.Found by:
batuta bug-hunter analyze(SilentDegradation category)