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
[BUG] Archiving a running session via the API gives no warning and the run continues #66604
In 2.4.1 I archived a session through the HTTP API while it was still running. The request succeeded with no warning or confirmation, and the run continued until it finished. Right after archiving, the session was returned by the archived=true list and not by the archived=false list.
Session.archive in packages/core/src/session/session.ts returns early only when the session is already archived. It does not look at execution state.
I understand that background sessions are meant to stay archived while they run (#66348). This report is about an interactive session that is already running when I archive it.
I expected archiving a running session to be refused, or to at least warn that the run will continue. I did not test how each client shows a later permission request or question from that session.
For comparison, OpenAI's help center says that archiving a Codex chat in the ChatGPT app stops a running chat, and shows a confirmation when one applies.
Plugins
No response
OpenCode version
2.4.1
Steps to reproduce
Create a session and ask it to run sleep 60 with Bash, then reply DONE.
While it runs, archive it: PATCH /api/session/<id> with {"archived": true}.
Check the archived=true and archived=false lists, then wait for the run to finish.
Screenshot
No screenshot. On my machine: archived at 10:00:12. The assistant turn in progress completed at 10:01:05, a new assistant reply was written at 10:01:05, and the session went idle at 10:01:06.
Operating System
Linux 6.12.116+deb13-amd64
Terminal
Not used for this reproduction; the session was archived through the HTTP API.
Thanks for the detailed report and the timeline, @Err0rCM.
You'd like archiving a session that is already running to either be refused, warn you that the run will continue, or stop the run, as the ChatGPT app does for Codex chats.
As far as I can tell, archiving currently does what it was built to do, so I'm treating this as a feature request rather than a bug. In 2.4.1, Session.archive (packages/core/src/session/session.ts) returns early only when the session is already archived. Otherwise it marks the session archived. It hides the session from lists and doesn't affect a run in progress. The docs also describe archived sessions that keep running: opencode run --archived creates a session archived so scripted or CI runs stay out of session lists and the inbox. I didn't find anything in the docs or the code I read that says archiving should stop a run or ask for confirmation.
Maintainers will consider the request. Related issues and pull requests:
Activity
opencodejr commentedon Nov 26, 2026
Thanks for the detailed report and the timeline, @Err0rCM.
You'd like archiving a session that is already running to either be refused, warn you that the run will continue, or stop the run, as the ChatGPT app does for Codex chats.
As far as I can tell, archiving currently does what it was built to do, so I'm treating this as a feature request rather than a bug. In 2.4.1,
Session.archive(packages/core/src/session/session.ts) returns early only when the session is already archived. Otherwise it marks the session archived. It hides the session from lists and doesn't affect a run in progress. The docs also describe archived sessions that keep running:opencode run --archivedcreates a session archived so scripted or CI runs stay out of session lists and the inbox. I didn't find anything in the docs or the code I read that says archiving should stop a run or ask for confirmation.Maintainers will consider the request. Related issues and pull requests: