mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-11 01:14:45 +02:00
fix: Command output goes through chunker, byte-safe for LoRa
- Commands now chunk output same as LLM responses - split_sentences splits on newlines first for !health output - chunk_response uses byte counting instead of character counting - Emojis and UTF-8 properly counted for 228-byte LoRa limit - !health 274 bytes now splits into 2 messages (195 + 74 bytes) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1662d80f02
commit
5be1d20b24
2 changed files with 70 additions and 23 deletions
|
|
@ -344,7 +344,17 @@ class MeshAI:
|
|||
|
||||
# Determine response
|
||||
if result.route_type == RouteType.COMMAND:
|
||||
messages = result.response # Commands return single string
|
||||
# Chunk command output same as LLM responses
|
||||
from .chunker import chunk_response
|
||||
raw = result.response if isinstance(result.response, str) else str(result.response)
|
||||
messages, remaining = chunk_response(
|
||||
raw,
|
||||
max_chars=self.config.response.max_length,
|
||||
max_messages=self.config.response.max_messages,
|
||||
)
|
||||
# Store remaining for continuation
|
||||
if remaining:
|
||||
self.router.continuations.store(message.sender_id, remaining)
|
||||
elif result.route_type == RouteType.LLM:
|
||||
messages = await self.router.generate_llm_response(message, result.query)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue