[BUG] Archiving a running session via the API gives no warning and the run continues

Offen Anfängerfreundlich
#66,604 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
76/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Lies packages/core/src/session/session.ts, insbesondere Session.archive, und verfolge, wie geprüft wird, ob eine Sitzung bereits archiviert ist, und wie der Ausführungszustand für interaktive Sitzungen dargestellt wird. Reproduziere den Bericht mit den HTTP-API-Schritten und untersuche die relevanten Sitzungstests. Als abgeschlossen gilt die Aufgabe, wenn das Archivieren einer laufenden interaktiven Sitzung dem vorgesehenen Ablehnungs- oder Warnverhalten folgt und ein Test dies abdeckt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/sdk-api platform/linux type/feature version/v2
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
  1. Create a session and ask it to run sleep 60 with Bash, then reply DONE.
  2. While it runs, archive it: PATCH /api/session/<id> with {"archived": true}.
  3. 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.

Vorherrschende Sprache
TypeScript
Sterne
228k
Forks
31k
Ø Merge
5 Std. 19 Min.
Gemergte PRs (30 T.)
457

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anomalyco/opencode

Alle Issues in anomalyco/opencode

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.