Skip to content

Fix OpenAI chat message selection - #1183

Merged
davidmezzetti merged 1 commit into
neuml:masterfrom
FU-max-boop:fix/openai-latest-message
Aug 12, 2026
Merged

davidmezzetti merged 1 commit into
neuml:masterfrom
FU-max-boop:fix/openai-latest-message

Conversation

@FU-max-boop

Copy link
Copy Markdown
Contributor

Summary

  • use the latest chat message when dispatching OpenAI-compatible requests to agents, embeddings search, non-LLM pipelines, and workflows
  • keep the default LLM path unchanged so it still receives the full conversation
  • add a regression test with a system message followed by the current user message

Fixes #1182

Validation

  • black --check src/python/txtai/api/routers/openai.py test/python/testapi/testopenai.py
  • pylint --rcfile=.pylintrc src/python/txtai/api/routers/openai.py test/python/testapi/testopenai.py (10.00/10)
  • python -m py_compile src/python/txtai/api/routers/openai.py test/python/testapi/testopenai.py
  • isolated dispatch matrix covering agent, embeddings, pipeline, workflow, and unchanged full-message LLM behavior

@davidmezzetti davidmezzetti added this to the v9.13.0 milestone Aug 12, 2026
@davidmezzetti davidmezzetti added the bug Something isn't working label Aug 12, 2026
@davidmezzetti
davidmezzetti merged commit 5570dbc into neuml:master Aug 12, 2026
@davidmezzetti

Copy link
Copy Markdown
Member

LGTM - Interesting catch, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI chat route sends the oldest message to non-LLM backends

2 participants