Skip to content

[FEATURE]: Add explicit hidden or ephemeral sessions for plugin background tasks #40863

Closed as not planned

Description

@cioffiAI

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Plugins sometimes need to run LLM tasks in the background without exposing those tasks as normal user conversations.

I built a local long-term memory plugin that uses this pattern:

  1. Wait for a user session to become idle.
  2. Create a child session with parentID.
  3. Send a constrained consolidation prompt.
  4. Read and persist the result.
  5. Delete the child session.

This works, but it relies on child sessions being excluded from user-facing root session lists. parentID represents hierarchy; it does not explicitly guarantee that a session is hidden, temporary, or automatically cleaned up.

A child session can still appear in unfiltered session queries and may remain orphaned if the process exits before cleanup.

I would like to propose an explicit opt-in property when creating a session, for example:

client.session.create({
  body: {
    title: "memory-consolidation",
    parentID,
    hidden: true,
    ephemeral: true,
  },
})

Possible semantics:

hidden: true excludes the session from normal user-facing session lists and pickers.
Hidden sessions remain accessible by exact ID and through an explicit includeHidden query option.
ephemeral: true allows automatic cleanup after completion, cancellation, process restart, or a configurable TTL.
parentID remains independent from visibility and lifetime.
Existing session behavior remains unchanged unless these options are enabled.

This would support background use cases such as:

memory consolidation;
indexing and context extraction;
automated summaries;
evaluation or validation passes;
plugin-managed background agents.

I have a working plugin and end-to-end tests demonstrating that child sessions can execute prompts, remain absent from root session listings, return structured results, and be deleted after completion.

Related discussions include #19999 and #20849, but this request is intentionally narrower: it concerns only session visibility and lifecycle for plugin-created background tasks.

I am happy to contribute documentation and tests first, or an implementation after the maintainers confirm the preferred API and semantics.

Activity

  1. github-actions commented on Aug 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions