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

Aperta Adatta ai principianti
#66,604 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Leggi packages/core/src/session/session.ts, in particolare Session.archive, e ricostruisci come viene verificato se una sessione è già archiviata e come viene rappresentato lo stato di esecuzione delle sessioni interattive. Riproduci la segnalazione seguendo i passaggi dell’API HTTP ed esamina i test pertinenti delle sessioni. Il lavoro è completato quando l’archiviazione di una sessione interattiva in esecuzione segue il comportamento previsto di rifiuto o avviso ed è coperta da un test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
228k
Fork
31k
Merge medio
5h 19m
PR unite (30g)
457

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.