You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2: plugin ctx.session.update drops metadata, title is saved #51468
When a plugin calls ctx.session.update with title and metadata, the title is saved but metadata is silently dropped. The call does not return an error. The same update through opencode api session.update saves metadata for the same session.
Possible cause, not confirmed: plugin API calls go through adaptApiMethod in @opencode/plugin, which re-decodes the input against the endpoint schemas before calling the server. metadata may get lost there.
Plugins
Only the minimal probe plugin below, placed project-local.
OpenCode version
2.0.18 (also seen on 2.0.15 in an earlier test)
Steps to reproduce
In an empty folder, create .opencode/plugins/probe.ts:
From that folder, run opencode run --standalone --print-logs "Reply with just: ok".
Check the session: sqlite3 -readonly ~/.local/share/opencode/opencode.db "select title, metadata from session_v2 where id='<id>'". The title is probe-updated, metadata is empty.
Control: opencode api --standalone session.update --param sessionID=<id> -d '{"metadata":{"probe":{"ok":true}}}'. Now metadata is saved.
Expected: step 2 saves metadata the same way step 4 does.
Operating System
macOS 27.0
Terminal
Ghostty 1.3.1 (stable, macOS, Metal renderer)
Issue created and tested with the help of AI (Claude Opus 5.5), edited and corrected by me.
Thanks for reporting this! Plugin calls to ctx.session.update now save metadata alongside the title, fixed in 2.0.22. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please comment or reopen if it still happens on that version.
Activity
neriousy commentedon Oct 20, 2026
Thanks for reporting this! Plugin calls to
ctx.session.updatenow savemetadataalongside the title, fixed in 2.0.22. Update withopencode upgradeornpm i -g @opencode/cli@latest(desktop: update the app). Please comment or reopen if it still happens on that version.sudokvn commentedon Oct 21, 2026
I tested on 2.1.2 and it's fixed: the session update now saves both the title and the metadata. Thanks!