[BUG] Archiving a running session via the API gives no warning and the run continues
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Read packages/core/src/session/session.ts, especially Session.archive, and trace how it checks whether a session is already archived and how execution state is represented for interactive sessions. Reproduce the report with the HTTP API steps and inspect the relevant session tests. Done means archiving a running interactive session follows the intended refusal or warning behavior, with a test covering it.
Written by the indexing model from the issue text.
Description
Description
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 60with Bash, then replyDONE. - While it runs, archive it:
PATCH /api/session/<id>with{"archived": true}. - Check the
archived=trueandarchived=falselists, 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.
- Dominant language
- TypeScript
- Stars
- 228k
- Forks
- 31k
- Avg merge
- 5h 19m
- Merged PRs (30d)
- 457
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksPossibly taken @argszero claimed this today. Openarea/tui platform/wsl status/repro-simulated type/bug version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
anomalyco/opencode#66773 · 2 comments ·
Maintainers usually reply within 1 day
-
area/tui platform/linux type/feature version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#66585 · 1 comment ·
Maintainers usually reply within 1 day
-
area/web inference/go reproduced type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
anomalyco/opencode#66475 · 1 comment ·
Maintainers usually reply within 1 day
-
[FEATURE]: More colorful built-in Dracula theme for the desktop appMay be free again A pull request for this issue was closed without being merged. Openarea/desktop type/feature version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#66446 · 1 comment ·
Maintainers usually reply within 1 day
-
scripts: path comparisons break on Windows (check-greys fails the pre-push hook, upgrade-opentui skips nothing)Possibly taken @deosiree claimed this 2 days ago. Openplatform/windows status/repro-plausible type/bug version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/opencode#66192 · 2 comments ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
knaw-huc/textannoviz#742 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cloudflare/realtimekit-ui#219 ·
Maintainers usually reply within 1 day
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mermaid-js/mermaid-v13#1370 ·
Maintainers usually reply within 1 day
-
area:docs area:plugins bug documentation low-priority platform:windows
Difficulty 1/5 Under an hour Newbie friendliness 84/100
anthropics/claude-code#112676 ·