Skip to content

fix(mistral): inject dummy user when last turn is assistant - #7035

Open
leilei3167 wants to merge 1 commit into
livekit:mainfrom
leilei3167:fix/mistral-trailing-assistant-dummy-user
Open

fix(mistral): inject dummy user when last turn is assistant#7035
leilei3167 wants to merge 1 commit into
livekit:mainfrom
leilei3167:fix/mistral-trailing-assistant-dummy-user

Conversation

@leilei3167

Copy link
Copy Markdown

Mistral's Conversations API returns 400 / code 3230 when the last turn is an assistant message. That's a valid LiveKit context after with_filler() or generate_reply() with no user_input.

The other formatters already inject a dummy user turn for this. Mistral's path never took inject_dummy_user_message, so the request went up as-is.

Fixes #7030

Test plan

  • uv run pytest tests/test_chat_ctx.py --unit (61 passed, 1 skipped)
  • ruff check / ruff format on the touched files

@leilei3167
leilei3167 requested a review from a team as a code owner August 29, 2026 08:11
@leilei3167

Copy link
Copy Markdown
Author

@livekit/agent-devs small one for #7030 — Mistral was dropping inject_dummy_user_message, so a trailing assistant turn (filler / generate_reply() with no user_input) 400'd. Same dummy . user turn the Google formatter already uses.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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.

Mistral plugin fails when generating a reply with an assistant message as the last ChatContext item Description

1 participant