anomalyco / anomalyco/opencode

Archiving a parent session leaves child/subagent sessions active

Open
#40,258 0 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 3, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Archiving a parent session does not archive its child/subagent sessions. The API updates only the requested session row, so children remain active even though their parent is archived.

This causes orphaned active child sessions in clients. A client can try to cascade itself, but session lists may be filtered or paginated, making a client-side cascade incomplete and nondeterministic.

Reproduction

  1. Create a parent session.
  2. Spawn one or more child sessions (parentID set).
  3. Archive the parent with PATCH /session/{id} and time.archived set.
  4. Query the children or inspect storage.

The parent has time.archived; its children do not.

Current implementation

Session.setArchived calls patch(sessionID, ...) for one session. By contrast, Session.remove recursively loads and removes children(sessionID) first.

Observed in v1.18.10 and current dev source.

Expected

Please define and implement hierarchy-aware archive semantics, preferably one of:

  • archive descendants recursively in the backend; or
  • add an explicit cascade option to the archive/update endpoint.

Unarchive semantics need an explicit decision so independently archived children are not unintentionally restored.

Related client symptom: https://github.com/openchamber/openchamber/issues/2266

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.