Skip to content

Plugin broken on OpenCode >= 1.2.20: session.status idle event replaced by session.idle #10

@AutomatorAlex

Description

@AutomatorAlex

Bug

The plugin stops generating titles on OpenCode >= 1.2.20 because the event it listens for no longer fires.

Root Cause

The plugin's event handler checks for:

event.type === "session.status" && event.properties.status.type === "idle"

In OpenCode 1.2.20+, the SDK replaced this with a dedicated session.idle event:

export type EventSessionIdle = {
    type: "session.idle";
    properties: {
        sessionID: string;
    };
};

The old session.status event with status.type === "idle"" is no longer emitted, so the plugin's event handler never fires. The log directory (~/.config/opencode/logs/smart-title/`) is never created and no titles are generated.

Fix

Update the event check to handle both the legacy and new event shapes:

if (
  (event.type === "session.idle") ||
  (event.type === "session.status" && event.properties.status?.type === "idle")
) {

Environment

  • OpenCode: 1.2.20
  • Plugin: latest (@tarquinen/opencode-smart-title)
  • Confirmed by checking EventSessionIdle in @opencode-ai/sdk/dist/gen/types.gen.d.ts

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