opencode-mission-control
opencode-mission-control copied to clipboard
chore: Migrate from deprecated session.idle to session.status event
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.idlemay be removed in a future OpenCode release, breaking MC's idle notifications. - Richer events:
session.statusprovides more granular state information than the binary idle/not-idle signal. - Ecosystem alignment: Plugins like
opencode-quotaandopencode-notificatoralready usesession.status.
Current Implementation
// src/index.ts:275
if (event.type === 'session.idle') {
// auto-status logic
}
Proposed Solution
- Replace
session.idlecheck withsession.statusand filter for the idle state within the status payload. - Verify the
session.statusevent shape from@opencode-ai/plugintypes. - Update
auto-status.tsif needed to handle the new event format. - Keep a fallback for
session.idletemporarily if backwards compatibility with older OpenCode versions is needed.
Files Involved
src/index.ts:275— event hook handlersrc/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."