Build mode stops executing before task is complete #4337

Closed
opened 2026-02-16 17:43:28 -05:00 by yindo · 24 comments
Owner

Originally created by @jtaavola on GitHub (Jan 6, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

While running playwright or playwriter mcp tools, opencode will randomly end early. I first noticed this sometime last night 1/5/2026.

Using the CLI and Opus-4.5 (Claude Code).

Plugins

No response

OpenCode version

1.1.4

Steps to reproduce

  1. Use Claude Code opus-4.5
  2. Use playwright or playwriter MCP
  3. Give it an arbitrary long running task

Screenshot and/or share link

Image

Operating System

macOS 15.5

Terminal

Ghostty

Originally created by @jtaavola on GitHub (Jan 6, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description While running playwright or playwriter mcp tools, opencode will randomly end early. I first noticed this sometime last night 1/5/2026. Using the CLI and Opus-4.5 (Claude Code). ### Plugins _No response_ ### OpenCode version 1.1.4 ### Steps to reproduce 1. Use Claude Code opus-4.5 2. Use playwright or playwriter MCP 3. Give it an arbitrary long running task ### Screenshot and/or share link <img width="1149" height="805" alt="Image" src="https://github.com/user-attachments/assets/6375ee8b-da8a-4bf1-bd14-8fc376a5e480" /> ### Operating System macOS 15.5 ### Terminal Ghostty
yindo added the bug label 2026-02-16 17:43:28 -05:00
yindo closed this issue 2026-02-16 17:43:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 6, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6792: Task Tool Timeouts & Early Termination in Multi-Agent Conductor Pattern - describes tasks/execution stopping and returning session IDs prematurely
  • #4319: Strangely enough, it always gets stuck or encounters an exception during task execution - describes execution halting midway without clear errors
  • #4073: Hanging During Agent Tasks - describes tool calls stopping and no further progress being made
  • #829: MCP server failed to start (unstable MCP servers) - mentions MCP server connection issues that can cause hanging
  • #6897: Plannotator stops during execution - describes execution stopping unpredictably during long-running tasks
  • #2378: The ability to guide subagents on the right path - related to agents stopping/getting stuck during execution

These issues all describe similar symptoms of execution prematurely stopping or halting during task completion. Your issue with playwright/playwriter MCP tools stopping before task completion appears related to this pattern.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 6, 2026): This issue might be a duplicate of existing issues. Please check: - #6792: Task Tool Timeouts & Early Termination in Multi-Agent Conductor Pattern - describes tasks/execution stopping and returning session IDs prematurely - #4319: Strangely enough, it always gets stuck or encounters an exception during task execution - describes execution halting midway without clear errors - #4073: Hanging During Agent Tasks - describes tool calls stopping and no further progress being made - #829: MCP server failed to start (unstable MCP servers) - mentions MCP server connection issues that can cause hanging - #6897: Plannotator stops during execution - describes execution stopping unpredictably during long-running tasks - #2378: The ability to guide subagents on the right path - related to agents stopping/getting stuck during execution These issues all describe similar symptoms of execution prematurely stopping or halting during task completion. Your issue with playwright/playwriter MCP tools stopping before task completion appears related to this pattern. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Jan 6, 2026):

Huh that's weird...

@rekram1-node commented on GitHub (Jan 6, 2026): Huh that's weird...
Author
Owner

@rekram1-node commented on GitHub (Jan 6, 2026):

Does this only happen when using that mcp server?

@rekram1-node commented on GitHub (Jan 6, 2026): Does this only happen when using that mcp server?
Author
Owner

@jtaavola commented on GitHub (Jan 6, 2026):

Does this only happen when using that mcp server?

Yeah mainly the playwriter mcp, I swear I had issues with the official playwright mcp earlier today too. Both seem to be fine in claude code

@jtaavola commented on GitHub (Jan 6, 2026): > Does this only happen when using that mcp server? Yeah mainly the `playwriter` mcp, I swear I had issues with the official `playwright` mcp earlier today too. Both seem to be fine in claude code
Author
Owner

@Vikt0r70 commented on GitHub (Jan 7, 2026):

I am having the Same Issue , I think not only playwright, even chrome dev tool, and i think more MCPs can cause this cut in the executing, and none browser MCPs can lead to the same issue , I have been trying to solve it all day , nothing worked

Are You Using any type of proxy for your LLMs? I have been trying without the proxy seems I have different results

@Vikt0r70 commented on GitHub (Jan 7, 2026): I am having the Same Issue , I think not only playwright, even chrome dev tool, and i think more MCPs can cause this cut in the executing, and none browser MCPs can lead to the same issue , I have been trying to solve it all day , nothing worked Are You Using any type of proxy for your LLMs? I have been trying without the proxy seems I have different results
Author
Owner

@luisrudge commented on GitHub (Jan 12, 2026):

having the same issue when doing screenshots with the screencapture macos cli

@luisrudge commented on GitHub (Jan 12, 2026): having the same issue when doing screenshots with the `screencapture` macos cli
Author
Owner

@luisrudge commented on GitHub (Jan 13, 2026):

this makes the whole 'ralph loop' unusable because OC stops halfway through a step and then starts a new iteration without finalizing the first one

@luisrudge commented on GitHub (Jan 13, 2026): this makes the whole 'ralph loop' unusable because OC stops halfway through a step and then starts a new iteration without finalizing the first one
Author
Owner

@pascalwhoop commented on GitHub (Jan 14, 2026):

had the same a few times and came here to check what's happening. It just ends for no real reason

Image

generally wondering how much the claude + claude-code combo outperforms independent client / model development. If this is anything like apple vertically integrating hardware and software, I suspect this project has a difficult task to make various models play ball with the prompts they receive from opencode vs. say codex or CC

@pascalwhoop commented on GitHub (Jan 14, 2026): had the same a few times and came here to check what's happening. It just ends for no real reason <img width="1828" height="712" alt="Image" src="https://github.com/user-attachments/assets/a5154067-051e-40a5-97f5-6c6702e18f12" /> generally wondering how much the claude + claude-code combo outperforms independent client / model development. If this is anything like apple vertically integrating hardware and software, I suspect this project has a difficult task to make various models play ball with the prompts they receive from opencode vs. say codex or CC
Author
Owner

@pascalwhoop commented on GitHub (Jan 14, 2026):

one more, the Codex 5.2 is really loosing it in opencode, no idea what it's on about. All I asked it was to search the repo for some files

Image
@pascalwhoop commented on GitHub (Jan 14, 2026): one more, the Codex 5.2 is really loosing it in opencode, no idea what it's on about. All I asked it was to search the repo for some files <img width="2094" height="862" alt="Image" src="https://github.com/user-attachments/assets/63066708-14c8-4882-877f-d6bedccd8a30" />
Author
Owner

@dzervas commented on GitHub (Jan 14, 2026):

I have the same issue with opus by antigravity for nearly any tool

EDIT: I was able to fix this by changing the defined provider from @ai-sdk/openai-compatible to @ai-sdk/anthropic.

here's my config:

  "provider": {
    "dzervart": {
      "models": {
        "gemini-3-pro-preview": {
          "name": "gemini-3-pro"
        },
        "gemini-claude-opus-4-5-thinking": {
          "name": "opus-4.5"
        },
        "gemini-sonnet-claude-4-5-thinking": {
          "name": "sonnet-4.5"
        },
        "glm-4.7": {
          "name": "glm-4.7"
        },
        "gpt-5.2(high)": {
          "name": "gpt-5.2"
        },
        "gpt-5.2-codex(high)": {
          "name": "gpt-5.2-codex-high"
        },
        "gpt-5.2-codex(medium)": {
          "name": "gpt-5.2-codex"
        }
      },
      "name": "DZervArt",
      "npm": "@ai-sdk/anthropic",
      "options": {
        "apiKey": "sk-dummy",
        "baseURL": "https://127.0.0.1:8354/v1"
      }
    }
  },

note that I've only tested opus and I'm not sure how the rest of the models behave. I'll define each model family to their respective provider at some point, but not yet

EDIT2: neither anthropic, not google liked me using OC, beware that people get banned for using OC with a claude subscription 🔥

@dzervas commented on GitHub (Jan 14, 2026): I have the same issue with opus by antigravity for nearly any tool EDIT: I was able to fix this by changing the defined provider from `@ai-sdk/openai-compatible` to `@ai-sdk/anthropic`. here's my config: ```json "provider": { "dzervart": { "models": { "gemini-3-pro-preview": { "name": "gemini-3-pro" }, "gemini-claude-opus-4-5-thinking": { "name": "opus-4.5" }, "gemini-sonnet-claude-4-5-thinking": { "name": "sonnet-4.5" }, "glm-4.7": { "name": "glm-4.7" }, "gpt-5.2(high)": { "name": "gpt-5.2" }, "gpt-5.2-codex(high)": { "name": "gpt-5.2-codex-high" }, "gpt-5.2-codex(medium)": { "name": "gpt-5.2-codex" } }, "name": "DZervArt", "npm": "@ai-sdk/anthropic", "options": { "apiKey": "sk-dummy", "baseURL": "https://127.0.0.1:8354/v1" } } }, ``` note that I've only tested opus and I'm not sure how the rest of the models behave. I'll define each model family to their respective provider at some point, but not yet EDIT2: neither anthropic, not google liked me using OC, beware that people get banned for using OC with a claude subscription 🔥
Author
Owner

@starcraft66 commented on GitHub (Jan 14, 2026):

I'm seeing the same issue with playwright mcp server (the only one in my config). I keep having to tell it to keep going.

@starcraft66 commented on GitHub (Jan 14, 2026): I'm seeing the same issue with playwright mcp server (the only one in my config). I keep having to tell it to keep going.
Author
Owner

@rekram1-node commented on GitHub (Jan 14, 2026):

looking into this today

@rekram1-node commented on GitHub (Jan 14, 2026): looking into this today
Author
Owner

@rekram1-node commented on GitHub (Jan 15, 2026):

Hm trying to replicate and can't, if anyone can share full sessions that'd be super helpful

@rekram1-node commented on GitHub (Jan 15, 2026): Hm trying to replicate and can't, if anyone can share full sessions that'd be super helpful
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

I think ik the issue here:
https://github.com/anomalyco/opencode/blob/e4a34beb8b38ebd5717413d436b88678b9fe1a7c/packages/opencode/src/session/message-v2.ts#L507-L523

For those using mcps or dealing w/ images in any variety, and that is what this issue will focus on because it is what OP is reporting, I think it's due to this user message injected. This was originally done so that tools could output images and it never got cleaned up

Need to figure out how to make it not require a user message (not very intuitive ai sdk behavior, or im an idiot)

@rekram1-node commented on GitHub (Jan 16, 2026): I think ik the issue here: https://github.com/anomalyco/opencode/blob/e4a34beb8b38ebd5717413d436b88678b9fe1a7c/packages/opencode/src/session/message-v2.ts#L507-L523 For those using mcps or dealing w/ images in any variety, and that is what this issue will focus on because it is what OP is reporting, I think it's due to this user message injected. This was originally done so that tools could output images and it never got cleaned up Need to figure out how to make it not require a user message (not very intuitive ai sdk behavior, or im an idiot)
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

Found fix I think, gonna add it shortly

This should fix it:
https://github.com/anomalyco/opencode/commit/de2de099b4e66ea05ffa00220621df1f8709977c

Theory is that the user message containing the image was confusing the model, instead just keep the image data as tool part, should prevent it from stopping the loop randomly

@rekram1-node commented on GitHub (Jan 16, 2026): Found fix I think, gonna add it shortly This should fix it: https://github.com/anomalyco/opencode/commit/de2de099b4e66ea05ffa00220621df1f8709977c Theory is that the user message containing the image was confusing the model, instead just keep the image data as tool part, should prevent it from stopping the loop randomly
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

This should be fixed in 1.1.24, going out rn

@rekram1-node commented on GitHub (Jan 16, 2026): This should be fixed in 1.1.24, going out rn
Author
Owner

@starcraft66 commented on GitHub (Jan 16, 2026):

Will definitely test it out thanks. Now that I think of it I think it was hanging when playwright mcp was screenshotting pages so your diagnosis makes sense.

@starcraft66 commented on GitHub (Jan 16, 2026): Will definitely test it out thanks. Now that I think of it I think it was hanging when playwright mcp was screenshotting pages so your diagnosis makes sense.
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

Accidentally introduced a regression w/ compaction with that fix reverting and then gonna try to find better solution

@rekram1-node commented on GitHub (Jan 16, 2026): Accidentally introduced a regression w/ compaction with that fix reverting and then gonna try to find better solution
Author
Owner

@laruss commented on GitHub (Jan 17, 2026):

Hmm, the problem is reproducible for me too, but my MCP server is not returning any attachments, only text.
Here's mcp server I am using (self-built): grok-imagine-mcp
it works fine for claude code.
Using Opus 4.5 (github copilot)

Image
@laruss commented on GitHub (Jan 17, 2026): Hmm, the problem is reproducible for me too, but my MCP server is not returning any attachments, only text. Here's mcp server I am using (self-built): [grok-imagine-mcp](https://github.com/laruss/grok-imagine-mcp) it works fine for claude code. Using Opus 4.5 (github copilot) <img width="1395" height="389" alt="Image" src="https://github.com/user-attachments/assets/89f4a53a-8c31-4395-a25c-0859b65a33dc" />
Author
Owner

@luisrudge commented on GitHub (Jan 17, 2026):

@laruss your tool call is absolutely generating an image, hence the name grok-imagine_generate_image 😅

@luisrudge commented on GitHub (Jan 17, 2026): @laruss your tool call is absolutely generating an image, hence the name `grok-imagine_generate_image` 😅
Author
Owner

@rekram1-node commented on GitHub (Jan 17, 2026):

@laruss from the readme of linked project:

Generating Images
Once configured, you can ask Claude to generate images:

Generate an image of a sunset over mountains and save it to /Users/username/Pictures
Claude will use the generate_image tool, which will:

Send a request to the Chrome extension via WebSocket
The extension opens grok.com/imagine in a new tab
Automates entering the prompt and generating the image
Captures the generated image as base64
Closes the tab and sends the image back
The MCP server saves the image to the specified folder

So it definitely generates and returns image

@rekram1-node commented on GitHub (Jan 17, 2026): @laruss from the readme of linked project: > Generating Images > Once configured, you can ask Claude to generate images: > Generate an image of a sunset over mountains and save it to /Users/username/Pictures > Claude will use the generate_image tool, which will: > Send a request to the Chrome extension via WebSocket The extension opens grok.com/imagine in a new tab Automates entering the prompt and generating the image Captures the generated image as base64 Closes the tab and sends the image back The MCP server saves the image to the specified folder So it definitely generates and returns image
Author
Owner

@laruss commented on GitHub (Jan 18, 2026):

@rekram1-node it generates an image and saves it in the location requested by the agent (yeah, it's a bit tricky)

@laruss commented on GitHub (Jan 18, 2026): @rekram1-node it generates an image and saves it in the location requested by the agent (yeah, it's a bit tricky)
Author
Owner

@cheuklcl commented on GitHub (Jan 18, 2026):

@rekram1-node I also experience the stopping issue when using the Notion MCP. It only starts by calling notion_notion-search to search for documents and then begins analyzing them, but it stops before the search is completed at around 12.1 seconds. Using the plugin supermemory querying project data also stops after about 5.4 seconds. I’m not sure whether this is related to an MCP issue.

@cheuklcl commented on GitHub (Jan 18, 2026): @rekram1-node I also experience the stopping issue when using the Notion MCP. It only starts by calling notion_notion-search to search for documents and then begins analyzing them, but it stops before the search is completed at around 12.1 seconds. Using the plugin supermemory querying project data also stops after about 5.4 seconds. I’m not sure whether this is related to an MCP issue.
Author
Owner

@rekram1-node commented on GitHub (Jan 22, 2026):

Okay should be fixed in next release fr this time: https://github.com/anomalyco/opencode/commit/c2844697f38807d928368fdcd1e195e84a079077

@rekram1-node commented on GitHub (Jan 22, 2026): Okay should be fixed in next release fr this time: https://github.com/anomalyco/opencode/commit/c2844697f38807d928368fdcd1e195e84a079077
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4337