Repository navigation
Description
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
- Install
opencode-auto-approval-pluginv0.7.0 on OpenCode v2. - Configure
mode: "all-tools"andreviewer.backend: "agent". - Start a coding session and execute several tool calls.
- 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
parentIDwhere supported. - Automatically remove reviewer sessions after their verdict has been collected, including error and timeout paths, without interrupting active reviews.
- Optionally provide a
retainReviewSessionsdebugging setting, defaulting tofalse. - 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-pluginv0.7.0mode: "all-tools"reviewer.backend: "agent"- OpenCode-configured DeepSeek model
This is particularly noticeable during long autonomous coding sessions with frequent tool calls.
Activity