picoclaw/pkg/providers/messageutil
maxiaoyang d1e9bb6ae3 feat(messageutil): add SanitizeMessageName for OpenAI wire compliance
OpenAI's Chat Completions name field requires ^[a-zA-Z0-9_-]{1,64}$.
Real-world sender IDs (Discord alice#1234, numeric Telegram IDs, Slack
U07AB12C3DEF, free-form CLI names) often violate this, so a sanitizer
sits between the raw inbound ID and any wire payload.

Disallowed characters collapse into a single underscore, leading and
trailing underscores are trimmed, and the result is byte-safely
truncated to 64 (output is pure ASCII).

This helper will be wired into the agent pipeline in a later commit.

Refs #2702.
2026-04-29 20:59:21 +08:00
..
messageutil.go feat(messageutil): add SanitizeMessageName for OpenAI wire compliance 2026-04-29 20:59:21 +08:00
messageutil_test.go feat(messageutil): add SanitizeMessageName for OpenAI wire compliance 2026-04-29 20:59:21 +08:00