Skip to content

Follow up OpenCode upstream updates: notification/permissionDenied hook mappings, references key, V2 beta tracking #2592

Description

@dyoshikawa

Summary

Three OpenCode drifts as of v1.18.14: two canonical hook events (notification, permissionDenied) have faithful upstream plugin counterparts but are unmapped, and the stable references config key — a genuine context-provisioning surface — has no rulesync coverage. Additionally, the OpenCode V2 beta restructures nearly every key rulesync emits and deserves a tracking note.

Canonical repo note: sst/opencode 301-redirects to anomalyco/opencode (same repository id). Latest stable at research time: v1.18.14 (2026-08-05).

Recent Releases

Gaps

1. hooks — canonical notification unmapped despite tui.toast.show

  • Upstream: the plugin API exposes tui.toast.show (payload: message, variant info/success/warning/error, optional title, duration) — https://opencode.ai/docs/plugins/
  • rulesync (project, global): notification is mapped for many other tools but absent from OPENCode_HOOK_EVENTS (src/types/hooks.ts:323) and CANONICAL_TO_OPENCODE_EVENT_NAMES (:1115), so OpenCode users get no plugin stub for it.
  • Follow-up: add notification to the event set and map it to tui.toast.show.

2. hooks — canonical permissionDenied unmapped despite permission.replied

  • Upstream: permission.replied carries sessionID, requestID, and reply ("once" | "always" | "reject"), so denial is distinguishable — https://opencode.ai/docs/plugins/
  • rulesync: maps permissionRequestpermission.asked but nothing to permission.replied.
  • Follow-up: gate on reply === "reject" using the same mechanism as SHELL_EVENT_TOOL_GATES in src/features/hooks/opencode-style-generator.ts. Because KILO_HOOK_EVENTS aliases the OpenCode set (src/types/hooks.ts:345), this lands for Kilo too.

3. rules — the references config key has no coverage

  • Upstream: references (stable V1; renamed from deprecated reference in v1.17.1) maps an alias to a local path or a git repository (+ branch), with description and hidden; entries carrying a description are injected into the agent's system context automatically — a context-provisioning surface alongside instructions, not just autocomplete. https://opencode.ai/docs/references/
  • rulesync: writes instructions into opencode.json but never touches references.
  • Follow-up: discretionary — decide whether rulesync should author references (most likely via a tool-scoped opencode section). This is a new capability rather than a fix.

4. Forward-looking — V2 beta restructures nearly every emitted key

Per https://opencode.ai/v2/docs/migrate-v1: permission/tools → ordered permissions array, agentagents, commandcommands, pluginplugins, referencereferences, agent promptsystem, disabledisabled, permission actions bashshell / tasksubagent, MCP enabled → inverted disabled, timeout split into timeout.catalog/timeout.execution. V1 config is not auto-migrated and the binary is separate (opencode2), so this would be a new target id, not a change to the existing adapters. Track; do not implement while the APIs are marked unstable.

Proposed Follow-up

  1. Map notificationtui.toast.show and permissionDenied → gated permission.replied (fixes Kilo simultaneously).
  2. Decide on references authoring.
  3. Keep a watch on V2 GA for an opencode2 target.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    consideringenhancementNew feature or requestmaintainer-scrapRough notes for AI implementation. Not for human eyes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions