Skip to content

fix: reviewer sessions clutter the main session list in OpenCode v2 #50

Closed

Description

@thisfilipe

Bug description

When using opencode-auto-approval-plugin v0.7.0 with OpenCode v2 and the agent reviewer backend, every permission review creates a persistent top-level session titled Auto-approval review.

These sessions appear alongside normal conversations in the session history, quickly cluttering the UI during ordinary development.

Since all-tools mode can review every tool invocation, a single coding session can generate dozens of unrelated-looking conversations.

Steps to reproduce

  1. Install opencode-auto-approval-plugin v0.7.0 on OpenCode v2.
  2. Configure mode: "all-tools" and reviewer.backend: "agent".
  3. Start a coding session and execute several tool calls.
  4. Open the main session list.

Actual behavior: Multiple independent Auto-approval review sessions appear in the session list and persist after the reviews finish.

Expected behavior: Internal reviewer sessions should not appear as independent user conversations or accumulate indefinitely. Reviews should remain silent and require no manual cleanup.

Likely cause

In src/v2.ts, createV2SessionClient() calls context.session.create() with a title and reviewer agent but without a parentID. The sessions are created as top-level sessions.

Although the reviewer agent is marked hidden, this does not hide the sessions themselves. The reviewer lifecycle also does not remove completed sessions.

Suggested fix

  • Associate reviewer sessions with the originating session using parentID where supported.
  • Automatically remove reviewer sessions after their verdict has been collected, including error and timeout paths, without interrupting active reviews.
  • Optionally provide a retainReviewSessions debugging setting, defaulting to false.
  • Ensure cleanup does not affect the parent session, review results, or concurrent reviews.

Alternatively, use a non-persistent model generation API if it can preserve the current review capabilities.

The fix should work with the existing agent backend and OpenCode-configured models, without requiring a separate API key or changing the approval policy.

Environment

  • OpenCode v2
  • opencode-auto-approval-plugin v0.7.0
  • mode: "all-tools"
  • reviewer.backend: "agent"
  • OpenCode-configured DeepSeek model

This is particularly noticeable during long autonomous coding sessions with frequent tool calls.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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