Skip to content

Conversation

@Konkord360
Copy link

When using gemini-3-pro-preview the API stream sends a final chunk (likely usage metadata or [DONE] signal) that does not match the expected "text":... fragment format.

The current implementation manually wraps the line in braces: vim.json.decode("{" .. line .. "}").When the final non-conforming chunk arrives, vim.json.decode throws an error (Expected object key string but found T_OBJ_END), crashing the plugin callback just as the response finishes.

Wrapping the decoding logic in a pcall (similar to the ollama integration) solves the issue and the chat integration works flawlessly.

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.

1 participant