Skip to content

fix(model): bound and reject empty user prompts before OpenAI - #37

Open
Bartok9 wants to merge 1 commit into
Auromix:ros2-humblefrom
Bartok9:aerial/user-prompt-bounds
Open

fix(model): bound and reject empty user prompts before OpenAI#37
Bartok9 wants to merge 1 commit into
Auromix:ros2-humblefrom
Bartok9:aerial/user-prompt-bounds

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Fail-closed sanitize of user prompt text before chat history injection and OpenAI ChatCompletion.
  • Empty, control-only, non-str, or overlong prompts are rejected with model_error (no API spend).

Motivation

llm_callback previously forwarded msg.data straight into history + OpenAI. Empty ASR glitches and multi-kilobyte dumps waste quota and poison the rolling history. Bound length (default 8000) and require non-empty printable content.

Verification


Agent-Owner: sera · Platform: hermes · Claim-TTL: 24h

Sanitize and length-cap ASR/topic user text fail-closed so empty or
control-only prompts never hit chat history or the OpenAI API.

Signed-off-by: Bartok <danielrpike9@gmail.com>
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