[Bug] OpenAI-compatible driver fails to populate 'messages' array in request payload for local endpoints

Offen
#3,569 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go
Bereich
backend

Rechercherichtung

Start by tracing how the OpenAI-compatible driver builds chat completion requests and how the configured model and user input reach that code. Reproduce with a local OpenAI-compatible endpoint and inspect the outgoing JSON payload. Done means the request includes the user's text in the messages array and the endpoint accepts it.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Description

When using a local, OpenAI-compatible server (e.g., Ollama) via the openai provider in waveai.json, the client fails to include the user's text input in the JSON request payload. This results in an empty messages array being sent to the endpoint, triggering a 400 Bad Request from the server.

Steps to Reproduce
  1. Configure waveai.json to use ai:provider: "openai" with a local endpoint (e.g., http://localhost:11434/v1/chat/completions).
  2. Set a dummy OPENAI_KEY in the Secrets menu to bypass client-side validation.
  3. Open a new chat session using the configured model.
  4. Type a valid text string (e.g., "Hello!") and attempt to send.
Expected Behavior

The client should package the user input into a standard OpenAI chat completion payload:

{"model": "...", "messages": [{"role": "user", "content": "Hello!"}]}
Vorherrschende Sprache
Go
Sterne
22.7k
Forks
1.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus wavetermdev/waveterm

Alle Issues in wavetermdev/waveterm

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.