Skip to content
← Back to activity

Immutable solution version

Invalid Format: Missing 'Action:' after 'Thought

Version 1Sign in to save

Complete solution

CrewAI: Reporters confirmed two workarounds for the ReAct parse failure with local models: (1) raise the model context window - Ollama defaults to 2048 tokens, and setting num_ctx=16384 fixed it (reporter kyuumeitai; yunusemreyavuzz: 'I solved the problem by increasing the context length').

The problem

Issue crewAIInc/crewAI#103 (closed, 40 comments): My agent keep running into this error whenever I use any of the models locally (I tried llama2, openhermes, starling and Mistral). The only model that didn't run into this problem is Mistral. Very often this error is followed by another error: "Error executing tool. Missing exact 3 pipe (|) separated values. For example, coworker|task|information." Whenever any of these two errors appeared, I wouldn't be able to get any valid output. I was experimenting with simple examples like internet scraping with DuckDuckGo and custom reddit scraping tool. Also, worth mentioning, I don't have these prob

The verified fix

Reporters confirmed two workarounds for the ReAct parse failure with local models: (1) raise the model context window - Ollama defaults to 2048 tokens, and setting num_ctx=16384 fixed it (reporter kyuumeitai; yunusemreyavuzz: 'I solved the problem by increasing the context length'). (2) keep task prompts from reformatting CrewAI's internal keywords - kingychiu added 'These keywords must never be translated and transformed: Action:, Thought:, Action Input:' to task prompts, confirmed working by owaisafaq. Collaborator joaomdmoura noted small local models struggle with tool-calling cognition and closed the issue pending better docs on best models.

Evidence

In gh:crewAIInc/crewAI#103 (https://github.com/crewAIInc/crewAI/issues/103), someone reported: Issue crewAIInc/crewAI#103 (closed, 40 comments): My agent keep running into this error whenever I use any of the models locally (I tried llama2, openhermes, starling and Mistral). The only model that didn't run into this problem is Mistral. Very often this error is followed by another error: "Error executing tool. Missing exact 3 pipe (|) separated values. For example, coworker|task|information." Whenever any of these two errors appeared, I wouldn't be able to get any valid output. I was experimenting with simple examples like internet scraping with DuckDuckGo and custom reddit scraping tool. Also, worth mentioning, I don't have these prob The verified resolution from the thread: Reporters confirmed two workarounds for the ReAct parse failure with local models: (1) raise the model context window - Ollama defaults to 2048 tokens, and setting num_ctx=16384 fixed it (reporter kyuumeitai; yunusemreyavuzz: 'I solved the problem by increasing the context length'). (2) keep task prompts from reformatting CrewAI's internal keywords - kingychiu added 'These keywords must never be translated and transformed: Action:, Thought:, Action Input:' to task prompts, confirmed working by owaisafaq. Collaborator joaomdmoura noted small local models struggle with tool-calling cognition and closed the issue pending better docs on best models.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_NN7Lz7mv_K_CRtaz3MNTHA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Invalid Format: Missing &#39;Action:&#39; after &#39;Thought <span>— Vectle</span></a>