Skip to content

Opencode stuck in Plan mode #3241

Closed
Closed

Description

@westito

Since new update (0.15.7) Agent simply started to using CLI commands (cat + grep pipe, sed) and python scripts to modify files, instead of modify tool.
As I figured out it is stuck in "Plan" mode. When I first realized I see "Agent mode" while did this so I didn't understand. After I changed with tab, it went to "Plan" mode, but can't change back! Even with --agent param it stays in "Plan" mode.

Image Image

When I ased for tools, it says don't have edit tool:
Image

Activity

  1. github-actions commented on Oct 17, 2025

    @github-actions
    Contributor

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

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

  2. westito commented on Oct 17, 2025

    @westito
    Author

    Log when start with --agent

    INFO  2025-10-17T12:28:02 +46ms service=default version=0.15.7 args=["--log-level","DEBUG","--agent"] opencode
    INFO  2025-10-17T12:28:02 +0ms service=project directory=/Users/westito/Projects/7Hills fromDirectory
    INFO  2025-10-17T12:28:02 +4ms service=config path=/Users/westito/.config/opencode/config.json loading
    INFO  2025-10-17T12:28:02 +0ms service=config path=/Users/westito/.config/opencode/opencode.json loading
    INFO  2025-10-17T12:28:02 +3ms service=config path=/Users/westito/.config/opencode/opencode.jsonc loading
    INFO  2025-10-17T12:28:02 +1ms service=bun cmd=["/Users/westito/.nvm/versions/node/v24.0.2/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/plugin@0.15.7","--exact"] cwd=/Users/westito/.config/opencode running
    INFO  2025-10-17T12:28:02 +2ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
    INFO  2025-10-17T12:28:02 +2ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
    INFO  2025-10-17T12:28:02 +16ms service=bus type=* subscribing
    INFO  2025-10-17T12:28:02 +0ms service=bus type=session.updated subscribing
    INFO  2025-10-17T12:28:02 +0ms service=bus type=message.updated subscribing
    INFO  2025-10-17T12:28:02 +0ms service=bus type=message.part.updated subscribing
    INFO  2025-10-17T12:28:02 +0ms service=format init
    INFO  2025-10-17T12:28:02 +0ms service=bus type=file.edited subscribing
    INFO  2025-10-17T12:28:02 +2ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, jdtls enabled LSP servers
    INFO  2025-10-17T12:28:02 +1ms service=models.dev file={} refreshing
    INFO  2025-10-17T12:28:02 +1ms service=bun code=0 stdout=bun add v1.3.0 (b0a6feca)
    
    installed @opencode-ai/plugin@0.15.7
    
    [2.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-10-17T12:28:02 +1ms service=provider init
    INFO  2025-10-17T12:28:02 +1ms service=provider providerID=opencode found
    INFO  2025-10-17T12:28:02 +0ms service=provider providerID=anthropic found
    INFO  2025-10-17T12:28:02 +0ms service=provider providerID=openai found
    INFO  2025-10-17T12:28:02 +0ms service=provider providerID=lmstudio found
    INFO  2025-10-17T12:28:02 +3ms service=default cmd=["/Users/westito/.cache/opencode/tui/tui-qdezgy93."] tui
    INFO  2025-10-17T12:28:02 +31ms service=server method=GET path=/project/current request
    INFO  2025-10-17T12:28:02 +2ms service=server duration=1 response
    INFO  2025-10-17T12:28:02 +0ms service=server method=GET path=/path request
    INFO  2025-10-17T12:28:02 +0ms service=server duration=0 response
    INFO  2025-10-17T12:28:02 +1ms service=server method=GET path=/agent request
    INFO  2025-10-17T12:28:02 +0ms service=server duration=0 response
    INFO  2025-10-17T12:28:02 +3ms service=server method=GET path=/config request
    INFO  2025-10-17T12:28:02 +0ms service=server duration=0 response
    DEBUG 2025-10-17T12:28:02 +3ms service=tui TUI launched
    INFO  2025-10-17T12:28:02 +6ms service=server method=GET path=/command request
    INFO  2025-10-17T12:28:02 +1ms service=server duration=1 response
    DEBUG 2025-10-17T12:28:02 +0ms service=tui config={"$schema":"https://opencode.ai/config.json","agent":{"build":{"description":"Agent for build, lint, analyze project and run code generation. Summarizes the output. You must pass the command as input.","disable":false,"mode":"subagent","model":"lmstudio/qwen/qwen3-coder-30b","permission":{"edit":"","webfetch":""},"prompt":"You are a build output analyzer.\n\n## STEP 1: Execute command (DO THIS FIRST)\n\nALWAYS RUN COMMAND WITH tail! Because it will be truncated.\n\n```bash\n{COMMAND_HERE} 2>&1 | tail -c 29900; echo \"EXIT_CODE=${PIPESTATUS[0]}\";\n```\n\nReplace {COMMAND_HERE} with the actual command.\n\n## STEP 2: Parse errors and warnings\n\nExtract from the output:\n- Error patterns with [file:line] format\n- Warning patterns with [file:line] format\n- Notices patterns with [file:line] format\n- Errors / Warnings / Notices without file information\n- Use language-specific patterns below\n- Truncated: if command results with \"Output was truncated\" notice\n\n## STEP 3: Format response (DO THIS LAST)\n\nReturn this structure:\n```\nSTATUS: [SUCCESS/FAILED]\nTRUNCATED: [YES/NO] \n\nERRORS:\n- [file:line] message\n\nWARNINGS:\n- [file:line] message\n\nNOTICES:\n- [file:line] message\n\nOTHER MESSAGES:\n- message\n\nSUMMARY:\nBrief explanation\n[If truncated: \"Output truncated - errors may be incomplete. Run again with filtering.\"]\n```\n\n## MANDATORY RULES:\n1. Check EXIT_CODE at end of output\n2. Report truncation if detected\n3. Only report actual errors from output\n4. Write \"(none)\" if no errors/warnings\n5. Use exact `[file:line]` format\n\n## Error/Warning patterns:\n\n**TypeScript/JavaScript:** error TS, Module not found, Cannot find\n**Rust:** error[E, error:, thread 'main' panicked\n**Go:** .go:line:col:, # command-line-arguments\n**Python:** SyntaxError, ImportError, TypeError\n**Make:** error:, No rule to make target\n**Gradle:** BUILD FAILED, FAILURE: Build failed, > Task :app:compile\n**Java:** .java:line: error:, cannot find symbol, incompatible types, package does not exist\n**Kotlin:** .kt:line:col: error:, Unresolved reference, Type mismatch, e: (error), w: (warning)\n**Android:** ERROR:, AAPT: error:, Manifest merger failed, Duplicate class, Program type already present\n**Flutter:** Error:, Compiler message:, Exception:, Gradle task assembleDebug failed, Xcode build failed","temperature":0.1,"tools":{"bash":true,"edit":false,"write":false},"top_p":0,"name":"build"},"general":{"description":"","disable":false,"mode":"","model":"","permission":{"edit":"","webfetch":""},"prompt":"","temperature":0,"tools":{},"top_p":0},"plan":{"description":"","disable":false,"mode":"","model":"","permission":{"edit":"","webfetch":""},"prompt":"","temperature":0,"tools":{},"top_p":0}},"autoshare":false,"autoupdate":false,"command":{},"disabled_providers":[],"experimental":{"disable_paste_summary":false,"hook":{"file_edited":{},"session_completed":[]}},"formatter":{},"instructions":[],"keybinds":{"agent_cycle":"","agent_cycle_reverse":"","agent_list":"","app_exit":"","app_help":"","editor_open":"","file_close":"","file_diff_toggle":"","file_list":"","file_search":"","input_clear":"","input_newline":"","input_paste":"","input_submit":"","leader":"ctrl+x","messages_copy":"","messages_first":"","messages_half_page_down":"","messages_half_page_up":"","messages_last":"","messages_layout_toggle":"","messages_next":"","messages_page_down":"","messages_page_up":"","messages_previous":"","messages_redo":"","messages_revert":"","messages_undo":"","model_cycle_recent":"","model_cycle_recent_reverse":"","model_list":"","project_init":"","session_child_cycle":"","session_child_cycle_reverse":"","session_compact":"","session_export":"","session_interrupt":"","session_list":"","session_new":"","session_share":"","session_timeline":"","session_unshare":"","switch_agent":"","switch_agent_reverse":"","switch_mode":"","switch_mode_reverse":"","theme_list":"","thinking_blocks":"","tool_details":""},"layout":"","lsp":{},"mcp":{"context7":{"command":["npx","-y","@upstash/context7-mcp@latest"],"enabled":false,"environment":{},"type":"local","url":""},"dart":{"command":["dart","mcp_server"],"enabled":false,"environment":{},"type":"local","url":""},"figma":{"enabled":false,"headers":{},"type":"remote","url":"http://127.0.0.1:3845/mcp"},"jetbrains":{"enabled":false,"headers":{},"type":"remote","url":"http://localhost:64342/sse"}},"mode":{"build":{"description":"","disable":false,"mode":"","model":"","permission":{"edit":"","webfetch":""},"prompt":"","temperature":0,"tools":{},"top_p":0},"plan":{"description":"","disable":false,"mode":"","model":"","permission":{"edit":"","webfetch":""},"prompt":"","temperature":0,"tools":{},"top_p":0}},"model":"anthropic/claude-sonnet-4-5-20250929","permission":{"edit":"","webfetch":""},"plugin":[],"provider":{"anthropic":{"api":"","env":[],"id":"","models":{"claude-sonnet-4-5-20250929":{"attachment":false,"cost":{"cache_read":0,"cache_write":0,"input":0,"output":0},"experimental":false,"id":"","limit":{"context":0,"output":0},"name":"","options":{"thinking":{"budgetTokens":16000,"type":"enabled"}},"provider":{"npm":""},"reasoning":false,"release_date":"","temperature":false,"tool_call":false}},"name":"","npm":"","options":{"apiKey":"","baseURL":""}},"lmstudio":{"api":"","env":[],"id":"","models":{"granite-4.0-h-tiny-mlx":{"attachment":false,"cost":{"cache_read":0,"cache_write":0,"input":0,"output":0},"experimental":false,"id":"","limit":{"context":0,"output":0},"name":"Granite 4.0 H Tiny Mlx (local)","options":{},"provider":{"npm":""},"reasoning":false,"release_date":"","temperature":false,"tool_call":false},"qwen/qwen3-coder-30b":{"attachment":false,"cost":{"cache_read":0,"cache_write":0,"input":0,"output":0},"experimental":false,"id":"","limit":{"context":0,"output":0},"name":"Qwen3 Coder 30b (local)","options":{},"provider":{"npm":""},"reasoning":false,"release_date":"","temperature":false,"tool_call":false}},"name":"LM Studio (local)","npm":"@ai-sdk/openai-compatible","options":{"apiKey":"","baseURL":"http://127.0.0.1:1234/v1"}},"openai":{"api":"","env":[],"id":"","models":{"gpt-5":{"attachment":false,"cost":{"cache_read":0,"cache_write":0,"input":0,"output":0},"experimental":false,"id":"","limit":{"context":0,"output":0},"name":"","options":{"include":["reasoning.encrypted_content"],"reasoningEffort":"high","reasoningSummary":"auto","textVerbosity":"low"},"provider":{"npm":""},"reasoning":false,"release_date":"","temperature":false,"tool_call":false}},"name":"","npm":"","options":{"apiKey":"","baseURL":""}}},"share":"","small_model":"","snapshot":false,"theme":"","tools":{},"tui":{"scroll_speed":0},"username":"westito","watcher":{"ignore":[]}} Loaded config
    INFO  2025-10-17T12:28:02 +2ms service=tui commands={"agent_cycle":{},"agent_cycle_reverse":{},"agent_list":{},"app_exit":{},"app_help":{},"editor_open":{},"input_clear":{},"input_newline":{},"input_paste":{},"input_submit":{},"messages_copy":{},"messages_first":{},"messages_half_page_down":{},"messages_half_page_up":{},"messages_last":{},"messages_page_down":{},"messages_page_up":{},"messages_redo":{},"messages_undo":{},"model_cycle_recent":{},"model_cycle_recent_reverse":{},"model_list":{},"project_init":{},"session_child_cycle":{},"session_child_cycle_reverse":{},"session_compact":{},"session_export":{},"session_interrupt":{},"session_list":{},"session_new":{},"session_share":{},"session_timeline":{},"session_unshare":{},"theme_list":{},"thinking_blocks":{},"tool_details":{}} Loaded commands
    INFO  2025-10-17T12:28:02 +0ms service=server method=GET path=/file/status request
    INFO  2025-10-17T12:28:02 +0ms service=server duration=0 response
    INFO  2025-10-17T12:28:02 +1ms service=server method=GET path=/config/providers request
    INFO  2025-10-17T12:28:02 +1ms service=server duration=1 response
    INFO  2025-10-17T12:28:02 +1ms service=server method=GET path=/event request
    INFO  2025-10-17T12:28:02 +0ms service=server event connected
    INFO  2025-10-17T12:28:02 +0ms service=bus type=* subscribing
    INFO  2025-10-17T12:28:02 +1ms service=server duration=1 response
    INFO  2025-10-17T12:28:02 +1ms service=server method=GET path=/tui/control/next request
    DEBUG 2025-10-17T12:28:02 +7ms service=tui model=claude-sonnet-4-5-20250929 provider=anthropic Selected model from config
    DEBUG 2025-10-17T12:28:02 +25ms service=tui timeTakenMs=0 messages.renderView
    DEBUG 2025-10-17T12:28:02 +11ms service=tui file=/Users/westito/.local/state/opencode/tui State saved to file
    DEBUG 2025-10-17T12:28:02 +3ms service=tui color=#000000 isDark=true Background color
    DEBUG 2025-10-17T12:28:02 +9ms service=tui file=/Users/westito/.local/state/opencode/tui State saved to file
    DEBUG 2025-10-17T12:28:02 +8ms service=tui timeTakenMs=0 messages.renderView
    
  3. westito commented on Oct 17, 2025

    @westito
    Author

    I found! I have a build.md agent. When I delete it is working!

  4. westito commented on Oct 17, 2025

    @westito
    Author

    I found! It has

    write: false
    edit:false
    

    settings that forces primary agent into plan mode! thats wrong. It is worked like a charm before.

    I tried enable these, but wont't help. It is only works when delete subagent completely

  5. rekram1-node commented on Oct 17, 2025

    @rekram1-node
    Contributor

    @westito This is because you defined an agent that is overriding the build agent, agent names need to be unique so in your build.md you overwrote behaviors of the primary agent.

    Is there anything we could do to make that more obvious?

  6. self-assigned this
    on Oct 17, 2025
  7. westito commented on Oct 17, 2025

    @westito
    Author

    It wasn't itentional, but it is not a use case to override default builder agent? Anyways. It is worked when I first added this build subagent - or I didn't realized edit mode stopped working. I think would be obvious if opencode fails starting when the config is wrong.

  8. rekram1-node commented on Oct 17, 2025

    @rekram1-node
    Contributor

    Well technically the config isn't wrong right, we do intentionally allow you to override the default agents

    maybe if this happens to more people we can do some type of warning about it or something, or maybe document it better?

  9. westito commented on Oct 17, 2025

    @westito
    Author

    Okay. Then there is an issue. May I overridden the built-in build agent, but is worked before update. But now I cant use Opencode in agent mode (stays plan)

  10. rekram1-node commented on Oct 17, 2025

    @rekram1-node
    Contributor

    Can you share your agents and maybe we can get to the bottom of this? I think what is happening is you have an agent called build, that is overriding the primary build agent and leading to unexpected behavior, if you rename build -> buildsubagent or something I think everything should be fixed

  11. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions