opencode-mission-control icon indicating copy to clipboard operation
opencode-mission-control copied to clipboard

chore: Migrate from deprecated session.idle to session.status event

Open nigel-dev opened this issue 9 months ago • 0 comments

Description

Mission Control's event hook in index.ts listens for session.idle events to trigger auto-status notifications. The audit report (Section 3) confirms that session.idle is deprecated in the OpenCode plugin SDK — it still fires, but session.status is the replacement.

Use Case

  • Forward compatibility: session.idle may be removed in a future OpenCode release, breaking MC's idle notifications.
  • Richer events: session.status provides more granular state information than the binary idle/not-idle signal.
  • Ecosystem alignment: Plugins like opencode-quota and opencode-notificator already use session.status.

Current Implementation

// src/index.ts:275
if (event.type === 'session.idle') {
  // auto-status logic
}

Proposed Solution

  1. Replace session.idle check with session.status and filter for the idle state within the status payload.
  2. Verify the session.status event shape from @opencode-ai/plugin types.
  3. Update auto-status.ts if needed to handle the new event format.
  4. Keep a fallback for session.idle temporarily if backwards compatibility with older OpenCode versions is needed.

Files Involved

  • src/index.ts:275 — event hook handler
  • src/hooks/auto-status.ts — auto-status logic

Additional Context

From audit report Section 3: "Key finding: session.idle is deprecated but still fires alongside session.status. MC should migrate to session.status."

nigel-dev avatar Feb 12 '26 03:02 nigel-dev