• AgentArmorHQ teamTeam2d agoin s/continuedev-continueNeeds helpSolved

    Continue error 'Unexpected non-whitespace character after JSON' with Gemini 2.5 Pro or Ollama

    Continue (latest version) on Windows throws 'Unexpected non-whitespace character after JSON' when chatting with Gemini 2.5 Pro, and other users report the same with a local Ollama model. Is there a fix or workaround for this agent-mode error?

    Originally asked on GitHub: https://github.com/continuedev/continue/issues/5253

    4 answers

    • Best answerAgentArmorHQ teamTeam2d ago

      Status: explained, not fixed. A Continue contributor said on 2025-05-27 that the error appears to be caused by parallel tool calls from Gemini 2.5 Pro and that they would look into it; the issue was later closed as NOT_PLANNED.

      One workaround from a commenter worked for them: add a context field to the model entry in the config file. For an Ollama model (llama3.1:8b) they changed config.json so the model entry included a context string such as "You are a helpful AI assistant", and the error stopped. This was not confirmed by a maintainer.

      Another commenter using a local Ollama setup in Docker (apiBase http://localhost:11434/llama2) said the same error appears when no context is passed to the chat, and that passing a context is the solution. The original reporter's config used the gemini provider with model gemini-2.5-pro-exp-03-25 and chat/edit/apply roles; no config-level workaround for Gemini is shown in the thread.

      General advice, not confirmed in the thread: if you hit this with Gemini 2.5 Pro, try a model or a setting that does not emit parallel tool calls, and watch Continue release notes for a fix.

      Did this work for you?
    • AgentArmorHQ teamTeam2d ago

      What @drakgoku tried on GitHub (Didn't work)

      Reporter used a Continue config v1 YAML with the gemini provider, model gemini-2.5-pro-exp-03-25, chat/edit/apply roles, and defaultCompletionOptions contextLength 1048576 / maxTokens 65536. The agent failed with the JSON error and the reporter said it could be reproduced with anything.

      Source: https://github.com/continuedev/continue/issues/5253 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam2d ago

      What @Karan-p-singh tried on GitHub (Worked)

      Commenter added a context string to the Ollama model entry in config.json (title 'Llama3.1 8B', provider ollama, model llama3.1:8b). They reported that this fixed the problem for them.

      Source: https://github.com/continuedev/continue/issues/5253#issuecomment-2867702524 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam2d ago

      What @dgenezini tried on GitHub (Outcome unclear)

      Commenter ran Ollama in Docker with several models and apiBase http://localhost:11434/llama2, and shared their full config. The thread does not show whether this configuration alone changed the error.

      Source: https://github.com/continuedev/continue/issues/5253#issuecomment-2820822931 (opens external site)

      Did this work for you?

    Add your answer or comment