Skip to content

Follow-ups from PR #51: reviewer session cleanup tests, config messages and docs #64

Closed

Description

@dyoshikawa

Background

PR #51 (by @thisfilipe) links OpenCode V2 reviewer sessions to the reviewed session through parentID and adds an opt-in reviewer.agent.cleanupSessions that deletes the reviewer session after the decision (best-effort, non-blocking, V2 opencode runtime only). The re-review on 2026-10-23 found no merge blockers; the follow-ups below were left out of the PR so it could merge.

Details

  • Cleanup is never asserted to run (mid). The two opt-in tests in src/agent-reviewer.test.ts replace client.remove with functions that do not record calls, and src/v2.test.ts calls client.remove directly. Breaking the cleanupSessions check or dropping the remove call would leave every test green.
  • Timeout path with cleanup is untested (mid). No test covers a prompt that never resolves with cleanupSessions: true: rejection with "Reviewer timed out.", both abort and remove called, and isReviewerSession false afterwards.
  • Config error message style (low). reviewer.agent.cleanupSessions requires reviewer.agent.runtime "opencode". lacks the Invalid auto-approval plugin options: prefix the other messages use, and says "requires" where the neighbouring check says "needs".
  • Silently ignored on V1 (low). With runtime: "opencode" on OpenCode 1.x, cleanupSessions: true does nothing. README states this, but the config comment says options for another runtime should not be silently ignored; a startup warning on V1 would match that.
  • README options table (low). reviewer.agent.cleanupSessions is only described in its own section, not in the options table next to reviewer.agent.runtime / maxInputBytes.
  • Config test coverage (low). Only codex-sdk is tested for rejection; claude-agent-sdk and an explicit cleanupSessions: false on an SDK runtime (currently rejected because the check is !== undefined) are untested — decide whether false should be accepted.
  • Unverified host behaviour (info). Whether the OpenCode V2 server merges the parent's permission rules into a child session cannot be seen from the client types. A live check that a parentID-linked reviewer session still cannot run bash would confirm the read-only sandbox. Also, with parentID the reviewer session's root now resolves to the main session, so an event that ever slipped past isReviewer would carry the user's intent and conversation (no such path today).

Solution / Next Steps

  1. Add a test that enables cleanupSessions, flushes microtasks, and asserts remove was called with the reviewer session ID; add the timeout-path test.
  2. Align the error message with the others and add the README table row.
  3. Add the claude-agent-sdk / explicit-false config tests and settle the false semantics.
  4. Consider a warning when cleanupSessions is set on V1.
  5. Run one live OpenCode 2.x check that the child reviewer session still denies non-read tools.

Activity

  1. added
    enhancement
    maintainer-scrap
    on Oct 23, 2026
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

    enhancementmaintainer-scrap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions