Skip to content

fix(core): flip text content fields AGT-3103#6353

Merged
tinalenguyen merged 2 commits into
mainfrom
chenghao/fix/flip-content-fields
Jul 9, 2026
Merged

fix(core): flip text content fields AGT-3103#6353
tinalenguyen merged 2 commits into
mainfrom
chenghao/fix/flip-content-fields

Conversation

@chenghao-mou

@chenghao-mou chenghao-mou commented Jul 8, 2026

Copy link
Copy Markdown
Member

Before:

  • text_content raw content, with expressive tags and bracket tags;
  • plain_text_content clean content, without any tags;

Now:

  • text_content clean content, without any expressive-only tags expr
  • raw_text_content raw content with expr tags

@chenghao-mou chenghao-mou requested a review from a team as a code owner July 8, 2026 10:02

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +627 to 633
# only strip the <expr/> dialect, and only in assistant messages
if strip_markup and item.role == "assistant":
from ..tts._provider_format import strip_all_markup
from ..tts._provider_format import strip_expr_markup

item.content = [
strip_all_markup(c) if isinstance(c, str) else c for c in item.content
strip_expr_markup(c) if isinstance(c, str) else c for c in item.content
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Narrowed scope of strip_markup in to_dict serialization

The to_dict(strip_markup=True) method at livekit-agents/livekit/agents/llm/chat_context.py:629 now calls strip_expr_markup instead of the previous strip_all_markup. This means provider-native tags (e.g. <break time="1s"/>, <emotion value="happy"/>, [laugh]) will now survive serialization when strip_markup=True. Any downstream consumer (frontend, logging pipeline, analytics) that previously received fully-stripped text will now see these provider-native tags. The new test at tests/test_expr_markup.py:347-354 explicitly validates this narrower behavior, confirming it's intentional.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. Provider markup doesn't survive outside TTS scope.

@chenghao-mou chenghao-mou changed the title fix(core): flip text content fields fix(core): flip text content fields AGT-3103 Jul 8, 2026
@tinalenguyen tinalenguyen merged commit d664b05 into main Jul 9, 2026
27 of 28 checks passed
@tinalenguyen tinalenguyen deleted the chenghao/fix/flip-content-fields branch July 9, 2026 19:08
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.

3 participants