You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Gemini request wraps message in extra table nesting — likely API rejection #35
Introduction:table.insert(messages, { mainmsg }) wraps mainmsg (already a proper table {role="user", parts={...}}) in an extra {}. The Gemini API receives {{role, parts, ...}} instead of {role, parts, ...}, likely causing API rejection.
Detailed Description: Line 47-52 builds mainmsg as a correctly structured message table. Line 54 wraps it again: { {role="user", parts={...}} }. The system_instruction and contents fields in the JSON body expect flat message arrays.
Reproduction:
:ModelCmpStart gemini
Set GEMINI_API_KEY environment variable
Type anything — Gemini silently returns an error or unexpected response
Activity
PyDevC commentedon May 26, 2026
Need some testing. It's been a while since I created it and it works so need to look why it can be a problem.