Repository navigation
Closed
Labels
Description
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.tsreplaceclient.removewith functions that do not record calls, andsrc/v2.test.tscallsclient.removedirectly. Breaking thecleanupSessionscheck or dropping theremovecall 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.", bothabortandremovecalled, andisReviewerSessionfalse afterwards. - Config error message style (low).
reviewer.agent.cleanupSessions requires reviewer.agent.runtime "opencode".lacks theInvalid 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: truedoes 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.cleanupSessionsis only described in its own section, not in the options table next toreviewer.agent.runtime/maxInputBytes. - Config test coverage (low). Only
codex-sdkis tested for rejection;claude-agent-sdkand an explicitcleanupSessions: falseon an SDK runtime (currently rejected because the check is!== undefined) are untested — decide whetherfalseshould 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 runbashwould confirm the read-only sandbox. Also, withparentIDthe reviewer session's root now resolves to the main session, so an event that ever slipped pastisReviewerwould carry the user's intent and conversation (no such path today).
Solution / Next Steps
- Add a test that enables
cleanupSessions, flushes microtasks, and assertsremovewas called with the reviewer session ID; add the timeout-path test. - Align the error message with the others and add the README table row.
- Add the
claude-agent-sdk/ explicit-falseconfig tests and settle thefalsesemantics. - Consider a warning when
cleanupSessionsis set on V1. - Run one live OpenCode 2.x check that the child reviewer session still denies non-read tools.
Activity