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
[FEATURE]: Add built-in tools to archive and unarchive sessions #61294
I searched the tracker and found no matching feature request.
Describe the enhancement you want to request
Expose built-in tools for archiving and unarchiving sessions, alongside the existing opencode.session_rename and opencode.session_move tools.
An agent can already archive and unarchive sessions by calling the HTTP API through the opencode api CLI command. Dedicated tools would make these actions discoverable and more efficient, without requiring the agent to look up API details and execute a shell command.
For example, a user could ask an agent to complete a task and archive the session when the work is done. The agent could then finish the requested workflow with a built-in tool.
Suggested interface:
opencode.session_archive({ sessionID? })
opencode.session_unarchive({ sessionID? })
Omitting sessionID should target the current session, consistent with the existing session tools. Providing it should target a specific session.
These tools should reuse the existing archive behavior. This request is for an agent-facing interface, not a new archive mechanism.
Thanks for the request! To restate it: you'd like built-in opencode.session_archive and opencode.session_unarchive tools (with an optional sessionID that defaults to the current session), next to session_rename and session_move, so agents can archive sessions without having to call the HTTP API through opencode api. Maintainers will consider it.
A plugin can't provide these tools yet, because the plugin ctx.session.update({ archived }) call currently has no effect (#61038). Once that's fixed, a plugin could add them.
We're not adding these as built-in tools because a plugin can provide them. Register session_archive and session_unarchive tools that call ctx.session.update({ sessionID, archived: true }) or archived: false, and default to the current session when no sessionID is passed.
One catch: session.update currently ignores archived (#61038). #61036 fixes it, and once that's merged a plugin like this will work.
Activity
opencodejr commentedon Nov 2, 2026
Thanks for the request! To restate it: you'd like built-in
opencode.session_archiveandopencode.session_unarchivetools (with an optionalsessionIDthat defaults to the current session), next tosession_renameandsession_move, so agents can archive sessions without having to call the HTTP API throughopencode api. Maintainers will consider it.A plugin can't provide these tools yet, because the plugin
ctx.session.update({ archived })call currently has no effect (#61038). Once that's fixed, a plugin could add them.Related issues:
session.updateignoresarchived(bug report and proposed fix)neriousy commentedon Nov 26, 2026
Thanks for the request, @nefthy-jl!
We're not adding these as built-in tools because a plugin can provide them. Register
session_archiveandsession_unarchivetools that callctx.session.update({ sessionID, archived: true })orarchived: false, and default to the current session when nosessionIDis passed.One catch:
session.updatecurrently ignoresarchived(#61038). #61036 fixes it, and once that's merged a plugin like this will work.