Skip to content

bug: statusline ignores execution started, succeeded and interrupted events #341

Open

Description

@jerome-benoit

Prerequisites

  • I searched the docs.
  • I searched existing issues, pull requests and Discussions.

:checkhealth opencode output

Unmodified plugin source at 4851ae503585dc5142ad66a98e8952a74e1f7b3a; the source export has no .git directory. The configured URL below is intentionally unused (connect = false).

==============================================================================
opencode:                                                                 2 ⚠️

opencode.nvim ~
- OS: Linux 7.2.13-200.fc44.x86_64 (x86_64)
- Neovim version: `0.12.6`
- ⚠️ WARNING opencode.nvim git commit: `fatal: not a git repository (or any of the parent directories): .git`
- `vim.g.opencode_opts`: {
    server = {
      connect = false,
      url = "http://127.0.0.1:9"
    }
  }

opencode.nvim [executables] ~
- ✅ OK `opencode v2.2.4+6700dd8` available.
- ✅ OK `curl` available.

opencode.nvim [snacks] ~
- ⚠️ WARNING snacks.nvim not available: `ask()` and `select()` not enhanced.

Describe the bug

The statusline does not consume session.execution.started, session.execution.succeeded or session.execution.interrupted. A started execution leaves the idle icon unchanged; success or interruption after a failure leaves the error icon unchanged.

The current OpenCode execution producer publishes these events. Both the autocmd registration and status transitions omit them.

Steps To Reproduce

With this plugin on runtimepath, run the following Lua in a clean Neovim. This exercises the real event emitter, autocmd and status module without a model or live server:

vim.g.opencode_opts = { server = { connect = false } }
vim.cmd("runtime plugin/events/status.lua")
local events = require("opencode.events")
local status = require("opencode.events.status")
local function emit(kind)
  events.emit({ type = kind, data = { sessionID = "ses_repro" } },
    { url = "http://127.0.0.1:9" })
end
emit("server.connected")
local idle = status.icon()
emit("session.execution.started")
print("started_remains_idle", status.icon() == idle)
emit("session.execution.failed")
local failure = status.icon()
emit("session.execution.succeeded")
print("succeeded_remains_error", status.icon() == failure)
emit("session.execution.interrupted")
print("interrupted_remains_error", status.icon() == failure)

Observed on Neovim 0.12.6/Linux x86_64: all three comparisons are true. No Neovim exception occurs; the status simply remains stale. Verification used controlled producer-shaped events, not a live SSE/model run.

Expected Behavior

Started execution sets busy; success and interruption set idle; failure sets error. Register and handle the execution lifecycle events consistently. This report does not request changing connection/disposal behavior.

Activity

  1. nickjvandyke commented on Nov 2, 2026

    @nickjvandyke
    Owner

    Ope! Thanks for catching this. These events changed in OpenCode v2 and I must have missed some. I'd gladly accept a PR if you have time for it!

  2. jerome-benoit commented on Nov 2, 2026

    @jerome-benoit
    ContributorAuthor

    Hello,

    I have a patch here https://raw.githubusercontent.com/jerome-benoit/dotfiles/refs/heads/main/patches/opencode-nvim-execution-lifecycle.patch, but it does not introduce backward compatibility with v1. Not sure I will be able to do a PR in a timely manner.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions