Compare commits

...
2 Commits
Author SHA1 Message Date
swaitsandClaude Opus 4.7 a5a7b29764 feat(channels): listen on #development (KDF-derived PSK)
Add #development to the built-in hashtag channel set; its PSK is
derived from the channel name via the standard MeshCore hashtag KDF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 13:34:58 -06:00
swaitsandClaude Opus 4.7 e2ecbc747d fix(ai): forbid preamble in response-shortener output
Tighten the system/user prompts so the shortener returns ONLY the
rewritten message — no "Here's a version at N characters:" preamble,
no quotes, no labels. Previously such preamble was being transmitted
on-air and consumed the byte budget, causing the actual content to
truncate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 13:34:29 -06:00
2 changed files with 12 additions and 1 deletions

No files matched your search

+11 -1
View File
@@ -50,10 +50,20 @@ def _shorten_with_claude(text: str, max_chars: int) -> str:
model="claude-sonnet-4-6",
max_tokens=256,
timeout=CLAUDE_TIMEOUT_S,
system=(
"You rewrite a message to fit within a strict character budget. "
"Output ONLY the rewritten message — no preamble, no quotes, no "
"explanation, no commentary, no labels, no character count. "
"Preserve the original meaning, tone, and voice. Plain text only."
),
messages=[
{
"role": "user",
"content": f"Shorten this to {max_chars} characters: {text}",
"content": (
f"Rewrite the following message so it is at most "
f"{max_chars} characters. Reply with the rewritten "
f"message only.\n\n{text}"
),
}
],
)
+1
View File
@@ -256,6 +256,7 @@ _BUILTIN_HASHTAG_CHANNELS: tuple[str, ...] = (
"#weather",
"#protest",
# --- Dev / testing ---
"#development",
"#devtest",
"#devtestdevtest",
)