Answer: Use events.on for a callback and unsubscribe when the listener is no longer needed, or for an async iterable use events.subscribe("updated"). Subscribe with the local name, such as updated. Status: Confirmed Entry: tool/opencode/integrations/subscribe-rpc-events-2 Revision: 1 Digest: sha256:b57a6f2f2c9d745e (changes whenever the content changes) Timeline: Created: 2026-11-13T03:55:55Z Last changed: 2026-11-13T03:55:55Z Last verified: 2026-11-20T13:44:44Z Next check: 2026-11-21T13:44:44Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of callback method | events.on | [1] | 2026-11-20 async iterable method | events.subscribe("updated") | [1] | 2026-11-20 subscription name | updated | [1] | 2026-11-20 received type prefix | rpc.acme.updated | [1] | 2026-11-20 Sources: [1] opencode. "Plugin RPC | OpenCode". https://opencode.ai/docs/build/plugins/rpc/ Role: primary. Accessed: 2026-11-20T13:44:44Z Quote: "Use events.on for a callback and unsubscribe when the listener is no longer needed" (Supports: callback method) Quote: "For an async iterable, use events.subscribe("updated")" (Supports: async iterable method) Quote: "Subscribe with the local name, such as updated ." (Supports: subscription name) Quote: "The received type is prefixed, such as rpc.acme.updated ." (Supports: received type prefix) Snapshot SHA-256: 37434d54cb17cadeed5e125bd89c1835a46ec5999bd75168c1eaa7349e5372c9 (captured 2026-11-18T13:38:20Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:23Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:44Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:44Z Last attempt: 2026-11-20T13:44:44Z Notes and limitations: Extracted automatically from a single official source (section "Subscribe"). Related: https://latestn.com/tool/opencode/integrations/supported-harnesses Which coding agent harnesses does opencode Console support? https://latestn.com/tool/opencode/integrations/tui-plugin-toast How do I show a toast notification from an opencode TUI plugin? https://latestn.com/tool/opencode/integrations/use-in-ci How do I use opencode in a CI pipeline like GitHub Actions? https://latestn.com/tool/opencode/integrations/stream-events-2 How do I stream events from the opencode SDK? https://latestn.com/tool/opencode/integrations/stream-events-effect How do I stream events from opencode using the Effect SDK? https://latestn.com/tool/opencode/integrations/subscribe-rpc-events How do I subscribe to RPC events in an opencode Effect plugin? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:55:55Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/integrations/subscribe-rpc-events-2/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/integrations/subscribe-rpc-events-2 POST: https://latestn.com/dispute/tool/opencode/integrations/subscribe-rpc-events-2 with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/integrations/subscribe-rpc-events-2?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I subscribe to opencode RPC events? Revision 1, last verified 2026-11-20T13:44:44Z. https://latestn.com/tool/opencode/integrations/subscribe-rpc-events-2 (accessed 2026-11-21T09:54:27Z). @misc{LatestN_tool_opencode_integrations_subscribe_rpc_events_2_r1, title = {How do I subscribe to opencode RPC events?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/integrations/subscribe-rpc-events-2}}, note = {Revision 1; digest sha256:b57a6f2f2c9d745e; last verified 2026-11-20T13:44:44Z; accessed 2026-11-21T09:54:27Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/integrations/subscribe-rpc-events-2