Skip to content

Fix animation command tags leaking into TTS output#516

Open
bedge117 wants to merge 1 commit into
kercre123:mainfrom
bedge117:fix/animation-tag-leak
Open

Fix animation command tags leaking into TTS output#516
bedge117 wants to merge 1 commit into
kercre123:mainfrom
bedge117:fix/animation-tag-leak

Conversation

@bedge117

@bedge117 bedge117 commented Jul 9, 2026

Copy link
Copy Markdown

GetActionsFromString did not guard against malformed command tags, causing raw command stems (e.g. "playAnimationWI") to be spoken aloud instead of parsed as actions. When an LLM emitted a tag missing the "||" separator (e.g. "{{playAnimationWI}}"), the parser indexed cmdPlusParam[1] without a length check, mishandling the tag and leaving the command stem glued to the spoken text.

This is common with local/open-source models (Ollama, etc.) that don't format the {{command||parameter}} structure as reliably as OpenAI.

Changes:

  • Guard cmdPlusParam access with a length check so tags missing "||" no longer mis-parse.
  • Add stripCommandStems() to scrub leaked command keywords (playAnimation, playAnimationWI, getImage, newVoiceRequest) and stray brace debris from spoken text before it reaches TTS.
  • Valid, well-formed tags still fire their animations as before; only malformed/leftover tag text is removed from speech.

GetActionsFromString did not guard against malformed command tags,
causing raw command stems (e.g. "playAnimationWI") to be spoken aloud
instead of parsed as actions. When an LLM emitted a tag missing the
"||" separator (e.g. "{{playAnimationWI}}"), the parser indexed
cmdPlusParam[1] without a length check, mishandling the tag and
leaving the command stem glued to the spoken text.

This is common with local/open-source models (Ollama, etc.) that
don't format the {{command||parameter}} structure as reliably as
OpenAI.

Changes:
- Guard cmdPlusParam access with a length check so tags missing "||"
  no longer mis-parse.
- Add stripCommandStems() to scrub leaked command keywords
  (playAnimation, playAnimationWI, getImage, newVoiceRequest) and
  stray brace debris from spoken text before it reaches TTS.
- Valid, well-formed tags still fire their animations as before;
  only malformed/leftover tag text is removed from speech.
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